diff options
author | Andreas K. Hüttel <dilfridge@gentoo.org> | 2011-11-13 20:42:50 +0000 |
---|---|---|
committer | Andreas K. Hüttel <dilfridge@gentoo.org> | 2011-11-13 20:42:50 +0000 |
commit | a910cc869e844bca9b79d80926f727338bdd6b72 (patch) | |
tree | b2a51ae0914b4a1d7d2f35660f82e0d4cb4225d9 | |
parent | version bump (diff) | |
download | gentoo-2-a910cc869e844bca9b79d80926f727338bdd6b72.tar.gz gentoo-2-a910cc869e844bca9b79d80926f727338bdd6b72.tar.bz2 gentoo-2-a910cc869e844bca9b79d80926f727338bdd6b72.zip |
Version bump, thanks to Oliver Borm
(Portage version: 2.1.10.34/cvs/Linux x86_64)
-rw-r--r-- | sci-libs/opencascade/ChangeLog | 9 | ||||
-rw-r--r-- | sci-libs/opencascade/files/env.sh.template | 40 | ||||
-rw-r--r-- | sci-libs/opencascade/files/opencascade-6.5-fixed-DESTDIR.patch | 174 | ||||
-rw-r--r-- | sci-libs/opencascade/files/opencascade-6.5-ftgl.patch | 77 | ||||
-rw-r--r-- | sci-libs/opencascade/metadata.xml | 3 | ||||
-rw-r--r-- | sci-libs/opencascade/opencascade-6.5.ebuild | 179 |
6 files changed, 481 insertions, 1 deletions
diff --git a/sci-libs/opencascade/ChangeLog b/sci-libs/opencascade/ChangeLog index 45fefef92b86..9f36676e544c 100644 --- a/sci-libs/opencascade/ChangeLog +++ b/sci-libs/opencascade/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for sci-libs/opencascade # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sci-libs/opencascade/ChangeLog,v 1.3 2011/08/21 12:25:57 dilfridge Exp $ +# $Header: /var/cvsroot/gentoo-x86/sci-libs/opencascade/ChangeLog,v 1.4 2011/11/13 20:42:50 dilfridge Exp $ + +*opencascade-6.5 (13 Nov 2011) + + 13 Nov 2011; Andreas K. Huettel <dilfridge@gentoo.org> + +opencascade-6.5.ebuild, +files/opencascade-6.5-fixed-DESTDIR.patch, + +files/opencascade-6.5-ftgl.patch, +files/env.sh.template: + Version bump, thanks to Oliver Borm 21 Aug 2011; Andreas K. Huettel <dilfridge@gentoo.org> opencascade-6.3-r3.ebuild, +files/opencascade-6.3-underlinking.patch: diff --git a/sci-libs/opencascade/files/env.sh.template b/sci-libs/opencascade/files/env.sh.template new file mode 100644 index 000000000000..146c86ba6d8c --- /dev/null +++ b/sci-libs/opencascade/files/env.sh.template @@ -0,0 +1,40 @@ +#!/bin/sh -f + +export CASROOT=VAR_CASROOT + +if [ -z "PATH" ]; +then PATH=VAR_CASROOT/Linux/bin; +else PATH=VAR_CASROOT/Linux/bin:$PATH; +fi +export PATH +if [ -z "LD_LIBRARY_PATH" ]; +then LD_LIBRARY_PATH=VAR_CASROOT/Linux/lib; +else LD_LIBRARY_PATH=VAR_CASROOT/Linux/lib:$LD_LIBRARY_PATH; +fi +export LD_LIBRARY_PATH +export CSF_MDTVFontDirectory=VAR_CASROOT/src/FontMFT +export CSF_LANGUAGE=us +export MMGT_CLEAR=1 +export CSF_EXCEPTION_PROMPT=1 +export CSF_SHMessage=VAR_CASROOT/src/SHMessage +export CSF_MDTVTexturesDirectory=VAR_CASROOT/src/Textures +export CSF_XSMessage=VAR_CASROOT/src/XSMessage +export CSF_StandardDefaults=VAR_CASROOT/src/StdResource +export CSF_PluginDefaults=VAR_CASROOT/src/StdResource +export CSF_XCAFDefaults=VAR_CASROOT/src/StdResource +export CSF_StandardLiteDefaults=VAR_CASROOT/src/StdResource +export CSF_GraphicShr=VAR_CASROOT/Linux/lib/libTKOpenGl.so +export CSF_UnitsLexicon=VAR_CASROOT/src/UnitsAPI/Lexi_Expr.dat +export CSF_UnitsDefinition=VAR_CASROOT/src/UnitsAPI/Units.dat +export CSF_IGESDefaults=VAR_CASROOT/src/XSTEPResource +export CSF_STEPDefaults=VAR_CASROOT/src/XSTEPResource +export CSF_XmlOcafResource=VAR_CASROOT/src/XmlOcafResource +export CSF_MIGRATION_TYPES=VAR_CASROOT/src/StdResource/MigrationSheet.txt + +export TCLHOME=VAR_SYS_BIN +export TCLLIBPATH=VAR_SYS_LIB +export ITK_LIBRARY=VAR_SYS_LIB/VAR_ITK +export ITCL_LIBRARY=VAR_SYS_LIB/VAR_ITCL +export TIX_LIBRARY=VAR_SYS_LIB/VAR_TIX +export TK_LIBRARY=VAR_SYS_LIB/VAR_TK +export TCL_LIBRARY=VAR_SYS_LIB/VAR_TCL diff --git a/sci-libs/opencascade/files/opencascade-6.5-fixed-DESTDIR.patch b/sci-libs/opencascade/files/opencascade-6.5-fixed-DESTDIR.patch new file mode 100644 index 000000000000..ea0f9b6f166f --- /dev/null +++ b/sci-libs/opencascade/files/opencascade-6.5-fixed-DESTDIR.patch @@ -0,0 +1,174 @@ +diff -urN opencascade.orig/ros/Makefile.am opencascade/ros/Makefile.am +--- opencascade.orig/ros/Makefile.am 2011-03-06 16:08:59.000000000 +0100 ++++ opencascade/ros/Makefile.am 2011-03-06 16:13:35.000000000 +0100 +@@ -86,106 +86,106 @@ + dir_SunOS=sun + + install-exec-local: +- $(INSTALL) -d $(prefix)/$(platform) +- if [ -e $(prefix)/bin -a ! -e $(prefix)/$(platform)/bin ]; then \ +- cd $(prefix)/$(platform) && ln -s ../bin bin; \ ++ $(INSTALL) -d $(DESTDIR)$(prefix)/$(platform) ++ if [ -e $(DESTDIR)$(prefix)/bin -a ! -e $(DESTDIR)$(prefix)/$(platform)/bin ]; then \ ++ cd $(DESTDIR)$(prefix)/$(platform) && ln -s ../bin bin; \ + fi +- if [ -e $(prefix)/lib -a ! -e $(prefix)/$(platform)/lib ]; then \ +- cd $(prefix)/$(platform) && ln -s ../lib lib; \ ++ if [ -e $(DESTDIR)$(prefix)/lib -a ! -e $(DESTDIR)$(prefix)/$(platform)/lib ]; then \ ++ cd $(DESTDIR)$(prefix)/$(platform) && ln -s ../lib lib; \ + fi +- $(INSTALL) -d $(prefix)/$(dir_$(platform)) +- if [ -e $(prefix)/bin -a ! -e $(prefix)/$(dir_$(platform))/bin ]; then \ +- cd $(prefix)/$(dir_$(platform)) && ln -s ../bin bin; \ ++ $(INSTALL) -d $(DESTDIR)$(prefix)/$(dir_$(platform)) ++ if [ -e $(DESTDIR)$(prefix)/bin -a ! -e $(DESTDIR)$(prefix)/$(dir_$(platform))/bin ]; then \ ++ cd $(DESTDIR)$(prefix)/$(dir_$(platform)) && ln -s ../bin bin; \ + fi +- if [ -e $(prefix)/lib -a ! -e $(prefix)/$(dir_$(platform))/lib ]; then \ +- cd $(prefix)/$(dir_$(platform)) && ln -s ../lib lib; \ ++ if [ -e $(DESTDIR)$(prefix)/lib -a ! -e $(DESTDIR)$(prefix)/$(dir_$(platform))/lib ]; then \ ++ cd $(DESTDIR)$(prefix)/$(dir_$(platform)) && ln -s ../lib lib; \ + fi +- bd=`pwd`; cd $(top_srcdir); sd=`pwd`; cd $(prefix); pd=`pwd`; cd $$bd; \ ++ bd=`pwd`; cd $(top_srcdir); sd=`pwd`; cd $(DESTDIR)$(prefix); pd=`pwd`; cd $$bd; \ + if [ "$$pd" != "$$sd" ]; then \ +- $(INSTALL) -d $(prefix)/inc; \ +- cp -fr$(CP_$(platform)) $(top_srcdir)/inc $(prefix); \ ++ $(INSTALL) -d $(DESTDIR)$(prefix)/inc; \ ++ cp -fr$(CP_$(platform)) $(top_srcdir)/inc $(DESTDIR)$(prefix); \ + fi; \ + if [ "$$pd" != "$$bd" ]; then \ +- cp -fr$(CP_$(platform)) $$bd/config.h $(prefix); \ ++ cp -fr$(CP_$(platform)) $$bd/config.h $(DESTDIR)$(prefix); \ + fi +- if [ -e $(prefix)/inc/config.h ]; then \ +- unlink $(prefix)/inc/config.h; \ ++ if [ -e $(DESTDIR)$(prefix)/inc/config.h ]; then \ ++ unlink $(DESTDIR)$(prefix)/inc/config.h; \ + fi +- cd $(prefix)/inc && ln -s ../config.h config.h +- bd=`pwd`; cd $(top_srcdir); sd=`pwd`; cd $(prefix); pd=`pwd`; cd $$bd; \ ++ cd $(DESTDIR)$(prefix)/inc && ln -s ../config.h config.h ++ bd=`pwd`; cd $(top_srcdir); sd=`pwd`; cd $(DESTDIR)$(prefix); pd=`pwd`; cd $$bd; \ + if [ "$$pd" != "$$sd" -a -d $(top_srcdir)/src/UnitsAPI ]; then \ +- $(INSTALL) -d $(prefix)/src; \ +- $(INSTALL) -d $(prefix)/src/UnitsAPI; \ +- cp -fr$(CP_$(platform)) $(top_srcdir)/src/UnitsAPI $(prefix)/src; \ +- cp -f$(CP_$(platform)) $(top_srcdir)/env_DRAW.sh $(prefix); \ ++ $(INSTALL) -d $(DESTDIR)$(prefix)/src; \ ++ $(INSTALL) -d $(DESTDIR)$(prefix)/src/UnitsAPI; \ ++ cp -fr$(CP_$(platform)) $(top_srcdir)/src/UnitsAPI $(DESTDIR)$(prefix)/src; \ ++ cp -f$(CP_$(platform)) $(top_srcdir)/env_DRAW.sh $(DESTDIR)$(prefix); \ + fi +- bd=`pwd`; cd $(top_srcdir); sd=`pwd`; cd $(prefix); pd=`pwd`; cd $$bd; \ ++ bd=`pwd`; cd $(top_srcdir); sd=`pwd`; cd $(DESTDIR)$(prefix); pd=`pwd`; cd $$bd; \ + if [ "$$pd" != "$$sd" ]; then \ + inst_dirs="$(FoundationClasses_DIRS)"; \ + if test "x$(FoundationClasses_DIRS)" != "x"; then \ + for d in $$inst_dirs; do \ +- $(INSTALL) -d $(prefix)/src/$$d; \ +- cp -fr$(CP_$(platform)) $(top_srcdir)/src/$$d $(prefix)/src; \ ++ $(INSTALL) -d $(DESTDIR)$(prefix)/src/$$d; \ ++ cp -fr$(CP_$(platform)) $(top_srcdir)/src/$$d $(DESTDIR)$(prefix)/src; \ + done; \ + fi; \ + fi +- bd=`pwd`; cd $(top_srcdir); sd=`pwd`; cd $(prefix); pd=`pwd`; cd $$bd; \ ++ bd=`pwd`; cd $(top_srcdir); sd=`pwd`; cd $(DESTDIR)$(prefix); pd=`pwd`; cd $$bd; \ + if [ "$$pd" != "$$sd" ]; then \ + inst_dirs="$(ModelingData_DIRS)"; \ + if test "x$(ModelingData_DIRS)" != "x"; then \ + for d in $$inst_dirs; do \ +- $(INSTALL) -d $(prefix)/src/$$d; \ +- cp -fr$(CP_$(platform)) $(top_srcdir)/src/$$d $(prefix)/src; \ ++ $(INSTALL) -d $(DESTDIR)$(prefix)/src/$$d; \ ++ cp -fr$(CP_$(platform)) $(top_srcdir)/src/$$d $(DESTDIR)$(prefix)/src; \ + done; \ + fi; \ + fi +- bd=`pwd`; cd $(top_srcdir); sd=`pwd`; cd $(prefix); pd=`pwd`; cd $$bd; \ ++ bd=`pwd`; cd $(top_srcdir); sd=`pwd`; cd $(DESTDIR)$(prefix); pd=`pwd`; cd $$bd; \ + if [ "$$pd" != "$$sd" ]; then \ + inst_dirs="$(ModelingAlgorithms_DIRS)"; \ + if test "x$(ModelingAlgorithms_DIRS)" != "x"; then \ + for d in $$inst_dirs; do \ +- $(INSTALL) -d $(prefix)/src/$$d; \ +- cp -fr$(CP_$(platform)) $(top_srcdir)/src/$$d $(prefix)/src; \ ++ $(INSTALL) -d $(DESTDIR)$(prefix)/src/$$d; \ ++ cp -fr$(CP_$(platform)) $(top_srcdir)/src/$$d $(DESTDIR)$(prefix)/src; \ + done; \ + fi; \ + fi +- bd=`pwd`; cd $(top_srcdir); sd=`pwd`; cd $(prefix); pd=`pwd`; cd $$bd; \ ++ bd=`pwd`; cd $(top_srcdir); sd=`pwd`; cd $(DESTDIR)$(prefix); pd=`pwd`; cd $$bd; \ + if [ "$$pd" != "$$sd" ]; then \ + inst_dirs="$(Visualization_DIRS)"; \ + if test "x$(Visualization_DIRS)" != "x"; then \ + for d in $$inst_dirs; do \ +- $(INSTALL) -d $(prefix)/src/$$d; \ +- cp -fr$(CP_$(platform)) $(top_srcdir)/src/$$d $(prefix)/src; \ ++ $(INSTALL) -d $(DESTDIR)$(prefix)/src/$$d; \ ++ cp -fr$(CP_$(platform)) $(top_srcdir)/src/$$d $(DESTDIR)$(prefix)/src; \ + done; \ + fi; \ + fi +- bd=`pwd`; cd $(top_srcdir); sd=`pwd`; cd $(prefix); pd=`pwd`; cd $$bd; \ ++ bd=`pwd`; cd $(top_srcdir); sd=`pwd`; cd $(DESTDIR)$(prefix); pd=`pwd`; cd $$bd; \ + if [ "$$pd" != "$$sd" ]; then \ + inst_dirs="$(ApplicationFramework_DIRS)"; \ + if test "x$(ApplicationFramework_DIRS)" != "x"; then \ + for d in $$inst_dirs; do \ +- $(INSTALL) -d $(prefix)/src/$$d; \ +- cp -fr$(CP_$(platform)) $(top_srcdir)/src/$$d $(prefix)/src; \ ++ $(INSTALL) -d $(DESTDIR)$(prefix)/src/$$d; \ ++ cp -fr$(CP_$(platform)) $(top_srcdir)/src/$$d $(DESTDIR)$(prefix)/src; \ + done; \ + fi; \ + fi +- bd=`pwd`; cd $(top_srcdir); sd=`pwd`; cd $(prefix); pd=`pwd`; cd $$bd; \ ++ bd=`pwd`; cd $(top_srcdir); sd=`pwd`; cd $(DESTDIR)$(prefix); pd=`pwd`; cd $$bd; \ + if [ "$$pd" != "$$sd" ]; then \ + inst_dirs="$(DataExchange_DIRS)"; \ + if test "x$(DataExchange_DIRS)" != "x"; then \ + for d in $$inst_dirs; do \ +- $(INSTALL) -d $(prefix)/src/$$d; \ +- cp -fr$(CP_$(platform)) $(top_srcdir)/src/$$d $(prefix)/src; \ ++ $(INSTALL) -d $(DESTDIR)$(prefix)/src/$$d; \ ++ cp -fr$(CP_$(platform)) $(top_srcdir)/src/$$d $(DESTDIR)$(prefix)/src; \ + done; \ + fi; \ + fi +- bd=`pwd`; cd $(top_srcdir); sd=`pwd`; cd $(prefix); pd=`pwd`; cd $$bd; \ ++ bd=`pwd`; cd $(top_srcdir); sd=`pwd`; cd $(DESTDIR)$(prefix); pd=`pwd`; cd $$bd; \ + if [ "$$pd" != "$$sd" ]; then \ + inst_dirs="$(Draw_DIRS)"; \ + if test "x$(Draw_DIRS)" != "x"; then \ + for d in $$inst_dirs; do \ +- $(INSTALL) -d $(prefix)/src/$$d; \ +- cp -fr$(CP_$(platform)) $(top_srcdir)/src/$$d $(prefix)/src; \ ++ $(INSTALL) -d $(DESTDIR)$(prefix)/src/$$d; \ ++ cp -fr$(CP_$(platform)) $(top_srcdir)/src/$$d $(DESTDIR)$(prefix)/src; \ + done; \ + fi; \ + fi +diff -urN opencascade.orig/ros/configure.in opencascade/ros/configure.in +--- opencascade/ros/configure.in.orig 2011-03-06 19:36:08.000000000 +0100 ++++ opencascade/ros/configure.in 2011-03-06 22:24:04.000000000 +0100 +@@ -422,7 +422,7 @@ + HAVE_FTGL=yes + HAVE_FTGL_INC=yes + CPPFLAGS="-I$ftgl/include $CPPFLAGS"; +- AC_CHECK_HEADER( [FTGL/FTGL.h], [], [HAVE_FTGL_INC=no] ) ++ AC_CHECK_HEADER( [FTGL/ftgl.h], [], [HAVE_FTGL_INC=no] ) + if test "x$HAVE_FTGL_INC" = "xyes"; then + CSF_FTGL_INCLUDES="-I$ftgl/include/FTGL" + HAVE_FTGL_LIB=yes +@@ -433,7 +433,7 @@ + #we have problem with unresolved symbols on 64 stations + CSF_FTGL_LIB="-L$ftgl/lib -lftgl" + AC_TRY_LINK([ +-#include <FTGL/FTGL.h> ++#include <FTGL/ftgl.h> + #include <FTGL/FTGLTextureFont.h> + ], [ + FTGLTextureFont font("");], [ diff --git a/sci-libs/opencascade/files/opencascade-6.5-ftgl.patch b/sci-libs/opencascade/files/opencascade-6.5-ftgl.patch new file mode 100644 index 000000000000..b2729f4f403b --- /dev/null +++ b/sci-libs/opencascade/files/opencascade-6.5-ftgl.patch @@ -0,0 +1,77 @@ +--- opencascade/ros/src/OpenGl/OpenGl_FontMgr.cxx.orig 2011-03-06 21:55:55.000000000 +0100 ++++ opencascade/ros/src/OpenGl/OpenGl_FontMgr.cxx 2011-03-06 23:06:05.000000000 +0100 +@@ -1,8 +1,9 @@ + #include <OpenGl_FontMgr.hxx> + +-#include <FTGLTextureFont.h> +-#include <FTLibrary.h> +-#include <FTFace.h> ++#include <ftgl.h> ++// #include <FTGLTextureFont.h> ++// #include <FTLibrary.h> ++// #include <FTFace.h> + #include <Standard_Stream.hxx> + + #undef TRACE +@@ -71,10 +72,29 @@ + if ( it.Value()->FontAspect() == OSD_FA_Regular ) { + //this workaround for fonts with names dependent on system locale. + //for example: "Times New Roman Fett Kursive" or "Times New Roman Gras Italiqui" +- FTFace face(it.Value()->FontPath()->ToCString()); ++// FTFace face(it.Value()->FontPath()->ToCString()); ++ ++ FT_Library* library = new FT_Library; ++ FT_Error ftErrLib = FT_Init_FreeType( library); ++ ++ const FT_Long DEFAULT_FACE_INDEX = 0; ++ FT_Face* ftFace = new FT_Face; ++ ++ FT_Error err = FT_New_Face( (*library), it.Value()->FontPath()->ToCString(), DEFAULT_FACE_INDEX, ftFace); ++ ++// if( err) ++// { ++// delete ftFace; ++// ftFace = 0; ++// } ++// else ++// { ++// numGlyphs = (*ftFace)->num_glyphs; ++// hasKerningTable = FT_HAS_KERNING((*ftFace)); ++// } + +- if ( face.Error() == FT_Err_Ok ) { +- if ( (*face.Face())->style_flags == 0 ) { ++ if ( err == FT_Err_Ok ) { ++ if ( (*ftFace)->style_flags == 0 ) { + info->SysFont = it.Value(); + } + else { +@@ -82,22 +102,22 @@ + #ifdef TRACE + cout << "TKOpenGl::initializeFontDB() detected new font!\n" + << "\tFont Previous Name: " << it.Value()->FontName()->ToCString() << endl +- << "\tFont New Name: " << (*face.Face())->family_name << endl +- << "\tFont Aspect: " << (*face.Face())->style_flags << endl; ++ << "\tFont New Name: " << (*ftFace)->family_name << endl ++ << "\tFont Aspect: " << (*ftFace)->style_flags << endl; + #endif + OSD_FontAspect aspect = OSD_FA_Regular; +- if ( (*face.Face())->style_flags == (FT_STYLE_FLAG_ITALIC | FT_STYLE_FLAG_BOLD) ) ++ if ( (*ftFace)->style_flags == (FT_STYLE_FLAG_ITALIC | FT_STYLE_FLAG_BOLD) ) + aspect = OSD_FA_BoldItalic; +- else if ( (*face.Face())->style_flags == FT_STYLE_FLAG_ITALIC ) ++ else if ( (*ftFace)->style_flags == FT_STYLE_FLAG_ITALIC ) + aspect = OSD_FA_Italic; +- else if ( (*face.Face())->style_flags == FT_STYLE_FLAG_BOLD ) ++ else if ( (*ftFace)->style_flags == FT_STYLE_FLAG_BOLD ) + aspect = OSD_FA_Bold; + + #ifdef TRACE + cout << "\tOSD_FontAspect: " << aspect << endl; + #endif + Handle(TCollection_HAsciiString) aFontName = +- new TCollection_HAsciiString( (*face.Face())->family_name ); ++ new TCollection_HAsciiString( (*ftFace)->family_name ); + info->SysFont = new OSD_SystemFont( aFontName, aspect, it.Value()->FontPath() ); + } + } diff --git a/sci-libs/opencascade/metadata.xml b/sci-libs/opencascade/metadata.xml index b166de434e3a..5c77ec0fce9a 100644 --- a/sci-libs/opencascade/metadata.xml +++ b/sci-libs/opencascade/metadata.xml @@ -3,4 +3,7 @@ <pkgmetadata> <herd>sci</herd> <maintainer><email>dilfridge@gentoo.org</email></maintainer> +<use> + <flag name="gl2ps">Use gl2ps PostScript printing library</flag> +</use> </pkgmetadata> diff --git a/sci-libs/opencascade/opencascade-6.5.ebuild b/sci-libs/opencascade/opencascade-6.5.ebuild new file mode 100644 index 000000000000..134451ad4057 --- /dev/null +++ b/sci-libs/opencascade/opencascade-6.5.ebuild @@ -0,0 +1,179 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sci-libs/opencascade/opencascade-6.5.ebuild,v 1.1 2011/11/13 20:42:50 dilfridge Exp $ + +EAPI=4 + +inherit autotools eutils check-reqs multilib java-pkg-opt-2 flag-o-matic + +DESCRIPTION="Software development platform for CAD/CAE, 3D surface/solid modeling and data exchange" +HOMEPAGE="http://www.opencascade.org/" +SRC_URI="http://files.opencascade.com/OCCT/OCC_${PV}_release/OpenCASCADE650.tar.gz" + +LICENSE="Open-CASCADE-Technology-Public-License-6.5" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="debug doc examples gl2ps java" + +DEPEND=" + media-libs/ftgl + virtual/opengl + x11-libs/libXmu + >=dev-lang/tcl-8.4 + >=dev-lang/tk-8.4 + >=dev-tcltk/itcl-3.2 + >=dev-tcltk/itk-3.2 + >=dev-tcltk/tix-8.4.2 + gl2ps? ( x11-libs/gl2ps ) +" +RDEPEND=${DEPEND} + +S=${WORKDIR}/ros + +RESTRICT="bindist mirror" +# http://bugs.gentoo.org/show_bug.cgi?id=352435 +# http://www.gentoo.org/foundation/en/minutes/2011/20110220_trustees.meeting_log.txt + +CHECKREQS_MEMORY="256M" +CHECKREQS_DISK_BUILD="3584M" + +pkg_setup() { + check_reqs_pkg_setup + java-pkg-opt-2_pkg_setup + + # Determine itk, itcl, tix, tk and tcl versions + itk_version=$(grep ITK_VER /usr/include/itk.h | sed 's/^.*"\(.*\)".*/\1/') + itcl_version=$(grep ITCL_VER /usr/include/itcl.h | sed 's/^.*"\(.*\)".*/\1/') + tix_version=$(grep TIX_VER /usr/include/tix.h | sed 's/^.*"\(.*\)".*/\1/') + tk_version=$(grep TK_VER /usr/include/tk.h | sed 's/^.*"\(.*\)".*/\1/') + tcl_version=$(grep TCL_VER /usr/include/tcl.h | sed 's/^.*"\(.*\)".*/\1/') + + INSTALL_DIR=/usr/$(get_libdir)/${P}/ros + + ewarn " Please note that building OpenCascade takes a lot of time and " + ewarn " hardware ressources: 3.5-4 GB free diskspace and 256 MB RAM are " + ewarn " the minimum requirements. " +} + +src_prepare() { + java-pkg-opt-2_src_prepare + + # Substitute with our ready-made env.sh script + cp -f "${FILESDIR}"/env.sh.template env.sh || die + + # Feed environment variables used by Opencascade compilation + sed -i \ + -e "s:VAR_CASROOT:${S}:g" \ + -e 's:VAR_SYS_BIN:/usr/bin:g' \ + -e "s:VAR_SYS_LIB:/usr/$(get_libdir):g" env.sh \ + || die "Environment variables feed in env.sh failed!" + + # Tweak itk, itcl, tix, tk and tcl versions + sed -i \ + -e "s:VAR_ITK:itk${itk_version}:g" \ + -e "s:VAR_ITCL:itcl${itcl_version}:g" \ + -e "s:VAR_TIX:tix${tix_version}:g" \ + -e "s:VAR_TK:tk${tk_version}:g" \ + -e "s:VAR_TCL:tcl${tcl_version}:g" env.sh \ + || die "itk, itcl, tix, tk and tcl version tweaking failed!" + + epatch "${FILESDIR}"/${P}-ftgl.patch + epatch "${FILESDIR}"/${P}-fixed-DESTDIR.patch + + source env.sh + + append-cxxflags "-fpermissive" + + eautoreconf +} + +src_configure() { + # Add the configure options + local confargs="--prefix=${INSTALL_DIR}/lin --exec-prefix=${INSTALL_DIR}/lin --with-tcl=/usr/$(get_libdir) --with-tk=/usr/$(get_libdir)" + + confargs+=" --with-freetype=/usr" + confargs+=" --with-ftgl=/usr" + + use gl2ps && confargs+=" --with-gl2ps=/usr" + + if use java ; then + confargs+=" --with-java-include=$(java-config -O)/include" + else + confargs+=" --without-java-include" + fi + + econf ${confargs} \ + $(use_enable debug ) $(use_enable !debug production ) \ + || die "Configuration failed" +} + +src_install() { + emake DESTDIR="${D}" install + + # .la files kill cute little kittens + find "${D}" -name '*.la' -exec rm {} + + + # Symlinks for keeping original OpenCascade folder structure and + # add a link lib to $(get_libdir) if we are e.g. on amd64 multilib + if [ "$(get_libdir)" != "lib" ]; then + dosym "$(get_libdir)" "${INSTALL_DIR}/lin/lib" + fi + + # Tweak the environment variables script again with new destination + cp "${FILESDIR}"/env.sh.template env.sh + sed -i "s:VAR_CASROOT:${INSTALL_DIR}/lin:g" env.sh || die + + # Build the env.d environment variables + cp "${FILESDIR}"/env.sh.template 50${PN} || die + sed -i \ + -e 's:export ::g' \ + -e "s:VAR_CASROOT:${INSTALL_DIR}/lin:g" \ + -e '1,2d' \ + -e '4,14d' \ + -e "s:/Linux/lib/:/$(get_libdir)/:g" ./50${PN} \ + || die "Creation of the /etc/env.d/50opencascade failed!" + + sed -i "2i\PATH=${INSTALL_DIR}/lin/bin\nLDPATH=${INSTALL_DIR}/lin/$(get_libdir)" ./50${PN} \ + || die "Creation of the /etc/env.d/50opencascade failed!" + + # Update both env.d and script with the libraries variables + sed -i \ + -e 's:VAR_SYS_BIN:/usr/bin:g' \ + -e "s:VAR_SYS_LIB:/usr/$(get_libdir):g" \ + -e "s:VAR_ITK:itk${itk_version}:g" \ + -e "s:VAR_ITCL:itcl${itcl_version}:g" \ + -e "s:VAR_TIX:tix${tix_version}:g" \ + -e "s:VAR_TK:tk${tk_version}:g" \ + -e "s:VAR_TCL:tcl${tcl_version}:g" env.sh 50${PN} \ + || die "Tweaking of the Tcl/Tk libraries location in env.sh and 50opencascade failed!" + + # Install the env.d variables file + doenvd 50${PN} + + cd "${S}"/../ || die + + if use examples; then + insinto /usr/share/doc/${PF}/examples + doins -r data + + insinto /usr/share/doc/${PF}/examples + doins -r samples + fi + + cd "${S}"/../doc || die + dodoc *.pdf + + # Install the documentation + if use doc; then + insinto /usr/share/doc/${PF} + doins -r {overview,ReferenceDocumentation} + fi +} + +pkg_postinst() { + einfo + elog "After upgrading OpenCASCADE you may have to rebuild packages depending on it." + elog "You get a list by running \"equery depends sci-libs/opencascade\"" + elog "revdep-rebuild does NOT suffice." + einfo +} |