Files
nixpkgs/pkgs/by-name/qo/qoi/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

57 lines
1.2 KiB
Nix

{
fetchFromGitHub,
lib,
stb,
stdenv,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "qoi";
version = "0-unstable-2023-08-10"; # no upstream version yet.
src = fetchFromGitHub {
owner = "phoboslab";
repo = "qoi";
rev = "19b3b4087b66963a3699ee45f05ec9ef205d7c0e";
hash = "sha256-E1hMtjMuDS2zma2s5hlHby/sroRGhtyZm9gLQ+VztsM=";
};
outputs = [
"out"
"dev"
];
nativeBuildInputs = [ stb ];
buildPhase = ''
runHook preBuild
make CFLAGS_CONV="-I${stb}/include/stb -O3" qoiconv
runHook postBuild
'';
installPhase = ''
runHook preInstall
# Conversion utility for images->qoi. Not usually needed for development.
mkdir -p ${placeholder "out"}/bin
install qoiconv ${placeholder "out"}/bin
# The actual single-header implementation. Nothing to compile, just install.
mkdir -p ${placeholder "dev"}/include/
install qoi.h ${placeholder "dev"}/include
runHook postInstall
'';
meta = with lib; {
description = "'Quite OK Image Format' for fast, lossless image compression";
mainProgram = "qoiconv";
homepage = "https://qoiformat.org/";
license = licenses.mit;
maintainers = with maintainers; [ hzeller ];
platforms = platforms.all;
};
})