default.nix (1161B)
1 { lib, stdenv, fetchFromGitHub, cmake, xorg, libglvnd }: 2 3 stdenv.mkDerivation (finalAttrs: { 4 pname = "qoiview"; 5 version = "2021-12-22"; 6 7 src = fetchFromGitHub { 8 owner = "floooh"; 9 repo = "qoiview"; 10 rev = "ccc7ae1fa1b80716f243115d3855aba7a49aa6b8"; 11 hash = "sha256-8QIDEBlzUSKPdOhmzbSwhfgy/A2QceWeinIQQe3J7h4="; 12 }; 13 14 nativeBuildInputs = [ cmake ]; 15 16 NIX_CFLAGS_COMPILE = lib.optionals stdenv.isLinux (with xorg; [ 17 "-I${libX11.dev}/include" 18 "-I${xorgproto}/include" 19 "-I${libXi.dev}/include" 20 "-I${libXext.dev}/include" 21 "-I${libXfixes.dev}/include" 22 "-I${libXcursor.dev}/include" 23 "-I${libglvnd.dev}/include" 24 ]); 25 26 NIX_LDFLAGS = lib.optionals stdenv.isLinux (with xorg; [ 27 "-L${libX11}/lib" 28 "-L${libXi}/lib" 29 "-L${libXcursor}/lib" 30 "-L${libglvnd}/lib" 31 ]); 32 33 installPhase = '' 34 install -Dm755 qoiview -t $out/bin 35 ''; 36 37 meta = with lib; { 38 description = "QOI image viewer on top of the Sokol headers"; 39 inherit (finalAttrs.src.meta) homepage; 40 license = licenses.free; 41 maintainers = [ maintainers.sikmir ]; 42 platforms = platforms.linux; 43 skip.ci = stdenv.isDarwin; 44 }; 45 })