package.nix (1192B)
1 { 2 lib, 3 stdenv, 4 fetchfossil, 5 libGL, 6 libX11, 7 SDL, 8 ghostscript, 9 sqlite, 10 }: 11 12 stdenv.mkDerivation { 13 pname = "farbfeld-utils"; 14 version = "0-unstable-2022-12-16"; 15 16 src = fetchfossil { 17 url = "http://zzo38computer.org/fossil/farbfeld.ui"; 18 rev = "499eb1854cf8695353abc10621d7b0d66e8064f8"; 19 sha256 = "sha256-I1o94L2up9eByH38aCW756sSzPrPhnGFDeOOQmPu/cU="; 20 }; 21 22 postPatch = lib.optionalString stdenv.isDarwin '' 23 rm ff-vccapture.c ff-xcapture.c ff-xdraw.c ff-xwin.c 24 ''; 25 26 buildInputs = [ 27 libGL 28 SDL 29 ghostscript 30 sqlite 31 ] 32 ++ lib.optional stdenv.isLinux libX11; 33 34 buildPhase = '' 35 runHook preBuild 36 37 mkdir -p $out/bin 38 $CC -c lodepng.c 39 find . -name '*.c' -exec grep 'gcc' {} + -print0 | \ 40 awk -F: '{print $2}' | sed 's#~/bin#$out/bin#;s#gcc#$CC#;s#/usr/lib/libgs.so.9#-lgs#' | xargs -0 sh -c 41 42 runHook postBuild 43 ''; 44 45 dontInstall = true; 46 47 meta = { 48 description = "Collection of utilities for farbfeld picture format"; 49 homepage = "http://zzo38computer.org/fossil/farbfeld.ui/home"; 50 license = lib.licenses.publicDomain; 51 maintainers = [ lib.maintainers.sikmir ]; 52 platforms = lib.platforms.unix; 53 }; 54 }
