From 5ea2b5dcf7335bb7194b92810511e222b0123186 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Thu, 4 Jun 2026 01:18:53 +0200 Subject: [PATCH 1/2] libultrahdr: Restrict meta.platforms Upstream only allows specific target OS' and architectures. Adjust meta.platforms to reflect what upstream allows, to allow reverse deps to use lib.meta.availableOn for deciding if they should depend on this. --- pkgs/by-name/li/libultrahdr/package.nix | 28 ++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/li/libultrahdr/package.nix b/pkgs/by-name/li/libultrahdr/package.nix index 2416feb1a6ae..c3ef856b8fbf 100644 --- a/pkgs/by-name/li/libultrahdr/package.nix +++ b/pkgs/by-name/li/libultrahdr/package.nix @@ -102,7 +102,33 @@ stdenv.mkDerivation (finalAttrs: { maintainers = with lib.maintainers; [ yzx9 ]; - platforms = lib.platforms.all; + # CMake script rejects non-approved platform targets + # https://github.com/google/libultrahdr/pull/383 would get rid of that + platforms = + let + # Values from the "Detect system" section in /CMakeLists.txt + # https://github.com/google/libultrahdr/blob/d52a0d13814ca399fc8a07e23de1d2c63f0e8404/CMakeLists.txt#L34 + oss = [ + "linux" + "windows" + "darwin" + ]; + archs = [ + "i686" + "x86_64" + "aarch64" + "armv7l" + "riscv64" + "riscv32" + "loongarch64" + ]; + in + lib.lists.intersectLists lib.platforms.all ( + lib.lists.crossLists (arch: os: "${arch}-${os}") [ + archs + oss + ] + ); license = with lib.licenses; [ asl20 ]; From a2639f9fef3e31711093763ee556263b9364788d Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Thu, 4 Jun 2026 01:21:57 +0200 Subject: [PATCH 2/2] imagemagick: Enable libultrahdr only when it's available --- pkgs/by-name/im/imagemagick/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/im/imagemagick/package.nix b/pkgs/by-name/im/imagemagick/package.nix index bbf070eaac05..225c2b999cf8 100644 --- a/pkgs/by-name/im/imagemagick/package.nix +++ b/pkgs/by-name/im/imagemagick/package.nix @@ -41,7 +41,7 @@ pango, libtiffSupport ? true, libtiff, - libultrahdrSupport ? true, + libultrahdrSupport ? lib.meta.availableOn stdenv.hostPlatform libultrahdr, libultrahdr, libxml2Support ? true, libxml2,