default.nix (1245B)
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 src = fetchFromGitHub { 15 owner = "floooh"; 16 repo = "qoiview"; 17 rev = "7a371020708b71d414c85977ea233d721f91d937"; 18 hash = "sha256-V4NdhTzTGd62pNkKhk1vo1vZa/z24r+zKbojI0ziG/E="; 19 }; 20 21 nativeBuildInputs = [ cmake ]; 22 23 NIX_CFLAGS_COMPILE = lib.optionals stdenv.isLinux ( 24 with xorg; 25 [ 26 "-I${libX11.dev}/include" 27 "-I${xorgproto}/include" 28 "-I${libXi.dev}/include" 29 "-I${libXext.dev}/include" 30 "-I${libXfixes.dev}/include" 31 "-I${libXcursor.dev}/include" 32 "-I${libglvnd.dev}/include" 33 ] 34 ); 35 36 NIX_LDFLAGS = lib.optionals stdenv.isLinux ( 37 with xorg; 38 [ 39 "-L${libX11}/lib" 40 "-L${libXi}/lib" 41 "-L${libXcursor}/lib" 42 "-L${libglvnd}/lib" 43 ] 44 ); 45 46 installPhase = '' 47 install -Dm755 qoiview -t $out/bin 48 ''; 49 50 meta = { 51 description = "QOI image viewer on top of the Sokol headers"; 52 homepage = "https://github.com/floooh/qoiview"; 53 license = lib.licenses.free; 54 maintainers = [ lib.maintainers.sikmir ]; 55 platforms = lib.platforms.linux; 56 skip.ci = stdenv.isDarwin; 57 }; 58 })