From c56727f63a4aa0cb362a8eb51aa4c651987a7883 Mon Sep 17 00:00:00 2001 From: Marcin Serwin Date: Sat, 3 Jan 2026 11:07:00 +0100 Subject: [PATCH 1/5] qoi: use default Makefile instead of custom buildPhase Signed-off-by: Marcin Serwin --- pkgs/by-name/qo/qoi/package.nix | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkgs/by-name/qo/qoi/package.nix b/pkgs/by-name/qo/qoi/package.nix index a95fd712eb1d..8d28b7406898 100644 --- a/pkgs/by-name/qo/qoi/package.nix +++ b/pkgs/by-name/qo/qoi/package.nix @@ -1,6 +1,7 @@ { fetchFromGitHub, lib, + libpng, stb, stdenv, }: @@ -21,15 +22,10 @@ stdenv.mkDerivation (finalAttrs: { "dev" ]; - nativeBuildInputs = [ stb ]; + strictDeps = true; + enableParalleBuilding = true; - buildPhase = '' - runHook preBuild - - make CFLAGS_CONV="-I${stb}/include/stb -O3" qoiconv - - runHook postBuild - ''; + buildInputs = [ libpng ]; installPhase = '' runHook preInstall @@ -45,6 +41,10 @@ stdenv.mkDerivation (finalAttrs: { runHook postInstall ''; + makeFlags = [ + "CFLAGS=-I${lib.getDev stb}/include/stb" + ]; + meta = { description = "'Quite OK Image Format' for fast, lossless image compression"; mainProgram = "qoiconv"; From 34d2011c68d6bae71188873943f3ecc758410b9b Mon Sep 17 00:00:00 2001 From: Marcin Serwin Date: Sat, 3 Jan 2026 12:28:45 +0100 Subject: [PATCH 2/5] qoi: add patch with installation target Signed-off-by: Marcin Serwin --- .../add-install-target-and-pc-module.patch | 65 +++++++++++++++++++ pkgs/by-name/qo/qoi/package.nix | 22 +++---- 2 files changed, 74 insertions(+), 13 deletions(-) create mode 100644 pkgs/by-name/qo/qoi/add-install-target-and-pc-module.patch diff --git a/pkgs/by-name/qo/qoi/add-install-target-and-pc-module.patch b/pkgs/by-name/qo/qoi/add-install-target-and-pc-module.patch new file mode 100644 index 000000000000..f910080d3074 --- /dev/null +++ b/pkgs/by-name/qo/qoi/add-install-target-and-pc-module.patch @@ -0,0 +1,65 @@ +diff --git a/.gitignore b/.gitignore +index 9234e61..f137e88 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -3,3 +3,4 @@ stb_image.h + stb_image_write.h + qoibench + qoiconv ++qoi.pc +diff --git a/Makefile b/Makefile +index fb4b4d8..4660180 100644 +--- a/Makefile ++++ b/Makefile +@@ -7,6 +7,11 @@ LFLAGS_CONV ?= $(LDFLAGS) + TARGET_BENCH ?= qoibench + TARGET_CONV ?= qoiconv + ++PREFIX ?= /usr/local ++BINDIR ?= $(PREFIX)/bin ++INCLUDEDIR ?= $(PREFIX)/include ++LIBDIR ?= $(PREFIX)/lib ++ + all: $(TARGET_BENCH) $(TARGET_CONV) + + bench: $(TARGET_BENCH) +@@ -17,6 +22,24 @@ conv: $(TARGET_CONV) + $(TARGET_CONV):$(TARGET_CONV).c qoi.h + $(CC) $(CFLAGS_CONV) $(CFLAGS) $(TARGET_CONV).c -o $(TARGET_CONV) $(LFLAGS_CONV) + ++qoi.pc: qoi.pc.in ++ sed < qoi.pc.in > qoi.pc \ ++ -e 's|@PREFIX@|$(PREFIX)|g' \ ++ -e 's|@INCLUDEDIR@|$(INCLUDEDIR:$(PREFIX)%=$${prefix}%)|g' ++ ++.PHONY: install ++install: install-tools install-header ++ ++.PHONY: install-tools ++install-tools: all ++ install -Dm 755 $(TARGET_CONV) $(DESTDIR)$(BINDIR)/$(TARGET_CONV) ++ install -Dm 755 $(TARGET_BENCH) $(DESTDIR)$(BINDIR)/$(TARGET_BENCH) ++ ++.PHONY: install-header ++install-header: qoi.h qoi.pc ++ install -Dm 644 qoi.h $(DESTDIR)$(INCLUDEDIR)/qoi.h ++ install -Dm 644 qoi.pc $(DESTDIR)$(LIBDIR)/pkgconfig/qoi.pc ++ + .PHONY: clean + clean: + $(RM) $(TARGET_BENCH) $(TARGET_CONV) +diff --git a/qoi.pc.in b/qoi.pc.in +new file mode 100755 +index 0000000..dd83a36 +--- /dev/null ++++ b/qoi.pc.in +@@ -0,0 +1,9 @@ ++prefix=@PREFIX@ ++includedir=@INCLUDEDIR@ ++ ++Name: qoi ++Description: The "Quite OK Image Format" for fast, lossless image compression ++Version: 0 ++URL: https://qoiformat.org/ ++License: MIT ++Cflags: -I${includedir} diff --git a/pkgs/by-name/qo/qoi/package.nix b/pkgs/by-name/qo/qoi/package.nix index 8d28b7406898..e74596ae7a7d 100644 --- a/pkgs/by-name/qo/qoi/package.nix +++ b/pkgs/by-name/qo/qoi/package.nix @@ -17,6 +17,11 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-E1hMtjMuDS2zma2s5hlHby/sroRGhtyZm9gLQ+VztsM="; }; + patches = [ + # https://github.com/phoboslab/qoi/pull/322 + ./add-install-target-and-pc-module.patch + ]; + outputs = [ "out" "dev" @@ -27,22 +32,13 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ libpng ]; - 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 - ''; + # Don't bloat the header-only output with binaries + propagatedBuildOutputs = [ ]; makeFlags = [ "CFLAGS=-I${lib.getDev stb}/include/stb" + "PREFIX=${placeholder "dev"}" + "BINDIR=${placeholder "out"}/bin" ]; meta = { From 96d7992c29b4df9226c988d59d107659527fab8b Mon Sep 17 00:00:00 2001 From: Marcin Serwin Date: Sat, 3 Jan 2026 12:28:47 +0100 Subject: [PATCH 3/5] qoi: add test for pkg-config module Signed-off-by: Marcin Serwin --- pkgs/by-name/qo/qoi/package.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/by-name/qo/qoi/package.nix b/pkgs/by-name/qo/qoi/package.nix index e74596ae7a7d..9a8453a4d6d3 100644 --- a/pkgs/by-name/qo/qoi/package.nix +++ b/pkgs/by-name/qo/qoi/package.nix @@ -4,6 +4,7 @@ libpng, stb, stdenv, + testers, }: stdenv.mkDerivation (finalAttrs: { @@ -41,6 +42,10 @@ stdenv.mkDerivation (finalAttrs: { "BINDIR=${placeholder "out"}/bin" ]; + passthru = { + tests.pkg-config = testers.hasPkgConfigModules { package = finalAttrs.finalPackage; }; + }; + meta = { description = "'Quite OK Image Format' for fast, lossless image compression"; mainProgram = "qoiconv"; @@ -48,5 +53,6 @@ stdenv.mkDerivation (finalAttrs: { license = lib.licenses.mit; maintainers = with lib.maintainers; [ hzeller ]; platforms = lib.platforms.all; + pkgConfigModules = [ "qoi" ]; }; }) From cb5ef83e1f96e1987b47eb5e0a93e1c0c9bf9a28 Mon Sep 17 00:00:00 2001 From: Marcin Serwin Date: Sat, 3 Jan 2026 12:28:51 +0100 Subject: [PATCH 4/5] qoi: add update script Signed-off-by: Marcin Serwin --- pkgs/by-name/qo/qoi/package.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/by-name/qo/qoi/package.nix b/pkgs/by-name/qo/qoi/package.nix index 9a8453a4d6d3..95192bdd450b 100644 --- a/pkgs/by-name/qo/qoi/package.nix +++ b/pkgs/by-name/qo/qoi/package.nix @@ -2,6 +2,7 @@ fetchFromGitHub, lib, libpng, + nix-update-script, stb, stdenv, testers, @@ -44,6 +45,7 @@ stdenv.mkDerivation (finalAttrs: { passthru = { tests.pkg-config = testers.hasPkgConfigModules { package = finalAttrs.finalPackage; }; + updateScript = nix-update-script { extraArgs = [ "--version=branch" ]; }; }; meta = { From 4e6ae7a1ab102021c889bd5ccd500075a948f7dd Mon Sep 17 00:00:00 2001 From: Marcin Serwin Date: Sat, 3 Jan 2026 12:32:04 +0100 Subject: [PATCH 5/5] qoi: 0-unstable-2023-08-10 -> 0-unstable-2025-11-13 Signed-off-by: Marcin Serwin --- pkgs/by-name/qo/qoi/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/qo/qoi/package.nix b/pkgs/by-name/qo/qoi/package.nix index 95192bdd450b..e3fb2e90107f 100644 --- a/pkgs/by-name/qo/qoi/package.nix +++ b/pkgs/by-name/qo/qoi/package.nix @@ -10,13 +10,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "qoi"; - version = "0-unstable-2023-08-10"; # no upstream version yet. + version = "0-unstable-2025-11-13"; # no upstream version yet. src = fetchFromGitHub { owner = "phoboslab"; repo = "qoi"; - rev = "19b3b4087b66963a3699ee45f05ec9ef205d7c0e"; - hash = "sha256-E1hMtjMuDS2zma2s5hlHby/sroRGhtyZm9gLQ+VztsM="; + rev = "44b233a95eda82fbd2e39a269199b73af0f4c4c3"; + hash = "sha256-W5JG9Nz4NI2KZmUEtxEiGH7oxfAzEIaUyXTbSB25hZw="; }; patches = [