Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 openssl,
6 libiconv,
7 makeWrapper,
8 imagemagick,
9 makeFontsConf,
10}:
11stdenv.mkDerivation {
12 pname = "sgfutils";
13 version = "0.25-unstable-2017-11-27";
14 src = fetchFromGitHub {
15 owner = "yangboz";
16 repo = "sgfutils";
17 rev = "11ab171c46cc16cc71ac6fc901d38ea88d6532a4";
18 hash = "sha256-KWYgTxz32WK3MKouj1WAJtZmleKt5giCpzQPwfWruZQ=";
19 };
20 nativeBuildInputs = [ makeWrapper ];
21 buildInputs = [ openssl ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
22 buildPhase = ''
23 runHook preBuild
24 make all
25 runHook postBuild
26 '';
27 installPhase = ''
28 runHook preInstall
29 mkdir -p $out/bin
30 cp sgf sgfsplit sgfvarsplit sgfstrip sgfinfo sgfmerge sgftf \
31 sgfcheck sgfdb sgfdbinfo sgfcharset sgfcmp sgfx \
32 ngf2sgf nip2sgf nk2sgf gib2sgf sgftopng ugi2sgf \
33 $out/bin
34 runHook postInstall
35 '';
36 postFixup = ''
37 wrapProgram $out/bin/sgftopng \
38 --prefix PATH : ${lib.makeBinPath [ imagemagick ]} \
39 --set-default FONTCONFIG_FILE ${makeFontsConf { fontDirectories = [ ]; }}
40 '';
41 meta = with lib; {
42 homepage = "https://homepages.cwi.nl/~aeb/go/sgfutils/html/sgfutils.html";
43 description = "Command line utilities that help working with SGF files";
44 longDescription = ''
45 The package sgfutils is a collection of command line utilities that help working with SGF files,
46 especially when they describe go (igo, weiqi, baduk) games.
47 '';
48 license = licenses.gpl2Plus;
49 maintainers = with maintainers; [ ggpeti ];
50 platforms = platforms.all; # tested on x86_64-linux and aarch64-darwin
51 };
52}