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