From c1eb4243f5b9648bfd3fa19c09103fad9590dde9 Mon Sep 17 00:00:00 2001 From: Grimmauld Date: Fri, 26 Sep 2025 12:34:06 +0200 Subject: [PATCH] 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; };