From c55e8f9a0de2cbb2c7e99d091491351bc1f7ac2f Mon Sep 17 00:00:00 2001 From: Grimmauld Date: Fri, 26 Sep 2025 12:09:26 +0200 Subject: [PATCH 1/7] fltk: use replace-fail for substitute --- pkgs/development/libraries/fltk/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/fltk/default.nix b/pkgs/development/libraries/fltk/default.nix index 433c071a52d7..3181bb038ea8 100644 --- a/pkgs/development/libraries/fltk/default.nix +++ b/pkgs/development/libraries/fltk/default.nix @@ -185,7 +185,7 @@ stdenv.mkDerivation (finalAttrs: { postFixup = '' substituteInPlace $out/bin/fltk-config \ - --replace "/$out/" "/" + --replace-fail "/$out/" "/" ''; meta = { From c1eb4243f5b9648bfd3fa19c09103fad9590dde9 Mon Sep 17 00:00:00 2001 From: Grimmauld Date: Fri, 26 Sep 2025 12:34:06 +0200 Subject: [PATCH 2/7] fltk{,14}: clean up cmake flags --- pkgs/development/libraries/fltk/1.4.nix | 48 +++++++++--------- pkgs/development/libraries/fltk/default.nix | 54 ++++++++------------- pkgs/top-level/all-packages.nix | 1 - 3 files changed, 43 insertions(+), 60 deletions(-) diff --git a/pkgs/development/libraries/fltk/1.4.nix b/pkgs/development/libraries/fltk/1.4.nix index 2397e9ac24ad..35edd601aac3 100644 --- a/pkgs/development/libraries/fltk/1.4.nix +++ b/pkgs/development/libraries/fltk/1.4.nix @@ -35,9 +35,6 @@ withExamples ? (stdenv.buildPlatform == stdenv.hostPlatform), }: -let - onOff = value: if value then "ON" else "OFF"; -in stdenv.mkDerivation (finalAttrs: { pname = "fltk"; version = "1.4.4"; @@ -103,43 +100,42 @@ stdenv.mkDerivation (finalAttrs: { cmakeFlags = [ # Common - "-DFLTK_BUILD_SHARED_LIBS=${onOff (!stdenv.hostPlatform.isStatic)}" - "-DFLTK_USE_SYSTEM_LIBDECOR=ON" - "-DFLTK_USE_SYSTEM_LIBJPEG=ON" - "-DFLTK_USE_SYSTEM_LIBPNG=ON" - "-DFLTK_USE_SYSTEM_ZLIB=ON" + (lib.cmakeBool "FLTK_BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic)) + (lib.cmakeBool "FLTK_USE_SYSTEM_LIBDECOR" true) + (lib.cmakeBool "FLTK_USE_SYSTEM_LIBJPEG" true) + (lib.cmakeBool "FLTK_USE_SYSTEM_LIBPNG" true) + (lib.cmakeBool "FLTK_USE_SYSTEM_ZLIB" true) # X11 - "-DFLTK_USE_XINERAMA=${onOff stdenv.hostPlatform.isLinux}" - "-DFLTK_USE_XFIXES=${onOff stdenv.hostPlatform.isLinux}" - "-DFLTK_USE_XCURSOR=${onOff stdenv.hostPlatform.isLinux}" - "-DFLTK_USE_XFT=${onOff stdenv.hostPlatform.isLinux}" - "-DFLTK_USE_XRENDER=${onOff stdenv.hostPlatform.isLinux}" + (lib.cmakeBool "FLTK_USE_XINERAMA" stdenv.hostPlatform.isLinux) + (lib.cmakeBool "FLTK_USE_XFIXES" stdenv.hostPlatform.isLinux) + (lib.cmakeBool "FLTK_USE_XCURSOR" stdenv.hostPlatform.isLinux) + (lib.cmakeBool "FLTK_USE_XFT" stdenv.hostPlatform.isLinux) + (lib.cmakeBool "FLTK_USE_XRENDER" stdenv.hostPlatform.isLinux) # GL - "-DFLTK_BUILD_GL=${onOff withGL}" - "-DOpenGL_GL_PREFERENCE=GLVND" + (lib.cmakeBool "FLTK_BUILD_GL" withGL) # Cairo - "-DFLTK_OPTION_CAIRO_WINDOW=${onOff withCairo}" - "-DFLTK_OPTION_CAIRO_EXT=${onOff withCairo}" + (lib.cmakeBool "FLTK_OPTION_CAIRO_WINDOW" withCairo) + (lib.cmakeBool "FLTK_OPTION_CAIRO_EXT" withCairo) # Pango - "-DFLTK_USE_PANGO=${onOff withPango}" + (lib.cmakeBool "FLTK_USE_PANGO" withPango) # Examples & Tests - "-DFLTK_BUILD_EXAMPLES=${onOff withExamples}" - "-DFLTK_BUILD_TEST=${onOff withExamples}" + (lib.cmakeBool "FLTK_BUILD_EXAMPLES" withExamples) + (lib.cmakeBool "FLTK_BUILD_TEST" withExamples) # Docs - "-DFLTK_BUILD_HTML_DOCS=${onOff withDocs}" - "-DFLTK_BUILD_PDF_DOCS=OFF" - "-DFLTK_INSTALL_HTML_DOCS=${onOff withDocs}" - "-DFLTK_INSTALL_PDF_DOCS=OFF" - "-DFLTK_INCLUDE_DRIVER_DOCS=${onOff withDocs}" + (lib.cmakeBool "FLTK_BUILD_HTML_DOCS" withDocs) + (lib.cmakeBool "FLTK_INSTALL_HTML_DOCS" withDocs) + (lib.cmakeBool "FLTK_INCLUDE_DRIVER_DOCS" withDocs) + (lib.cmakeBool "FLTK_BUILD_PDF_DOCS" false) + (lib.cmakeBool "FLTK_INSTALL_PDF_DOCS" false) # RPATH of binary /nix/store/.../bin/... contains a forbidden reference to /build/ - "-DCMAKE_SKIP_BUILD_RPATH=ON" + (lib.cmakeBool "CMAKE_SKIP_BUILD_RPATH" true) ]; postBuild = lib.optionalString withDocs '' diff --git a/pkgs/development/libraries/fltk/default.nix b/pkgs/development/libraries/fltk/default.nix index 3181bb038ea8..9e4bf2d305cb 100644 --- a/pkgs/development/libraries/fltk/default.nix +++ b/pkgs/development/libraries/fltk/default.nix @@ -25,9 +25,6 @@ withCairo ? true, cairo, - withPango ? false, - pango, - withDocs ? true, doxygen, graphviz, @@ -36,9 +33,6 @@ withShared ? true, }: -let - onOff = value: if value then "ON" else "OFF"; -in stdenv.mkDerivation (finalAttrs: { pname = "fltk"; version = "1.3.8"; @@ -101,50 +95,44 @@ stdenv.mkDerivation (finalAttrs: { ] ++ lib.optionals withCairo [ cairo - ] - ++ lib.optionals withPango [ - pango ]; cmakeFlags = [ # Common - "-DOPTION_BUILD_SHARED_LIBS=${onOff withShared}" - "-DOPTION_USE_SYSTEM_ZLIB=ON" - "-DOPTION_USE_SYSTEM_LIBJPEG=ON" - "-DOPTION_USE_SYSTEM_LIBPNG=ON" + (lib.cmakeBool "OPTION_BUILD_SHARED_LIBS" withShared) + (lib.cmakeBool "OPTION_USE_SYSTEM_ZLIB" true) + (lib.cmakeBool "OPTION_USE_SYSTEM_LIBJPEG" true) + (lib.cmakeBool "OPTION_USE_SYSTEM_LIBPNG" true) # X11 - "-DOPTION_USE_XINERAMA=${onOff stdenv.hostPlatform.isLinux}" - "-DOPTION_USE_XFIXES=${onOff stdenv.hostPlatform.isLinux}" - "-DOPTION_USE_XCURSOR=${onOff stdenv.hostPlatform.isLinux}" - "-DOPTION_USE_XFT=${onOff stdenv.hostPlatform.isLinux}" - "-DOPTION_USE_XRENDER=${onOff stdenv.hostPlatform.isLinux}" - "-DOPTION_USE_XDBE=${onOff stdenv.hostPlatform.isLinux}" + (lib.cmakeBool "OPTION_USE_XINERAMA" stdenv.hostPlatform.isLinux) + (lib.cmakeBool "OPTION_USE_XFIXES" stdenv.hostPlatform.isLinux) + (lib.cmakeBool "OPTION_USE_XCURSOR" stdenv.hostPlatform.isLinux) + (lib.cmakeBool "OPTION_USE_XFT" stdenv.hostPlatform.isLinux) + (lib.cmakeBool "OPTION_USE_XRENDER" stdenv.hostPlatform.isLinux) + (lib.cmakeBool "OPTION_USE_XDBE" stdenv.hostPlatform.isLinux) # GL - "-DOPTION_USE_GL=${onOff withGL}" + (lib.cmakeBool "OPTION_USE_GL" withGL) "-DOpenGL_GL_PREFERENCE=GLVND" # Cairo - "-DOPTION_CAIRO=${onOff withCairo}" - "-DOPTION_CAIROEXT=${onOff withCairo}" - - # Pango - "-DOPTION_USE_PANGO=${onOff withPango}" + (lib.cmakeBool "OPTION_CAIRO" withCairo) + (lib.cmakeBool "OPTION_CAIROEXT" withCairo) # Examples & Tests - "-DFLTK_BUILD_EXAMPLES=${onOff withExamples}" - "-DFLTK_BUILD_TEST=${onOff withExamples}" + (lib.cmakeBool "FLTK_BUILD_EXAMPLES" withExamples) + (lib.cmakeBool "FLTK_BUILD_TEST" withExamples) # Docs - "-DOPTION_BUILD_HTML_DOCUMENTATION=${onOff withDocs}" - "-DOPTION_BUILD_PDF_DOCUMENTATION=OFF" - "-DOPTION_INSTALL_HTML_DOCUMENTATION=${onOff withDocs}" - "-DOPTION_INSTALL_PDF_DOCUMENTATION=OFF" - "-DOPTION_INCLUDE_DRIVER_DOCUMENTATION=${onOff withDocs}" + (lib.cmakeBool "OPTION_BUILD_HTML_DOCUMENTATION" withDocs) + (lib.cmakeBool "OPTION_INSTALL_HTML_DOCUMENTATION" withDocs) + (lib.cmakeBool "OPTION_INCLUDE_DRIVER_DOCUMENTATION" withDocs) + (lib.cmakeBool "OPTION_BUILD_PDF_DOCUMENTATION" false) + (lib.cmakeBool "OPTION_INSTALL_PDF_DOCUMENTATION" false) # RPATH of binary /nix/store/.../bin/... contains a forbidden reference to /build/ - "-DCMAKE_SKIP_BUILD_RPATH=ON" + (lib.cmakeBool "CMAKE_SKIP_BUILD_RPATH" true) ]; preBuild = lib.optionalString (withCairo && withShared && stdenv.hostPlatform.isDarwin) '' diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index cf92b29fefa1..2f6bff7bd5f2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7455,7 +7455,6 @@ with pkgs; fltk13-minimal = fltk13.override { withGL = false; withCairo = false; - withPango = false; withExamples = false; withDocs = false; }; From aba93a855d1e3046b3c4450fbe25767770d460c2 Mon Sep 17 00:00:00 2001 From: Grimmauld Date: Fri, 26 Sep 2025 12:37:48 +0200 Subject: [PATCH 3/7] fltk{,14}: expose xorg toggle --- pkgs/development/libraries/fltk/1.4.nix | 19 +++++++++++++------ pkgs/development/libraries/fltk/default.nix | 16 ++++++++++------ 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/pkgs/development/libraries/fltk/1.4.nix b/pkgs/development/libraries/fltk/1.4.nix index 35edd601aac3..8315d580a191 100644 --- a/pkgs/development/libraries/fltk/1.4.nix +++ b/pkgs/development/libraries/fltk/1.4.nix @@ -25,16 +25,21 @@ withCairo ? true, cairo, - withPango ? stdenv.hostPlatform.isLinux, + withPango ? withXorg, pango, withDocs ? true, doxygen, graphviz, + withXorg ? stdenv.hostPlatform.isLinux, + withExamples ? (stdenv.buildPlatform == stdenv.hostPlatform), }: +# pango support depends on Xft +assert withPango -> withXorg; + stdenv.mkDerivation (finalAttrs: { pname = "fltk"; version = "1.4.4"; @@ -83,6 +88,8 @@ stdenv.mkDerivation (finalAttrs: { ] ++ lib.optionals stdenv.hostPlatform.isLinux [ freetype + ] + ++ lib.optionals withXorg [ libX11 libXext libXinerama @@ -107,11 +114,11 @@ stdenv.mkDerivation (finalAttrs: { (lib.cmakeBool "FLTK_USE_SYSTEM_ZLIB" true) # X11 - (lib.cmakeBool "FLTK_USE_XINERAMA" stdenv.hostPlatform.isLinux) - (lib.cmakeBool "FLTK_USE_XFIXES" stdenv.hostPlatform.isLinux) - (lib.cmakeBool "FLTK_USE_XCURSOR" stdenv.hostPlatform.isLinux) - (lib.cmakeBool "FLTK_USE_XFT" stdenv.hostPlatform.isLinux) - (lib.cmakeBool "FLTK_USE_XRENDER" stdenv.hostPlatform.isLinux) + (lib.cmakeBool "FLTK_USE_XINERAMA" withXorg) + (lib.cmakeBool "FLTK_USE_XFIXES" withXorg) + (lib.cmakeBool "FLTK_USE_XCURSOR" withXorg) + (lib.cmakeBool "FLTK_USE_XFT" withXorg) + (lib.cmakeBool "FLTK_USE_XRENDER" withXorg) # GL (lib.cmakeBool "FLTK_BUILD_GL" withGL) diff --git a/pkgs/development/libraries/fltk/default.nix b/pkgs/development/libraries/fltk/default.nix index 9e4bf2d305cb..397ccb7cbeee 100644 --- a/pkgs/development/libraries/fltk/default.nix +++ b/pkgs/development/libraries/fltk/default.nix @@ -29,6 +29,8 @@ doxygen, graphviz, + withXorg ? stdenv.hostPlatform.isLinux, + withExamples ? (stdenv.buildPlatform == stdenv.hostPlatform), withShared ? true, }: @@ -85,6 +87,8 @@ stdenv.mkDerivation (finalAttrs: { ] ++ lib.optionals stdenv.hostPlatform.isLinux [ freetype + ] + ++ lib.optionals withXorg [ libX11 libXext libXinerama @@ -105,12 +109,12 @@ stdenv.mkDerivation (finalAttrs: { (lib.cmakeBool "OPTION_USE_SYSTEM_LIBPNG" true) # X11 - (lib.cmakeBool "OPTION_USE_XINERAMA" stdenv.hostPlatform.isLinux) - (lib.cmakeBool "OPTION_USE_XFIXES" stdenv.hostPlatform.isLinux) - (lib.cmakeBool "OPTION_USE_XCURSOR" stdenv.hostPlatform.isLinux) - (lib.cmakeBool "OPTION_USE_XFT" stdenv.hostPlatform.isLinux) - (lib.cmakeBool "OPTION_USE_XRENDER" stdenv.hostPlatform.isLinux) - (lib.cmakeBool "OPTION_USE_XDBE" stdenv.hostPlatform.isLinux) + (lib.cmakeBool "OPTION_USE_XINERAMA" withXorg) + (lib.cmakeBool "OPTION_USE_XFIXES" withXorg) + (lib.cmakeBool "OPTION_USE_XCURSOR" withXorg) + (lib.cmakeBool "OPTION_USE_XFT" withXorg) + (lib.cmakeBool "OPTION_USE_XRENDER" withXorg) + (lib.cmakeBool "OPTION_USE_XDBE" withXorg) # GL (lib.cmakeBool "OPTION_USE_GL" withGL) From 252bb01d91fbbc534aa6d7f382071746f16090ce Mon Sep 17 00:00:00 2001 From: Grimmauld Date: Fri, 26 Sep 2025 12:56:44 +0200 Subject: [PATCH 4/7] fltk14: add wayland support --- pkgs/development/libraries/fltk/1.4.nix | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/pkgs/development/libraries/fltk/1.4.nix b/pkgs/development/libraries/fltk/1.4.nix index 8315d580a191..a1662eeb665c 100644 --- a/pkgs/development/libraries/fltk/1.4.nix +++ b/pkgs/development/libraries/fltk/1.4.nix @@ -34,12 +34,21 @@ withXorg ? stdenv.hostPlatform.isLinux, + withWayland ? stdenv.hostPlatform.isLinux && withCairo, + wayland, + wayland-protocols, + libxkbcommon, + wayland-scanner, + withExamples ? (stdenv.buildPlatform == stdenv.hostPlatform), }: # pango support depends on Xft assert withPango -> withXorg; +# wayland support depends on cairo +assert withWayland -> withCairo; + stdenv.mkDerivation (finalAttrs: { pname = "fltk"; version = "1.4.4"; @@ -64,6 +73,9 @@ stdenv.mkDerivation (finalAttrs: { cmake pkg-config ] + ++ lib.optionals withWayland [ + wayland-scanner + ] ++ lib.optionals withDocs [ doxygen graphviz @@ -98,6 +110,11 @@ stdenv.mkDerivation (finalAttrs: { libXft libXrender ] + ++ lib.optionals withWayland [ + wayland + wayland-protocols + libxkbcommon + ] ++ lib.optionals withCairo [ cairo ] @@ -120,6 +137,9 @@ stdenv.mkDerivation (finalAttrs: { (lib.cmakeBool "FLTK_USE_XFT" withXorg) (lib.cmakeBool "FLTK_USE_XRENDER" withXorg) + # Wayland + (lib.cmakeBool "FLTK_BACKEND_WAYLAND" withWayland) + # GL (lib.cmakeBool "FLTK_BUILD_GL" withGL) From d1fb29386a716e6ed8cf828dbca3914d8caedf9f Mon Sep 17 00:00:00 2001 From: Grimmauld Date: Fri, 26 Sep 2025 13:41:14 +0200 Subject: [PATCH 5/7] fltk{,14}: add update script --- pkgs/development/libraries/fltk/1.4.nix | 9 +++++++++ pkgs/development/libraries/fltk/default.nix | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/pkgs/development/libraries/fltk/1.4.nix b/pkgs/development/libraries/fltk/1.4.nix index a1662eeb665c..a83ef702d631 100644 --- a/pkgs/development/libraries/fltk/1.4.nix +++ b/pkgs/development/libraries/fltk/1.4.nix @@ -41,6 +41,8 @@ wayland-scanner, withExamples ? (stdenv.buildPlatform == stdenv.hostPlatform), + + nix-update-script, }: # pango support depends on Xft @@ -197,6 +199,13 @@ stdenv.mkDerivation (finalAttrs: { --replace-fail "/$out/" "/" ''; + passthru.updateScript = nix-update-script { + extraArgs = [ + "--version-regex" + "release-(1\\.4\\.[0-9.]+)" + ]; + }; + meta = { description = "C++ cross-platform lightweight GUI library"; homepage = "https://www.fltk.org"; diff --git a/pkgs/development/libraries/fltk/default.nix b/pkgs/development/libraries/fltk/default.nix index 397ccb7cbeee..548646f3386d 100644 --- a/pkgs/development/libraries/fltk/default.nix +++ b/pkgs/development/libraries/fltk/default.nix @@ -33,6 +33,8 @@ withExamples ? (stdenv.buildPlatform == stdenv.hostPlatform), withShared ? true, + + nix-update-script, }: stdenv.mkDerivation (finalAttrs: { @@ -180,6 +182,13 @@ stdenv.mkDerivation (finalAttrs: { --replace-fail "/$out/" "/" ''; + passthru.updateScript = nix-update-script { + extraArgs = [ + "--version-regex" + "release-(1\\.3\\.[0-9.]+)" + ]; + }; + meta = { description = "C++ cross-platform lightweight GUI library"; homepage = "https://www.fltk.org"; From 29b522ae1ef9ae8c91f12153c1b70d7ff1751ed0 Mon Sep 17 00:00:00 2001 From: Grimmauld Date: Fri, 26 Sep 2025 13:46:08 +0200 Subject: [PATCH 6/7] fltk: 1.3.8 -> 1.3.11 Release notes: https://github.com/fltk/fltk/releases/tag/release-1.3.11 Fixes build with cmake 4 --- pkgs/development/libraries/fltk/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/fltk/default.nix b/pkgs/development/libraries/fltk/default.nix index 548646f3386d..2b2242107d8a 100644 --- a/pkgs/development/libraries/fltk/default.nix +++ b/pkgs/development/libraries/fltk/default.nix @@ -39,13 +39,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "fltk"; - version = "1.3.8"; + version = "1.3.11"; src = fetchFromGitHub { owner = "fltk"; repo = "fltk"; rev = "release-${finalAttrs.version}"; - hash = "sha256-OQWyOV3EeyFhwFg/eOX66QtFUxaDR1x4ZyHnZHmzhN8="; + hash = "sha256-aN0WdHDjxb9O4OgTfBncIj12tRYfeltKev6pgSMu6/E="; }; outputs = [ "out" ] ++ lib.optional withExamples "bin" ++ lib.optional withDocs "doc"; From 47a5a7e05da4b5def40fc6f9b27f61a4bfb18f83 Mon Sep 17 00:00:00 2001 From: Grimmauld Date: Fri, 26 Sep 2025 17:18:20 +0200 Subject: [PATCH 7/7] fltk14: disable pango if cairo is disabled --- pkgs/development/libraries/fltk/1.4.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/fltk/1.4.nix b/pkgs/development/libraries/fltk/1.4.nix index a83ef702d631..ff8f8734926b 100644 --- a/pkgs/development/libraries/fltk/1.4.nix +++ b/pkgs/development/libraries/fltk/1.4.nix @@ -25,7 +25,9 @@ withCairo ? true, cairo, - withPango ? withXorg, + # pango depends on Xft, and implicitly enables cairo. + # So only enable pango if cairo is enabled too. + withPango ? withXorg && withCairo, pango, withDocs ? true,