nur-packages

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

package.nix (1421B)


      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   __structuredAttrs = true;
     18 
     19   src = fetchFromGitHub {
     20     owner = "bakkeby";
     21     repo = "farbfeld-utils";
     22     rev = "123fc1060d554a67f8c7f1ba9e9c60fe10a48730";
     23     hash = "sha256-oXTMnTsldf5IoKL6O4HtMmUAyJTy75PH0gBmO81a9Wo=";
     24   };
     25 
     26   postPatch = lib.optionalString stdenv.isDarwin ''
     27     rm ff-vccapture.c ff-xcapture.c ff-xdraw.c ff-xwin.c
     28   '';
     29 
     30   buildInputs = [
     31     libGL
     32     SDL
     33     ghostscript
     34     sqlite
     35   ]
     36   ++ lib.optionals stdenv.isLinux [
     37     libX11
     38     libxrender
     39   ];
     40 
     41   buildPhase = ''
     42     runHook preBuild
     43 
     44     mkdir -p $out/bin
     45     $CC -c lodepng.c
     46     find . -name '*.c' -exec grep 'gcc' {} + -print0 | \
     47       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
     48 
     49     runHook postBuild
     50   '';
     51 
     52   env.NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration -Wno-error=return-mismatch -Wno-error=implicit-int";
     53 
     54   installFlags = [ "PREFIX=$(out)" ];
     55 
     56   meta = {
     57     description = "Collection of utilities for farbfeld picture format";
     58     homepage = "http://zzo38computer.org/fossil/farbfeld.ui/home";
     59     license = lib.licenses.publicDomain;
     60     maintainers = [ lib.maintainers.sikmir ];
     61     platforms = lib.platforms.unix;
     62   };
     63 }