default.nix (1253B)
1 { 2 lib, 3 stdenv, 4 fetchfossil, 5 libGL, 6 libX11, 7 SDL, 8 ghostscript, 9 sqlite, 10 memstreamHook, 11 }: 12 13 stdenv.mkDerivation { 14 pname = "farbfeld-utils"; 15 version = "0-unstable-2022-12-16"; 16 17 src = fetchfossil { 18 url = "http://zzo38computer.org/fossil/farbfeld.ui"; 19 rev = "499eb1854cf8695353abc10621d7b0d66e8064f8"; 20 sha256 = "sha256-I1o94L2up9eByH38aCW756sSzPrPhnGFDeOOQmPu/cU="; 21 }; 22 23 postPatch = lib.optionalString stdenv.isDarwin '' 24 rm ff-vccapture.c ff-xcapture.c ff-xdraw.c ff-xwin.c 25 ''; 26 27 buildInputs = [ 28 libGL 29 SDL 30 ghostscript 31 sqlite 32 ] ++ lib.optional stdenv.isLinux libX11 ++ lib.optional stdenv.isDarwin memstreamHook; 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 }