about summary refs log tree commit diff
path: root/pkgs/by-name/sg/sgfutils
diff options
context:
space:
mode:
authorPeter Ferenczy <ggpeti@gmail.com>2023-11-28 17:47:02 +0200
committerPeter Ferenczy <ggpeti@gmail.com>2023-12-04 23:40:12 +0200
commitdef748adb46d17b79ade7a2ac0b3a244eb5ac77a (patch)
tree3904df438cf26e87df34ed7cd4b06a0c68259fc3 /pkgs/by-name/sg/sgfutils
parentaa51f78737b949a0f8e389148069d066c73df28a (diff)
sgfutils: init at unstable-2017-11-27
prefix path instead of setting

apply buildPhase suggestion

Co-authored-by: Martin Weinelt <mweinelt@users.noreply.github.com>

apply installPhase suggestion

remove package from all-packages.nix

add by-name package

add version number

fix description
Diffstat (limited to 'pkgs/by-name/sg/sgfutils')
-rw-r--r--pkgs/by-name/sg/sgfutils/package.nix52
1 files changed, 52 insertions, 0 deletions
diff --git a/pkgs/by-name/sg/sgfutils/package.nix b/pkgs/by-name/sg/sgfutils/package.nix
new file mode 100644
index 0000000000000..7548ab42107e1
--- /dev/null
+++ b/pkgs/by-name/sg/sgfutils/package.nix
@@ -0,0 +1,52 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, openssl
+, iconv
+, makeWrapper
+, imagemagick
+, makeFontsConf
+}:
+stdenv.mkDerivation
+{
+  pname = "sgfutils";
+  version = "0.25-unstable-2017-11-27";
+  src = fetchFromGitHub {
+    owner = "yangboz";
+    repo = "sgfutils";
+    rev = "11ab171c46cc16cc71ac6fc901d38ea88d6532a4";
+    hash = "sha256-KWYgTxz32WK3MKouj1WAJtZmleKt5giCpzQPwfWruZQ=";
+  };
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ iconv ];
+  buildPhase = ''
+    runHook preBuild
+    make all
+    runHook postBuild
+  '';
+  installPhase = ''
+    runHook preInstall
+    mkdir -p $out/bin
+    cp sgf sgfsplit sgfvarsplit sgfstrip sgfinfo sgfmerge sgftf \
+      sgfcheck sgfdb sgfdbinfo sgfcharset sgfcmp sgfx \
+      ngf2sgf nip2sgf nk2sgf gib2sgf sgftopng ugi2sgf \
+      $out/bin
+    runHook postInstall
+  '';
+  postFixup = ''
+    wrapProgram $out/bin/sgftopng \
+      --prefix PATH : ${lib.makeBinPath [ imagemagick ]} \
+      --set-default FONTCONFIG_FILE ${makeFontsConf { fontDirectories = []; }}
+  '';
+  meta = with lib; {
+    homepage = "https://homepages.cwi.nl/~aeb/go/sgfutils/html/sgfutils.html";
+    description = "Command line utilities that help working with SGF files";
+    longDescription = ''
+      The package sgfutils is a collection of command line utilities that help working with SGF files,
+      especially when they describe go (igo, weiqi, baduk) games.
+    '';
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ ggpeti ];
+    platforms = platforms.all; # tested on x86_64-linux and aarch64-darwin
+  };
+}