From 355bda7c1023ad27bbefdfb91c4838043881f461 Mon Sep 17 00:00:00 2001 From: whoomee Date: Tue, 14 Apr 2026 15:10:08 +0200 Subject: [PATCH] geogram: 1.9.2 -> 1.9.9 --- .../ge/geogram/cmake-fix-link-libraries.patch | 17 ++++ pkgs/by-name/ge/geogram/package.nix | 95 +++++-------------- .../ge/geogram/replace-bundled-zlib.patch | 23 +---- 3 files changed, 47 insertions(+), 88 deletions(-) create mode 100644 pkgs/by-name/ge/geogram/cmake-fix-link-libraries.patch diff --git a/pkgs/by-name/ge/geogram/cmake-fix-link-libraries.patch b/pkgs/by-name/ge/geogram/cmake-fix-link-libraries.patch new file mode 100644 index 000000000000..5463ba4c1562 --- /dev/null +++ b/pkgs/by-name/ge/geogram/cmake-fix-link-libraries.patch @@ -0,0 +1,17 @@ +--- a/src/lib/geogram/CMakeLists.txt 1970-01-01 01:00:01.000000000 +0100 ++++ b/src/lib/geogram/CMakeLists.txt 2026-03-03 10:21:32.918057952 +0100 +@@ -92,7 +92,13 @@ + if(GEOGRAM_USE_BUILTIN_DEPS) + target_link_libraries(geogram pthread dl) + else() +- target_link_libraries(geogram pthread dl lua5.4 z triangle Meshb.7 rply) ++ target_link_libraries(geogram pthread dl z Meshb.7 rply) ++ if(GEOGRAM_WITH_LUA) ++ target_link_libraries(geogram lua5.4) ++ endif() ++ if(GEOGRAM_WITH_TRIANGLE) ++ target_link_libraries(geogram triangle) ++ endif() + endif() + endif() + endif() diff --git a/pkgs/by-name/ge/geogram/package.nix b/pkgs/by-name/ge/geogram/package.nix index de6a8d83e6fe..87f89e888151 100644 --- a/pkgs/by-name/ge/geogram/package.nix +++ b/pkgs/by-name/ge/geogram/package.nix @@ -5,64 +5,58 @@ cmake, doxygen, zlib, - python3Packages, nix-update-script, - fetchpatch2, + stb, + libmeshb, + rply, }: - -let - exploragram = fetchFromGitHub { - owner = "BrunoLevy"; - repo = "exploragram"; - rev = "3190f685653f8aa75b7c4604d008c59a999f1bb6"; - hash = "sha256-9ePCOyQWSxu12PtHFSxfoDcvTtxvYR3T68sU3cAfZiE="; - }; - testdata = fetchFromGitHub { - owner = "BrunoLevy"; - repo = "geogram.data"; - rev = "ceab6179189d23713b902b6f26ea2ff36aea1515"; - hash = "sha256-zUmYI6+0IdDkglLzzWHS8ZKmc5O6aJ2X4IwRBouRIxI="; - }; -in stdenv.mkDerivation (finalAttrs: { pname = "geogram"; - version = "1.9.2"; + version = "1.9.9"; src = fetchFromGitHub { owner = "BrunoLevy"; repo = "geogram"; tag = "v${finalAttrs.version}"; - hash = "sha256-v7ChuE9F/z1MD5OUMiGXZWiGqjMauIka4sNXVDe/yYU="; + hash = "sha256-wAq6j/HUOv6In49lJVRZ2iS6ugbtYOxHN3PwTE1HZks="; fetchSubmodules = true; }; outputs = [ - "bin" "lib" "dev" "doc" "out" ]; + strictDeps = true; + __structuredAttrs = true; + cmakeFlags = [ # Triangle is unfree - "-DGEOGRAM_WITH_TRIANGLE=OFF" + (lib.cmakeBool "GEOGRAM_WITH_TRIANGLE" false) # Disable some extra features (feel free to create a PR if you need one of those) # If GEOGRAM_WITH_LEGACY_NUMERICS is enabled GeoGram will build its own version of # ARPACK, CBLAS, CLAPACK, LIBF2C and SUPERLU - "-DGEOGRAM_WITH_LEGACY_NUMERICS=OFF" + (lib.cmakeBool "GEOGRAM_WITH_LEGACY_NUMERICS" false) # Don't build Lua - "-DGEOGRAM_WITH_LUA=OFF" + (lib.cmakeBool "GEOGRAM_WITH_LUA" false) # Disable certain features requiring GLFW - "-DGEOGRAM_WITH_GRAPHICS=OFF" + (lib.cmakeBool "GEOGRAM_WITH_GRAPHICS" false) + + # Enables a packaging mode in some places + (lib.cmakeBool "GEOGRAM_FOR_DEBIAN" true) + + # Only build the library itself + (lib.cmakeBool "GEOGRAM_LIB_ONLY" true) # NOTE: Options introduced by patch (see below) - "-DGEOGRAM_INSTALL_CMAKE_DIR=${placeholder "dev"}/lib/cmake" - "-DGEOGRAM_INSTALL_PKGCONFIG_DIR=${placeholder "dev"}/lib/pkgconfig" + (lib.cmakeOptionType "path" "GEOGRAM_INSTALL_CMAKE_DIR" "${placeholder "dev"}/lib/cmake") + (lib.cmakeOptionType "path" "GEOGRAM_INSTALL_PKGCONFIG_DIR" "${placeholder "dev"}/lib/pkgconfig") ]; nativeBuildInputs = [ @@ -72,64 +66,25 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ zlib + stb + libmeshb + rply ]; - # exploragram library is not listed as submodule and must be copied manually - prePatch = '' - cp -r ${exploragram} ./src/lib/exploragram/ && chmod 755 ./src/lib/exploragram/ - ''; - patches = [ # This patch replaces the bundled (outdated) zlib with our zlib # Should be harmless, but if there are issues this patch can also be removed # Also check https://github.com/BrunoLevy/geogram/issues/49 for progress ./replace-bundled-zlib.patch - # fixes https://github.com/BrunoLevy/geogram/issues/203, remove when 1.9.3 is released - (fetchpatch2 { - url = "https://github.com/BrunoLevy/geogram/commit/2e1b6fba499ddc55b2150a1f610cf9f8d4934c39.patch"; - hash = "sha256-t6Pocf3VT8HpKOSh1UKKa0QHpsZyFqlAng6ltiAfKA8="; - }) + ./cmake-fix-link-libraries.patch ]; - postPatch = lib.optionalString stdenv.hostPlatform.isAarch64 '' - substituteInPlace cmake/platforms/*/config.cmake \ - --replace "-m64" "" - ''; - postBuild = '' make doc-devkit-full ''; - nativeCheckInputs = [ - python3Packages.robotframework - ]; - - doCheck = true; - - checkPhase = - let - skippedTests = [ - # Skip slow RVD test - "RVD" - - # Needs unfree library geogramplus with extended precision - # see https://github.com/BrunoLevy/geogram/wiki/GeogramPlus - "CSGplus" - ]; - in - '' - runHook preCheck - - ln -s ${testdata} ../tests/data - - source tests/testenv.sh - robot \ - ${lib.concatMapStringsSep " " (t: lib.escapeShellArg "--skip=${t}") skippedTests} \ - ../tests - - runHook postCheck - ''; + doCheck = false; passthru.updateScript = nix-update-script { }; diff --git a/pkgs/by-name/ge/geogram/replace-bundled-zlib.patch b/pkgs/by-name/ge/geogram/replace-bundled-zlib.patch index 3d19d66b0d2b..afb4b2bd1285 100644 --- a/pkgs/by-name/ge/geogram/replace-bundled-zlib.patch +++ b/pkgs/by-name/ge/geogram/replace-bundled-zlib.patch @@ -1,6 +1,6 @@ --- a/src/lib/geogram/third_party/CMakeLists.txt 1970-01-01 01:00:01.000000000 +0100 +++ b/src/lib/geogram/third_party/CMakeLists.txt 2023-03-09 20:46:16.740801862 +0100 -@@ -33,7 +33,6 @@ +@@ -62,7 +62,6 @@ aux_source_directories(SOURCES "Source Files\\LM6" LM7) aux_source_directories(SOURCES "Source Files\\rply" rply) aux_source_directories(SOURCES "Source Files\\shewchuk" shewchuk) @@ -10,7 +10,7 @@ --- a/src/lib/geogram/CMakeLists.txt 1970-01-01 01:00:01.000000000 +0100 +++ b/src/lib/geogram/CMakeLists.txt 2023-03-09 20:49:21.080059939 +0100 -@@ -70,6 +70,9 @@ +@@ -109,6 +109,9 @@ target_link_libraries(geogram psapi) endif() @@ -20,24 +20,11 @@ # Install the library install_devkit_targets(geogram) ---- a/src/lib/geogram/basic/geofile.h 1970-01-01 01:00:01.000000000 +0100 -+++ b/src/lib/geogram/basic/geofile.h 2023-03-09 20:52:33.713329571 +0100 -@@ -44,7 +44,7 @@ - #include - #include - #include --#include -+#include - - #include - #include --- a/src/lib/geogram/third_party/CMakeLists.txt 1970-01-01 01:00:01.000000000 +0100 -+++ b/src/lib/geogram/third_party/CMakeLists.txt 2023-03-09 20:54:50.276520762 +0100 -@@ -60,8 +59,10 @@ - ${ANDROID_NDK}/sources/android/native_app_glue - ) ++++ b/src/lib/geogram/third_party/CMakeLists.txt 2026-03-03 09:48:09.800627417 +0100 +@@ -92,6 +92,8 @@ message(STATUS "building for Android") - endif() + endif() +find_package(ZLIB REQUIRED) +target_link_libraries(geogram_third_party PUBLIC ZLIB::ZLIB)