nur-packages

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

package.nix (1274B)


      1 {
      2   lib,
      3   stdenv,
      4   fetchFromGitHub,
      5   cmake,
      6   xorg,
      7   libglvnd,
      8 }:
      9 
     10 stdenv.mkDerivation (finalAttrs: {
     11   pname = "qoiview";
     12   version = "0-unstable-2024-05-10";
     13 
     14   __structuredAttrs = true;
     15 
     16   src = fetchFromGitHub {
     17     owner = "floooh";
     18     repo = "qoiview";
     19     rev = "7a371020708b71d414c85977ea233d721f91d937";
     20     hash = "sha256-V4NdhTzTGd62pNkKhk1vo1vZa/z24r+zKbojI0ziG/E=";
     21   };
     22 
     23   nativeBuildInputs = [ cmake ];
     24 
     25   NIX_CFLAGS_COMPILE = lib.optionals stdenv.isLinux (
     26     with xorg;
     27     [
     28       "-I${libX11.dev}/include"
     29       "-I${xorgproto}/include"
     30       "-I${libXi.dev}/include"
     31       "-I${libXext.dev}/include"
     32       "-I${libXfixes.dev}/include"
     33       "-I${libXcursor.dev}/include"
     34       "-I${libglvnd.dev}/include"
     35     ]
     36   );
     37 
     38   NIX_LDFLAGS = lib.optionals stdenv.isLinux (
     39     with xorg;
     40     [
     41       "-L${libX11}/lib"
     42       "-L${libXi}/lib"
     43       "-L${libXcursor}/lib"
     44       "-L${libglvnd}/lib"
     45     ]
     46   );
     47 
     48   installPhase = ''
     49     install -Dm755 qoiview -t $out/bin
     50   '';
     51 
     52   meta = {
     53     description = "QOI image viewer on top of the Sokol headers";
     54     homepage = "https://github.com/floooh/qoiview";
     55     license = lib.licenses.free;
     56     maintainers = [ lib.maintainers.sikmir ];
     57     platforms = lib.platforms.linux;
     58     skip.ci = stdenv.isDarwin;
     59   };
     60 })