Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / libraries / geogram / default.nix
blob1079f89d932880c1cab04411b0043f6947d31bff
1 { lib
2 , stdenv
3 , fetchurl
4 , fetchFromGitHub
6 , cmake
7 , doxygen
8 , zlib
9 , python3Packages
12 let
13   testdata = fetchFromGitHub {
14     owner = "BrunoLevy";
15     repo = "geogram.data";
16     rev = "8fd071a560bd6859508f1710981386d0b2ba01b1";
17     hash = "sha256-jMUGX6/uYIZMVwXxTAAGUaOXqF+NrFQqgmIPCD58cwM=";
18   };
20 stdenv.mkDerivation rec {
21   pname = "geogram";
22   version = "1.8.3";
24   src = fetchurl {
25     url = "https://github.com/BrunoLevy/geogram/releases/download/v${version}/geogram_${version}.tar.gz";
26     hash = "sha256-91q0M/4kAr0UoWXOQIEYS1VbgEQ/F4EBOfJE9Vr1bnw=";
27   };
29   outputs = [ "bin" "lib" "dev" "doc" "out" ];
31   cmakeFlags = [
32     # Triangle is unfree
33     "-DGEOGRAM_WITH_TRIANGLE=OFF"
35     # Disable some extra features (feel free to create a PR if you need one of those)
37     # If GEOGRAM_WITH_LEGACY_NUMERICS is enabled GeoGram will build its own version of
38     # ARPACK, CBLAS, CLAPACK, LIBF2C and SUPERLU
39     "-DGEOGRAM_WITH_LEGACY_NUMERICS=OFF"
41     # Don't build Lua
42     "-DGEOGRAM_WITH_LUA=OFF"
44     # Disable certain features requiring GLFW
45     "-DGEOGRAM_WITH_GRAPHICS=OFF"
47     # NOTE: Options introduced by patch (see below)
48     "-DGEOGRAM_INSTALL_CMAKE_DIR=${placeholder "dev"}/lib/cmake"
49     "-DGEOGRAM_INSTALL_PKGCONFIG_DIR=${placeholder "dev"}/lib/pkgconfig"
50   ];
52   nativeBuildInputs = [
53     cmake
54     doxygen
55   ];
57   buildInputs = [
58     zlib
59   ];
61   patches = [
62     # See https://github.com/BrunoLevy/geogram/pull/76
63     ./fix-cmake-install-destination.patch
65     # This patch replaces the bundled (outdated) zlib with our zlib
66     # Should be harmless, but if there are issues this patch can also be removed
67     # Also check https://github.com/BrunoLevy/geogram/issues/49 for progress
68     ./replace-bundled-zlib.patch
69   ];
71   postPatch = lib.optionalString stdenv.isAarch64 ''
72     substituteInPlace cmake/platforms/*/config.cmake \
73       --replace "-m64" ""
74   '';
76   postBuild = ''
77     make doc-devkit-full
78   '';
80   nativeCheckInputs = [
81     python3Packages.robotframework
82   ];
84   doCheck = true;
86   checkPhase =
87     let
88       skippedTests = [
89         # Failing tests as of version 1.8.3
90         "FileConvert"
91         "Reconstruct"
92         "Remesh"
94         # Skip slow RVD test
95         "RVD"
96       ];
97     in
98     ''
99       runHook preCheck
101       ln -s ${testdata} ../tests/data
103       source tests/testenv.sh
104       robot \
105         ${lib.concatMapStringsSep " " (t: lib.escapeShellArg "--skip=${t}") skippedTests} \
106         ../tests
108       runHook postCheck
109     '';
111   meta = with lib; {
112     description = "Programming Library with Geometric Algorithms";
113     longDescription = ''
114       Geogram contains the main results in Geometry Processing from the former ALICE Inria project,
115       that is, more than 30 research articles published in ACM SIGGRAPH, ACM Transactions on Graphics,
116       Symposium on Geometry Processing and Eurographics.
117     '';
118     homepage = "https://github.com/BrunoLevy/geogram";
119     license = licenses.bsd3;
121     # Broken on aarch64-linux as of version 1.8.3
122     # See https://github.com/BrunoLevy/geogram/issues/74
123     broken = stdenv.isLinux && stdenv.isAarch64;
125     platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
126     maintainers = with maintainers; [ tmarkus ];
127   };