diff options
author | Gabriel Ebner <gebner@gebner.org> | 2019-06-14 17:46:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-14 17:46:39 +0200 |
commit | 189c4de9bf988fc5c47c71ba017623ba49cc6695 (patch) | |
tree | 87aa9a21da42fb13e1115b889071586bc57db8f5 | |
parent | eeffb474bdcc9dc94c68436051ef6f42c3d6e9a6 (diff) | |
parent | 301d22c389c5cd096650f943ef8ff60f10cb18d4 (diff) | |
download | nixpkgs-189c4de9bf988fc5c47c71ba017623ba49cc6695.tar nixpkgs-189c4de9bf988fc5c47c71ba017623ba49cc6695.tar.gz nixpkgs-189c4de9bf988fc5c47c71ba017623ba49cc6695.tar.bz2 nixpkgs-189c4de9bf988fc5c47c71ba017623ba49cc6695.tar.lz nixpkgs-189c4de9bf988fc5c47c71ba017623ba49cc6695.tar.xz nixpkgs-189c4de9bf988fc5c47c71ba017623ba49cc6695.tar.zst nixpkgs-189c4de9bf988fc5c47c71ba017623ba49cc6695.zip |
Merge pull request #63095 from gebner/opencascade-update
opencascade: build with vtk and freeimage, patch for fontconfig support
-rw-r--r-- | pkgs/development/libraries/opencascade/default.nix | 56 |
1 files changed, 36 insertions, 20 deletions
diff --git a/pkgs/development/libraries/opencascade/default.nix b/pkgs/development/libraries/opencascade/default.nix index 05d78488957..8334bf195f7 100644 --- a/pkgs/development/libraries/opencascade/default.nix +++ b/pkgs/development/libraries/opencascade/default.nix @@ -1,33 +1,49 @@ -{stdenv, fetchurl, libGLU_combined, tcl, tk, file, libXmu, cmake, libtool, qt4, -ftgl, freetype}: +{ stdenv, fetchFromGitHub, fetchpatch, libGL, libGLU, libXmu, cmake, ninja, + pkgconfig, fontconfig, freetype, expat, freeimage, vtk }: stdenv.mkDerivation rec { - name = "opencascade-oce-0.18.3"; - src = fetchurl { - url = https://github.com/tpaviot/oce/archive/OCE-0.18.3.tar.gz; - sha256 = "0v4ny0qhr5hiialb2ss25bllfnd6j4g7mfxnqfmr1xsjpykxcly5"; + pname = "opencascade-oce"; + version = "0.18.3"; + + src = fetchFromGitHub { + owner = "tpaviot"; + repo = "oce"; + rev = "OCE-${version}"; + sha256 = "17wy8dcf44vqisishv1jjf3cmcxyygqq29y9c3wjdj983qi2hsig"; }; - buildInputs = [ libGLU_combined tcl tk file libXmu libtool qt4 ftgl freetype cmake ]; + nativeBuildInputs = [ cmake ninja pkgconfig ]; + buildInputs = [ libGL libGLU libXmu freetype fontconfig expat freeimage vtk ]; - # Fix for glibc 2.26 - postPatch = '' - sed -i -e 's/^\( *#include <\)x\(locale.h>\)//' \ - src/Standard/Standard_CLocaleSentry.hxx - ''; + cmakeFlags = [ + "-DOCE_INSTALL_PREFIX=${placeholder "out"}" + "-DOCE_WITH_FREEIMAGE=ON" + "-DOCE_WITH_VTK=ON" + ]; - preConfigure = '' - cmakeFlags="$cmakeFlags -DOCE_INSTALL_PREFIX=$out" - ''; + patches = [ + # Use fontconfig instead of hardcoded directory list + # https://github.com/tpaviot/oce/pull/714 + (fetchpatch { + url = "https://github.com/tpaviot/oce/commit/9643432b27fec8974ca0ee15c3c372f5fe8fc069.patch"; + sha256 = "1wd940rszmh5apcpk5fv6126h8mcjcy4rjifrql5d4ac90v06v4c"; + }) + # Fix for glibc 2.26 + (fetchpatch { + url = "https://github.com/tpaviot/oce/commit/3b44656e93270d782009b06ec4be84d2a13f8126.patch"; + sha256 = "1ccakkcwy5g0184m23x0mnh22i0lk45xm8kgiv5z3pl7nh35dh8k"; + }) + ]; - # https://bugs.freedesktop.org/show_bug.cgi?id=83631 - NIX_CFLAGS_COMPILE = "-DGLX_GLXEXT_LEGACY"; - - enableParallelBuilding = true; + postPatch = '' + # make sure the installed cmake file uses absolute paths for fontconfig + substituteInPlace adm/cmake/TKService/CMakeLists.txt \ + --replace FONTCONFIG_LIBRARIES FONTCONFIG_LINK_LIBRARIES + ''; meta = with stdenv.lib; { description = "Open CASCADE Technology, libraries for 3D modeling and numerical simulation"; - homepage = http://www.opencascade.org/; + homepage = "https://github.com/tpaviot/oce"; maintainers = [ maintainers.viric ]; platforms = platforms.linux; license = licenses.lgpl21; |