nur-packages

My NUR packages
git clone git://git.sikmir.ru/nur-packages
Log | Files | Refs | README | LICENSE

default.nix (1222B)


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