about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/geogram
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-06-16 06:56:35 +0000
committerAlyssa Ross <hi@alyssa.is>2023-06-16 06:56:35 +0000
commit99fcaeccb89621dd492203ce1f2d551c06f228ed (patch)
tree41cb730ae07383004789779b0f6e11cb3f4642a3 /nixpkgs/pkgs/development/libraries/geogram
parent59c5f5ac8682acc13bb22bc29c7cf02f7d75f01f (diff)
parent75a5ebf473cd60148ba9aec0d219f72e5cf52519 (diff)
downloadnixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.gz
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.bz2
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.lz
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.xz
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.zst
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.zip
Merge branch 'nixos-unstable' of https://github.com/NixOS/nixpkgs
Conflicts:
	nixpkgs/nixos/modules/config/console.nix
	nixpkgs/nixos/modules/services/mail/mailman.nix
	nixpkgs/nixos/modules/services/mail/public-inbox.nix
	nixpkgs/nixos/modules/services/mail/rss2email.nix
	nixpkgs/nixos/modules/services/networking/ssh/sshd.nix
	nixpkgs/pkgs/applications/networking/instant-messengers/dino/default.nix
	nixpkgs/pkgs/applications/networking/irc/weechat/default.nix
	nixpkgs/pkgs/applications/window-managers/sway/default.nix
	nixpkgs/pkgs/build-support/go/module.nix
	nixpkgs/pkgs/build-support/rust/build-rust-package/default.nix
	nixpkgs/pkgs/development/interpreters/python/default.nix
	nixpkgs/pkgs/development/node-packages/overrides.nix
	nixpkgs/pkgs/development/tools/b4/default.nix
	nixpkgs/pkgs/servers/dict/dictd-db.nix
	nixpkgs/pkgs/servers/mail/public-inbox/default.nix
	nixpkgs/pkgs/tools/security/pinentry/default.nix
	nixpkgs/pkgs/tools/text/unoconv/default.nix
	nixpkgs/pkgs/top-level/all-packages.nix
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/geogram')
-rw-r--r--nixpkgs/pkgs/development/libraries/geogram/default.nix128
-rw-r--r--nixpkgs/pkgs/development/libraries/geogram/fix-cmake-install-destination.patch92
-rw-r--r--nixpkgs/pkgs/development/libraries/geogram/replace-bundled-zlib.patch46
3 files changed, 266 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/geogram/default.nix b/nixpkgs/pkgs/development/libraries/geogram/default.nix
new file mode 100644
index 000000000000..1079f89d9328
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/geogram/default.nix
@@ -0,0 +1,128 @@
+{ lib
+, stdenv
+, fetchurl
+, fetchFromGitHub
+
+, cmake
+, doxygen
+, zlib
+, python3Packages
+}:
+
+let
+  testdata = fetchFromGitHub {
+    owner = "BrunoLevy";
+    repo = "geogram.data";
+    rev = "8fd071a560bd6859508f1710981386d0b2ba01b1";
+    hash = "sha256-jMUGX6/uYIZMVwXxTAAGUaOXqF+NrFQqgmIPCD58cwM=";
+  };
+in
+stdenv.mkDerivation rec {
+  pname = "geogram";
+  version = "1.8.3";
+
+  src = fetchurl {
+    url = "https://github.com/BrunoLevy/geogram/releases/download/v${version}/geogram_${version}.tar.gz";
+    hash = "sha256-91q0M/4kAr0UoWXOQIEYS1VbgEQ/F4EBOfJE9Vr1bnw=";
+  };
+
+  outputs = [ "bin" "lib" "dev" "doc" "out" ];
+
+  cmakeFlags = [
+    # Triangle is unfree
+    "-DGEOGRAM_WITH_TRIANGLE=OFF"
+
+    # 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"
+
+    # Don't build Lua
+    "-DGEOGRAM_WITH_LUA=OFF"
+
+    # Disable certain features requiring GLFW
+    "-DGEOGRAM_WITH_GRAPHICS=OFF"
+
+    # NOTE: Options introduced by patch (see below)
+    "-DGEOGRAM_INSTALL_CMAKE_DIR=${placeholder "dev"}/lib/cmake"
+    "-DGEOGRAM_INSTALL_PKGCONFIG_DIR=${placeholder "dev"}/lib/pkgconfig"
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    doxygen
+  ];
+
+  buildInputs = [
+    zlib
+  ];
+
+  patches = [
+    # See https://github.com/BrunoLevy/geogram/pull/76
+    ./fix-cmake-install-destination.patch
+
+    # 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
+  ];
+
+  postPatch = lib.optionalString stdenv.isAarch64 ''
+    substituteInPlace cmake/platforms/*/config.cmake \
+      --replace "-m64" ""
+  '';
+
+  postBuild = ''
+    make doc-devkit-full
+  '';
+
+  nativeCheckInputs = [
+    python3Packages.robotframework
+  ];
+
+  doCheck = true;
+
+  checkPhase =
+    let
+      skippedTests = [
+        # Failing tests as of version 1.8.3
+        "FileConvert"
+        "Reconstruct"
+        "Remesh"
+
+        # Skip slow RVD test
+        "RVD"
+      ];
+    in
+    ''
+      runHook preCheck
+
+      ln -s ${testdata} ../tests/data
+
+      source tests/testenv.sh
+      robot \
+        ${lib.concatMapStringsSep " " (t: lib.escapeShellArg "--skip=${t}") skippedTests} \
+        ../tests
+
+      runHook postCheck
+    '';
+
+  meta = with lib; {
+    description = "Programming Library with Geometric Algorithms";
+    longDescription = ''
+      Geogram contains the main results in Geometry Processing from the former ALICE Inria project,
+      that is, more than 30 research articles published in ACM SIGGRAPH, ACM Transactions on Graphics,
+      Symposium on Geometry Processing and Eurographics.
+    '';
+    homepage = "https://github.com/BrunoLevy/geogram";
+    license = licenses.bsd3;
+
+    # Broken on aarch64-linux as of version 1.8.3
+    # See https://github.com/BrunoLevy/geogram/issues/74
+    broken = stdenv.isLinux && stdenv.isAarch64;
+
+    platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
+    maintainers = with maintainers; [ tmarkus ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/geogram/fix-cmake-install-destination.patch b/nixpkgs/pkgs/development/libraries/geogram/fix-cmake-install-destination.patch
new file mode 100644
index 000000000000..1dba488e8de3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/geogram/fix-cmake-install-destination.patch
@@ -0,0 +1,92 @@
+--- a/cmake/utilities.cmake	1970-01-01 01:00:01.000000000 +0100
++++ b/cmake/utilities.cmake	2023-03-09 19:28:16.556251981 +0100
+@@ -241,9 +241,9 @@
+     install(
+         TARGETS ${ARGN}
+         COMPONENT runtime
+-        RUNTIME DESTINATION bin
+-        LIBRARY DESTINATION lib
+-        ARCHIVE DESTINATION lib
++        RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
++        LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
++        ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+     )
+ endfunction()
+ 
+@@ -270,9 +270,9 @@
+         install(
+             TARGETS ${ARGN}
+             COMPONENT ${component}
+-            RUNTIME DESTINATION bin
+-            LIBRARY DESTINATION lib
+-            ARCHIVE DESTINATION lib
++            RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
++            LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
++            ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+         )
+     endforeach()
+ endfunction()
+--- a/src/lib/geogram/CMakeLists.txt	1970-01-01 01:00:01.000000000 +0100
++++ b/src/lib/geogram/CMakeLists.txt	2023-03-09 20:29:12.346780432 +0100
+@@ -76,7 +76,7 @@
+ # Install include files for the standard devkit
+ install(
+     DIRECTORY api
+-    DESTINATION include/${VORPALINE_INCLUDE_SUBPATH}/geogram
++    DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${VORPALINE_INCLUDE_SUBPATH}/geogram
+     COMPONENT devkit
+     FILES_MATCHING PATTERN *.h
+ )
+@@ -84,7 +84,7 @@
+ # Install include files for the full devkit
+ install(
+     DIRECTORY .
+-    DESTINATION include/${VORPALINE_INCLUDE_SUBPATH}/geogram
++    DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${VORPALINE_INCLUDE_SUBPATH}/geogram
+     COMPONENT devkit-full
+     FILES_MATCHING PATTERN *.h
+     # Exclude all files related to licensing
+@@ -93,7 +93,7 @@
+ 
+ install(
+         FILES "${PROJECT_BINARY_DIR}/geogram${VORPALINE_VERSION_MAJOR}.pc"
+-        DESTINATION lib${LIB_SUFFIX}/pkgconfig
++        DESTINATION ${GEOGRAM_INSTALL_PKGCONFIG_DIR}
+ )
+ 
+ 
+--- a/CMakeLists.txt	1970-01-01 01:00:01.000000000 +0100
++++ b/CMakeLists.txt	2023-03-09 20:40:20.075218356 +0100
+@@ -158,7 +158,7 @@
+ 
+ # FindGeogram.cmake
+ 
+-install(FILES cmake/FindGeogram.cmake DESTINATION lib/cmake/modules COMPONENT devkit)
++install(FILES cmake/FindGeogram.cmake DESTINATION ${GEOGRAM_INSTALL_CMAKE_DIR} COMPONENT devkit)
+ 
+ # Configure CPack
+ 
+--- a/doc/CMakeLists.txt	1970-01-01 01:00:01.000000000 +0100
++++ b/doc/CMakeLists.txt	2023-03-09 21:12:04.386327003 +0100
+@@ -25,14 +25,14 @@
+ 
+   # Install documentation
+   if(GEOGRAM_WITH_VORPALINE)
+-      install(FILES README.txt DESTINATION doc COMPONENT runtime)
+-      install(FILES ${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt DESTINATION doc COMPONENT runtime OPTIONAL)
++      install(FILES README.txt DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT runtime)
++      install(FILES ${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT runtime OPTIONAL)
+   endif()
+ 
+-  install(FILES ${CMAKE_CURRENT_BINARY_DIR}/VERSION.txt DESTINATION doc/geogram COMPONENT runtime OPTIONAL)
+-  
+-  install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/devkit/html DESTINATION doc/devkit COMPONENT doc-devkit OPTIONAL)
+-  install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/devkit-full/html DESTINATION doc/devkit COMPONENT doc-devkit-full OPTIONAL)
+-  install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/devkit-internal/html DESTINATION doc/devkit COMPONENT doc-devkit-internal OPTIONAL)
++  install(FILES ${CMAKE_CURRENT_BINARY_DIR}/VERSION.txt DESTINATION ${CMAKE_INSTALL_DOCDIR}/geogram COMPONENT runtime OPTIONAL)
++
++  install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/devkit/html DESTINATION ${CMAKE_INSTALL_DOCDIR}/devkit COMPONENT doc-devkit OPTIONAL)
++  install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/devkit-full/html DESTINATION ${CMAKE_INSTALL_DOCDIR}/devkit COMPONENT doc-devkit-full OPTIONAL)
++  install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/devkit-internal/html DESTINATION ${CMAKE_INSTALL_DOCDIR}/devkit COMPONENT doc-devkit-internal OPTIONAL)
+ 
+ endif()
diff --git a/nixpkgs/pkgs/development/libraries/geogram/replace-bundled-zlib.patch b/nixpkgs/pkgs/development/libraries/geogram/replace-bundled-zlib.patch
new file mode 100644
index 000000000000..3d19d66b0d2b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/geogram/replace-bundled-zlib.patch
@@ -0,0 +1,46 @@
+--- 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 @@
+ aux_source_directories(SOURCES "Source Files\\LM6"          LM7)
+ aux_source_directories(SOURCES "Source Files\\rply"         rply)
+ aux_source_directories(SOURCES "Source Files\\shewchuk"     shewchuk)
+-aux_source_directories(SOURCES "Source Files\\zlib"         zlib)
+ aux_source_directories(SOURCES "Source Files\\PoissonRecon" PoissonRecon)
+ aux_source_directories(SOURCES "Source Files\\xatlas"       xatlas)
+ 
+--- 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 @@
+     target_link_libraries(geogram psapi)
+ endif()
+ 
++find_package(ZLIB REQUIRED)
++target_link_libraries(geogram ZLIB::ZLIB)
++
+ # 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 <geogram/basic/numeric.h>
+ #include <geogram/basic/memory.h>
+ #include <geogram/basic/string.h>
+-#include <geogram/third_party/zlib/zlib.h>
++#include <zlib.h>
+ 
+ #include <stdexcept>
+ #include <fstream>
+--- 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
+   )
+   message(STATUS "building for Android")
+ endif()  
+ 
++find_package(ZLIB REQUIRED)
++target_link_libraries(geogram_third_party PUBLIC ZLIB::ZLIB)
+ 
+ set_target_properties(
+     geogram_third_party PROPERTIES