From 270f861dde3ca89c89228a7fbd78f185e1eb0fca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Thu, 30 May 2013 19:25:01 +0200 Subject: [PATCH] Setting opencascade 6.5 to freecad for it to build. --- .../development/libraries/opencascade/6.5.nix | 41 +++++++++++++++++++ .../libraries/opencascade/default.nix | 26 ++++++++---- pkgs/top-level/all-packages.nix | 6 ++- 3 files changed, 64 insertions(+), 9 deletions(-) create mode 100644 pkgs/development/libraries/opencascade/6.5.nix diff --git a/pkgs/development/libraries/opencascade/6.5.nix b/pkgs/development/libraries/opencascade/6.5.nix new file mode 100644 index 000000000000..7cc47a30eb70 --- /dev/null +++ b/pkgs/development/libraries/opencascade/6.5.nix @@ -0,0 +1,41 @@ +{stdenv, fetchurl, mesa, tcl, tk, file, libXmu, automake, autoconf, libtool, qt4, +ftgl, freetype}: + +stdenv.mkDerivation rec { + name = "opencascade-6.5.4"; + src = fetchurl { + url = http://files.opencascade.com/OCCT/OCC_6.5.4_release/OpenCASCADE654.tar.gz; + sha256 = "1di08mc0wly4cdi3rh9kj52bk0bfpyk6dy03c9yfnv04i7z03kmy"; + }; + + buildInputs = [ mesa tcl tk file libXmu automake autoconf libtool qt4 ftgl freetype ]; + + preUnpack = '' + sourceRoot=`pwd`/ros + ''; + + preConfigure = '' + sh ./build_configure + ''; + + # -fpermissive helps building opencascade, although gcc detects a flaw in the code + # and reports an error otherwise. Further versions may fix that. + NIX_CFLAGS_COMPILE = "-fpermissive"; + + configureFlags = [ "--with-tcl=${tcl}/lib" "--with-tk=${tk}/lib" "--with-qt=${qt4}" "--with-ftgl=${ftgl}" "--with-freetype=${freetype}" ]; + + postInstall = '' + mv $out/inc $out/include + mkdir -p $out/share/doc/${name} + cp -R ../doc $out/share/doc/${name} + ''; + + enableParallelBuilding = true; + + meta = { + description = "Open CASCADE Technology, libraries for 3D modeling and numerical simulation"; + homepage = http://www.opencascade.org/; + maintainers = with stdenv.lib.maintainers; [viric]; + platforms = with stdenv.lib.platforms; linux; + }; +} diff --git a/pkgs/development/libraries/opencascade/default.nix b/pkgs/development/libraries/opencascade/default.nix index 1ce38ab7b3cf..7cc47a30eb70 100644 --- a/pkgs/development/libraries/opencascade/default.nix +++ b/pkgs/development/libraries/opencascade/default.nix @@ -1,23 +1,33 @@ -{stdenv, fetchurl, mesa, tcl, tk, file, libXmu, cmake, qt4, freetype}: +{stdenv, fetchurl, mesa, tcl, tk, file, libXmu, automake, autoconf, libtool, qt4, +ftgl, freetype}: stdenv.mkDerivation rec { - name = "opencascade-6.6.0"; + name = "opencascade-6.5.4"; src = fetchurl { - url = http://files.opencascade.com/OCCT/OCC_6.6.0_release/OpenCASCADE660.tgz; - sha256 = "0q2xn915w9skv9sj74lxnyv9g3b0yi1j04majyzxk6sv4nra97z3"; + url = http://files.opencascade.com/OCCT/OCC_6.5.4_release/OpenCASCADE654.tar.gz; + sha256 = "1di08mc0wly4cdi3rh9kj52bk0bfpyk6dy03c9yfnv04i7z03kmy"; }; - buildInputs = [ cmake mesa tcl tk file libXmu qt4 freetype ]; + buildInputs = [ mesa tcl tk file libXmu automake autoconf libtool qt4 ftgl freetype ]; preUnpack = '' - sourceRoot=`pwd`/ros/adm/cmake - cmakeFlags="$cmakeFlags -DINSTALL_DIR=$out -D3RDPARTY_TCL_DIR=${tcl} -D3RDPARTY_FREETYPE_DIR=${freetype}" + sourceRoot=`pwd`/ros ''; + preConfigure = '' + sh ./build_configure + ''; + + # -fpermissive helps building opencascade, although gcc detects a flaw in the code + # and reports an error otherwise. Further versions may fix that. + NIX_CFLAGS_COMPILE = "-fpermissive"; + + configureFlags = [ "--with-tcl=${tcl}/lib" "--with-tk=${tk}/lib" "--with-qt=${qt4}" "--with-ftgl=${ftgl}" "--with-freetype=${freetype}" ]; + postInstall = '' mv $out/inc $out/include mkdir -p $out/share/doc/${name} - cp -R ../../../doc $out/share/doc/${name} + cp -R ../doc $out/share/doc/${name} ''; enableParallelBuilding = true; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 76f3fe907d00..5f0edb6eb460 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4820,6 +4820,8 @@ let opencascade = callPackage ../development/libraries/opencascade { }; + opencascade_6_5 = callPackage ../development/libraries/opencascade/6.5.nix { }; + opencascade_oce = callPackage ../development/libraries/opencascade/oce.nix { }; opencsg = callPackage ../development/libraries/opencsg { }; @@ -7221,7 +7223,9 @@ let # !!! Fix the dependency on two different builds of nss. }; - freecad = callPackage ../applications/graphics/freecad { }; + freecad = callPackage ../applications/graphics/freecad { + opencascade = opencascade_6_5; + }; freemind = callPackage ../applications/misc/freemind { jdk = jdk;