nur-packages

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

package.nix (1392B)


      1 {
      2   lib,
      3   stdenv,
      4   fetchFromGitHub,
      5   libGL,
      6   libX11,
      7   libxrender,
      8   SDL,
      9   ghostscript,
     10   sqlite,
     11 }:
     12 
     13 stdenv.mkDerivation {
     14   pname = "farbfeld-utils";
     15   version = "0-unstable-2025-10-12";
     16 
     17   src = fetchFromGitHub {
     18     owner = "bakkeby";
     19     repo = "farbfeld-utils";
     20     rev = "123fc1060d554a67f8c7f1ba9e9c60fe10a48730";
     21     hash = "sha256-oXTMnTsldf5IoKL6O4HtMmUAyJTy75PH0gBmO81a9Wo=";
     22   };
     23 
     24   postPatch = lib.optionalString stdenv.isDarwin ''
     25     rm ff-vccapture.c ff-xcapture.c ff-xdraw.c ff-xwin.c
     26   '';
     27 
     28   buildInputs = [
     29     libGL
     30     SDL
     31     ghostscript
     32     sqlite
     33   ]
     34   ++ lib.optionals stdenv.isLinux [
     35     libX11
     36     libxrender
     37   ];
     38 
     39   buildPhase = ''
     40     runHook preBuild
     41 
     42     mkdir -p $out/bin
     43     $CC -c lodepng.c
     44     find . -name '*.c' -exec grep 'gcc' {} + -print0 | \
     45       awk -F: '{print $2}' | sed 's#~/bin#$out/bin#;s#gcc#$CC#;s#/usr/lib/libgs.so#-lgs#;s#sqlite3.o#-lsqlite#' | xargs -0 sh -c
     46 
     47     runHook postBuild
     48   '';
     49 
     50   env.NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration -Wno-error=return-mismatch -Wno-error=implicit-int";
     51 
     52   installFlags = [ "PREFIX=$(out)" ];
     53 
     54   meta = {
     55     description = "Collection of utilities for farbfeld picture format";
     56     homepage = "http://zzo38computer.org/fossil/farbfeld.ui/home";
     57     license = lib.licenses.publicDomain;
     58     maintainers = [ lib.maintainers.sikmir ];
     59     platforms = lib.platforms.unix;
     60   };
     61 }