diff options
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/CGAL')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/CGAL/4.nix | 45 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/libraries/CGAL/cgal_path.patch | 15 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/libraries/CGAL/default.nix | 34 |
3 files changed, 94 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/CGAL/4.nix b/nixpkgs/pkgs/development/libraries/CGAL/4.nix new file mode 100644 index 000000000000..d04a7bccded6 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/CGAL/4.nix @@ -0,0 +1,45 @@ +{ lib, stdenv, fetchurl, fetchpatch, cmake, boost, gmp, mpfr }: + +stdenv.mkDerivation rec { + version = "4.14.3"; + pname = "cgal"; + + src = fetchurl { + url = "https://github.com/CGAL/cgal/releases/download/releases%2FCGAL-${version}/CGAL-${version}.tar.xz"; + hash = "sha256-W6/nq+hDW+yhehCCBi02M2jsHj8NZYG7DaiwEPs4n+Q="; + }; + + patches = [ + ./cgal_path.patch + + # Pull upstream fix for c++17 (gcc-12): + # https://github.com/CGAL/cgal/pull/6109 + (fetchpatch { + name = "gcc-12-prereq.patch"; + url = "https://github.com/CGAL/cgal/commit/4581f1b7a8e97d1a136830e64b77cdae3546c4bf.patch"; + relative = "CGAL_Core"; # Upstream slightly reordered directory structure since. + sha256 = "sha256-4+7mzGSBwAv5RHBQPAecPPKNN/LQBgvYq5mq+fHAteo="; + }) + (fetchpatch { + name = "gcc-12.patch"; + url = "https://github.com/CGAL/cgal/commit/6680a6e6f994b2c5b9f068eb3014d12ee1134d53.patch"; + relative = "CGAL_Core"; # Upstream slightly reordered directory structure since. + sha256 = "sha256-8kxJDT47jXI9kQNFI/ARWl9JBNS4AfU57/D0tYlgW0M="; + }) + ]; + + # note: optional component libCGAL_ImageIO would need zlib and opengl; + # there are also libCGAL_Qt{3,4} omitted ATM + buildInputs = [ boost gmp mpfr ]; + nativeBuildInputs = [ cmake ]; + + doCheck = false; + + meta = with lib; { + description = "Computational Geometry Algorithms Library"; + homepage = "http://cgal.org"; + license = with licenses; [ gpl3Plus lgpl3Plus]; + platforms = platforms.all; + maintainers = [ maintainers.raskin ]; + }; +} diff --git a/nixpkgs/pkgs/development/libraries/CGAL/cgal_path.patch b/nixpkgs/pkgs/development/libraries/CGAL/cgal_path.patch new file mode 100644 index 000000000000..68eec5fbb21f --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/CGAL/cgal_path.patch @@ -0,0 +1,15 @@ +--- Installation/cmake/modules/CGALConfig_install.cmake.in.original 2019-07-10 10:39:12.377022659 -0700 ++++ Installation/cmake/modules/CGALConfig_install.cmake.in 2019-07-10 10:47:24.310154928 -0700 +@@ -45,9 +45,9 @@ + set(CGAL_SHARED_LINKER_FLAGS_DEBUG_INIT "@CMAKE_SHARED_LINKER_FLAGS_DEBUG@" ) + set(CGAL_BUILD_TYPE_INIT "@CMAKE_BUILD_TYPE@" ) + +-set(CGAL_INCLUDE_DIRS "${CGAL_INSTALL_PREFIX}/@CGAL_INSTALL_INC_DIR@" ) +-set(CGAL_MODULES_DIR "${CGAL_INSTALL_PREFIX}/@CGAL_INSTALL_CMAKE_DIR@" ) +-set(CGAL_LIBRARIES_DIR "${CGAL_INSTALL_PREFIX}/@CGAL_INSTALL_LIB_DIR@" ) ++set(CGAL_INCLUDE_DIRS "@CGAL_INSTALL_INC_DIR@" ) ++set(CGAL_MODULES_DIR "@CGAL_INSTALL_CMAKE_DIR@" ) ++set(CGAL_LIBRARIES_DIR "@CGAL_INSTALL_LIB_DIR@" ) + + # If CGAL_ImageIO is built, tell if it was linked with Zlib. + set(CGAL_ImageIO_USE_ZLIB "@CGAL_ImageIO_USE_ZLIB@" ) diff --git a/nixpkgs/pkgs/development/libraries/CGAL/default.nix b/nixpkgs/pkgs/development/libraries/CGAL/default.nix new file mode 100644 index 000000000000..e7d26606f271 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/CGAL/default.nix @@ -0,0 +1,34 @@ +{ lib, stdenv +, fetchurl +, cmake +, boost +, gmp +, mpfr +}: + +stdenv.mkDerivation rec { + pname = "cgal"; + version = "5.6.1"; + + src = fetchurl { + url = "https://github.com/CGAL/cgal/releases/download/v${version}/CGAL-${version}.tar.xz"; + hash = "sha256-zbFefuMeBmNYnTEHp5mIo3t7FxnfPSTyBYVF0bzdWDc="; + }; + + # note: optional component libCGAL_ImageIO would need zlib and opengl; + # there are also libCGAL_Qt{3,4} omitted ATM + buildInputs = [ boost gmp mpfr ]; + nativeBuildInputs = [ cmake ]; + + patches = [ ./cgal_path.patch ]; + + doCheck = false; + + meta = with lib; { + description = "Computational Geometry Algorithms Library"; + homepage = "http://cgal.org"; + license = with licenses; [ gpl3Plus lgpl3Plus]; + platforms = platforms.all; + maintainers = [ maintainers.raskin ]; + }; +} |