Skip to content

Commit

Permalink
media-gfx/freecad: Update live ebuild
Browse files Browse the repository at this point in the history
Gentoo-bug: 569498

Package-Manager: Portage-2.3.3, Repoman-2.3.1
  • Loading branch information
SoapGentoo committed Jan 18, 2017
1 parent d06b720 commit 8617c76
Showing 1 changed file with 57 additions and 67 deletions.
124 changes: 57 additions & 67 deletions media-gfx/freecad/freecad-9999.ebuild
Original file line number Diff line number Diff line change
@@ -1,91 +1,95 @@
# Copyright 1999-2015 Gentoo Foundation
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=5
EAPI=6

PYTHON_COMPAT=( python2_7 )

inherit cmake-utils eutils git-r3 fortran-2 multilib python-single-r1 fdo-mime
inherit cmake-utils eutils fdo-mime fortran-2 python-single-r1

DESCRIPTION="QT based Computer Aided Design application"
HOMEPAGE="http://www.freecadweb.org/"
EGIT_REPO_URI="https://github.com/FreeCAD/FreeCAD.git"

if [[ ${PV} == *9999 ]]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/mdadams/jasper.git"
else
SRC_URI="https://github.com/FreeCAD/FreeCAD/archive/${PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~amd64 ~x86"
fi

LICENSE="GPL-2"
SLOT="0"
KEYWORDS=""

IUSE=""

COMMON_DEPEND=">dev-cpp/eigen-3.2.2:3
dev-libs/boost
#sci-libs/orocos_kdl waiting for Bug 604130 (keyword ~x86)
#dev-qt/qtgui:4[-egl] and dev-qt/qtopengl:4[-egl] : Bug 564978
#dev-python/pyside[svg] : Bug 591012
COMMON_DEPEND="
${PYTHON_DEPS}
dev-cpp/eigen:3
dev-java/xerces
dev-libs/boost:=[python,${PYTHON_USEDEP}]
dev-libs/xerces-c[icu]
dev-python/matplotlib
dev-python/pyside[X,svg]
dev-python/shiboken
dev-python/matplotlib[${PYTHON_USEDEP}]
dev-python/pyside[X,svg,${PYTHON_USEDEP}]
dev-python/shiboken[${PYTHON_USEDEP}]
dev-qt/designer:4
dev-qt/qtgui:4
dev-qt/qtopengl:4
dev-qt/qtgui:4[-egl]
dev-qt/qtopengl:4[-egl]
dev-qt/qtsvg:4
dev-qt/qtwebkit:4
media-libs/coin
|| ( sci-libs/opencascade:6.9.0[vtk] sci-libs/opencascade:6.8.0 sci-libs/opencascade:6.7.1 )
media-libs/freetype
|| ( sci-libs/opencascade:6.9.1[vtk] sci-libs/opencascade:6.9.0[vtk] sci-libs/opencascade:6.8.0 sci-libs/opencascade:6.7.1 )
sys-libs/zlib
virtual/glu
${PYTHON_DEPS}"
virtual/glu"
RDEPEND="${COMMON_DEPEND}
dev-qt/assistant:4
dev-python/pivy
dev-python/numpy"
dev-python/numpy[${PYTHON_USEDEP}]
dev-python/pivy[${PYTHON_USEDEP}]
dev-qt/assistant:4"
DEPEND="${COMMON_DEPEND}
dev-python/pyside-tools
>=dev-lang/swig-2.0.4-r1:0"
>=dev-lang/swig-2.0.4-r1:0
dev-python/pyside-tools[${PYTHON_USEDEP}]"

REQUIRED_USE="${PYTHON_REQUIRED_USE}"

# https://bugs.gentoo.org/show_bug.cgi?id=352435
# https://www.gentoo.org/foundation/en/minutes/2011/20110220_trustees.meeting_log.txt
RESTRICT="bindist mirror"
RESTRICT="mirror"

# TODO:
# DEPEND and RDEPEND:
# salome-smesh - science overlay
# zipio++ - not in portage yet

S="${WORKDIR}/FreeCAD-${PV}"

DOCS=( README.md ChangeLog.txt )

pkg_setup() {
fortran-2_pkg_setup
python-single-r1_pkg_setup

[ -z "${CASROOT}" ] && die "empty \$CASROOT, run eselect opencascade set or define otherwise"
}

src_prepare() {
einfo remove bundled libs
rm -rf src/3rdParty/{boost,Pivy*}

epatch "${FILESDIR}"/${PN}-0.14.3702-install-paths.patch

#bug 518996
sed -e "/LibDir = /s:'lib':'"$(get_libdir)"':g" \
-i src/App/FreeCADInit.py || die

[[ -z ${CASROOT} ]] && die "empty \$CASROOT, run eselect opencascade set or define otherwise"
}

src_configure() {
export QT_SELECT=4

#-DOCC_* defined with cMake/FindOpenCasCade.cmake
#-DCOIN3D_* defined with cMake/FindCoin3D.cmake
#-DSOQT_ not used
#-DFREECAD_USE_EXTERNAL_KDL="ON" waiting for Bug 604130 (keyword ~x86)
local mycmakeargs=(
-DOCC_INCLUDE_DIR="${CASROOT}"/inc
-DOCC_INCLUDE_PATH="${CASROOT}"/inc
-DOCC_LIBRARY="${CASROOT}"/lib/libTKernel.so
-DOCC_LIBRARY_DIR="${CASROOT}"/lib
-DOCC_LIB_PATH="${CASROOT}"/lib
-DCOIN3D_INCLUDE_DIRS="${EROOT}"usr/include/coin
-DCOIN3D_LIBRARY="${EROOT}"usr/$(get_libdir)/libCoin.so
-DSOQT_LIBRARY="${EROOT}"usr/$(get_libdir)/libSoQt.so
-DSOQT_INCLUDE_PATH="${EROOT}"usr/include/coin
-DCMAKE_INSTALL_PREFIX="${EROOT}"usr/$(get_libdir)/${P}
-DCMAKE_INSTALL_DATADIR="${EROOT}"usr/share/${P}/
-DCMAKE_INSTALL_DOCDIR="${EROOT}"usr/share/doc/${P}/
-DCMAKE_INSTALL_INCLUDEDIR="${EROOT}"usr/include/${P}/
-DFREECAD_USE_EXTERNAL_PIVY="ON"
-DFREECAD_BUILD_FEM="OFF"
-DOCC_LIBRARY_DIR="${CASROOT}"/$(get_libdir)
-DCMAKE_INSTALL_DATADIR=share/${P}
-DCMAKE_INSTALL_DOCDIR=share/doc/${PF}
-DCMAKE_INSTALL_INCLUDEDIR=include/${P}
-DFREECAD_USE_EXTERNAL_KDL="OFF"
)

# TODO to remove embedded dependencies:
Expand All @@ -96,43 +100,29 @@ src_configure() {
# (external salomesmesh is available in "science" overlay)

cmake-utils_src_configure
ewarn "${P} will be built against opencascade version ${CASROOT}"
einfo "${P} will be built against opencascade version ${CASROOT}"
}

src_install() {
cmake-utils_src_install

prune_libtool_files

make_wrapper FreeCAD \
"${EROOT}"usr/$(get_libdir)/${P}/bin/FreeCAD \
"" "${EROOT}"usr/$(get_libdir)/${P}/lib
make_wrapper FreeCADCmd \
"${EROOT}"usr/$(get_libdir)/${P}/bin/FreeCADCmd \
"" "${EROOT}"usr/$(get_libdir)/${P}/lib

make_desktop_entry FreeCAD "FreeCAD" "" "" "MimeType=application/x-extension-fcstd;"

dodoc README.md ChangeLog.txt

# install mimetype for FreeCAD files
insinto /usr/share/mime/packages
newins "${FILESDIR}"/${PN}.sharedmimeinfo "${PN}.xml"

# install icons to correct place rather than /usr/share/freecad
pushd "${ED}/usr/share/${P}"
pushd "${ED%/}"/usr/share/${P} || die
local size
for size in 16 32 48 64; do
newicon -s ${size} freecad-icon-${size}.png freecad.png
done
doicon -s scalable freecad.svg
newicon -s 64 -c mimetypes freecad-doc.png application-x-extension-fcstd.png
popd

# disable compression of QT assistant help files
>> "${ED}"usr/share/doc/${P}/freecad.qhc.ecompress.skip
>> "${ED}"usr/share/doc/${P}/freecad.qch.ecompress.skip
popd || die

python_optimize "${ED}"usr/{$(get_libdir),share}/${P}/Mod/
python_optimize "${ED%/}"/usr/{,share/${P}/}Mod/
}

pkg_postinst() {
Expand Down

0 comments on commit 8617c76

Please sign in to comment.