Use PKGBUILD from freecad-netgen-git

This commit is contained in:
Markus Hovorka 2016-09-22 14:53:49 +02:00
parent 81dafe1f73
commit f02d6beca1
3 changed files with 97 additions and 70 deletions

View file

@ -1,7 +1,8 @@
pkgbase = freecad-git
pkgdesc = A general purpose 3D CAD modeler - git checkout
pkgver = 0.16.pre.r3.g192dca3
pkgver = 0.17pre.r1771.gf944ab3
pkgrel = 1
epoch = 1
url = http://www.freecadweb.org/
install = freecad.install
arch = i686
@ -9,35 +10,42 @@ pkgbase = freecad-git
license = LGPL
makedepends = git
makedepends = boost
makedepends = eigen
makedepends = gcc-fortran
makedepends = swig
makedepends = desktop-file-utils
makedepends = cmake
makedepends = coin
makedepends = python2-pyside-tools
makedepends = desktop-file-utils
makedepends = eigen
makedepends = gcc-fortran
makedepends = swig
makedepends = patch
depends = boost-libs
depends = curl
depends = opencascade>=6.6.0
depends = python2-pivy
depends = xerces-c
depends = libspnav
depends = shared-mime-info
depends = hicolor-icon-theme
depends = python2-matplotlib
depends = python2-shiboken
depends = libspnav
depends = opencascade
depends = med
depends = xerces-c
depends = python2-pivy
depends = python2-pyside
depends = qtwebkit
optdepends = freecad-dxf: import DXF files
optdepends = pycollada-git: create, edit and load COLLADA documents
depends = libtheora
depends = shared-mime-info
depends = vtk-qt4
depends = jsoncpp
optdepends = python2-matplotlib
optdepends = pycollada-git: Create, edit and load COLLADA documents.
provides = freecad
conflicts = freecad
source = freecad::git://github.com/FreeCAD/FreeCAD
source = freecad-git::git+https://github.com/FreeCAD/FreeCAD.git
source = freecad.install
source = freecad.desktop
source = freecad.xml
sha256sums = SKIP
sha256sums = 886688f1f3624fafe92710890bda7504d1e0181c2c5239b313066eb412a78e0f
sha256sums = 248918de7d3c2145b5cc4fbbc9e224d22f4a6ca7ead2680e8c3a32e91772482a
source = fem-rpath.patch
md5sums = SKIP
md5sums = 2fad48203f96f1e7cb97934ea20ed848
md5sums = 0a4d0635dbd97d9f594ac8e927284316
md5sums = c2f4154c8e4678825411de8e7fa54c6b
md5sums = 99a41687a9ba980eea86aee4345d9a1d
pkgname = freecad-git

View file

@ -1,82 +1,78 @@
# Maintainer: Christian Hesse <mail@eworm.de>
# Maintainer: Markus Hovorka <m.hovorka@live.de>
# Contributer: Christian Hesse <mail@eworm.de>
pkgname=freecad-git
pkgver=0.16.pre.r3.g192dca3
pkgver=0.17pre.r1771.gf944ab3
pkgrel=1
epoch=1
pkgdesc='A general purpose 3D CAD modeler - git checkout'
arch=('i686' 'x86_64')
url='http://www.freecadweb.org/'
license=('LGPL')
depends=('boost-libs' 'curl' 'opencascade>=6.6.0' 'python2-pivy' 'xerces-c'
'libspnav' 'shared-mime-info' 'hicolor-icon-theme'
'python2-matplotlib' 'python2-shiboken' 'python2-pyside' 'qtwebkit')
makedepends=('git' 'boost' 'eigen' 'gcc-fortran' 'swig' 'desktop-file-utils'
'cmake' 'coin' 'python2-pyside-tools')
optdepends=('freecad-dxf: import DXF files'
'pycollada-git: create, edit and load COLLADA documents')
depends=('boost-libs' 'curl' 'hicolor-icon-theme' 'libspnav' 'opencascade'
'med' 'xerces-c' 'python2-pivy' 'python2-pyside' 'qtwebkit'
'libtheora' 'shared-mime-info' 'vtk-qt4' 'jsoncpp')
makedepends=('git' 'boost' 'cmake' 'coin' 'python2-pyside-tools'
'desktop-file-utils' 'eigen' 'gcc-fortran' 'swig' 'patch')
optdepends=('python2-matplotlib'
'pycollada-git: Create, edit and load COLLADA documents.')
provides=('freecad')
conflicts=('freecad')
install=freecad.install
source=('freecad::git://github.com/FreeCAD/FreeCAD'
'freecad.desktop'
'freecad.xml')
sha256sums=('SKIP'
'886688f1f3624fafe92710890bda7504d1e0181c2c5239b313066eb412a78e0f'
'248918de7d3c2145b5cc4fbbc9e224d22f4a6ca7ead2680e8c3a32e91772482a')
source=("$pkgname::git+https://github.com/FreeCAD/FreeCAD.git"
"freecad.install"
"freecad.desktop"
"freecad.xml"
"fem-rpath.patch")
md5sums=('SKIP'
'2fad48203f96f1e7cb97934ea20ed848'
'0a4d0635dbd97d9f594ac8e927284316'
'c2f4154c8e4678825411de8e7fa54c6b'
'99a41687a9ba980eea86aee4345d9a1d')
pkgver() {
cd freecad/
if GITTAG="$(git describe --abbrev=0 --tags 2>/dev/null)"; then
echo "$(sed -e "s/^${pkgname%%-git}//" -e 's/^[-_/a-zA-Z]\+//' -e 's/[-_+]/./g' <<< ${GITTAG}).r$(git rev-list --count ${GITTAG}..).g$(git log -1 --format="%h")"
else
echo "0.r$(git rev-list --count master).g$(git log -1 --format="%h")"
fi
cd "$pkgname"
git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/_//'
}
prepare() {
sed -i \
-e "46i\\\tModDir = '/usr/share/freecad/Mod'" \
-e "50i\\\tLibDir = '/usr/lib/freecad'" \
"${srcdir}/freecad/src/App/FreeCADInit.py"
cd "$srcdir/$pkgname"
patch -p1 -i "$srcdir/fem-rpath.patch"
}
build() {
cd freecad/
mkdir -p build
cd build
cd "$srcdir/$pkgname"
cmake .. \
-DCMAKE_INSTALL_PREFIX:PATH="/usr" \
-DCMAKE_INSTALL_DOCDIR:PATH="share/freecad/doc" \
-DCMAKE_INSTALL_DATADIR:PATH="share/freecad" \
-DCMAKE_INSTALL_LIBDIR:PATH="lib/freecad" \
-DOCC_INCLUDE_DIR:PATH=/opt/opencascade/inc/ \
-DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python2 \
-DPYSIDEUIC4BINARY:FILEPATH=/usr/bin/python2-pyside-uic \
-DFREECAD_USE_EXTERNAL_PIVY:BOOL=ON
cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX:PATH="/opt/freecad" \
-DOCC_INCLUDE_DIR:PATH=/opt/opencascade/inc \
-DOCC_LIBRARY_DIR:PATH=/opt/opencascade/lib \
-DVTK_DIR:PATH=/opt/vtk-qt4/lib/cmake/vtk-7.0 \
-DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python2 \
-DPYSIDEUIC4BINARY:FILEPATH=/usr/bin/python2-pyside-uic
make
}
package() {
cd freecad/build/
cd "$srcdir/$pkgname"
make DESTDIR="${pkgdir}" install
make DESTDIR="$pkgdir" install
# Symlink to /usr/bin
ln -sf "FreeCAD" "${pkgdir}/usr/bin/freecad"
ln -sf "FreeCADCmd" "${pkgdir}/usr/bin/freecadcmd"
# Symlink binaries to /usr/bin.
mkdir -p "$pkgdir/usr/bin"
ln -s "/opt/freecad/bin/FreeCAD" "$pkgdir/usr/bin/FreeCAD"
ln -s "/opt/freecad/bin/FreeCADCmd" "$pkgdir/usr/bin/FreeCADCmd"
cp -ra "${pkgdir}/usr/Mod" "${pkgdir}/usr/share/freecad/"
rm -r "${pkgdir}/usr/Mod"
# Lowercase aliases like the official arch package.
ln -s "/opt/freecad/bin/FreeCAD" "$pkgdir/usr/bin/freecad"
ln -s "/opt/freecad/bin/FreeCADCmd" "$pkgdir/usr/bin/freecadcmd"
# Install pixmaps and desktop shortcut
# Install pixmaps and desktop shortcut.
desktop-file-install \
--dir="${pkgdir}/usr/share/applications" \
"${srcdir}/freecad.desktop"
--dir="$pkgdir/usr/share/applications" "$srcdir/freecad.desktop"
# Mime info
install -D -m644 "${srcdir}/freecad.xml" "${pkgdir}/usr/share/mime/packages/freecad.xml"
# Install mime info.
install -D -m644 "$srcdir/freecad.xml" \
"$pkgdir/usr/share/mime/packages/freecad.xml"
}

23
fem-rpath.patch Normal file
View file

@ -0,0 +1,23 @@
diff --git a/src/Mod/Fem/App/CMakeLists.txt b/src/Mod/Fem/App/CMakeLists.txt
index fd57fa0..3c649d4 100755
--- a/src/Mod/Fem/App/CMakeLists.txt
+++ b/src/Mod/Fem/App/CMakeLists.txt
@@ -263,5 +263,7 @@ fc_target_copy_resource(Fem
SET_BIN_DIR(Fem Fem /Mod/Fem)
SET_PYTHON_PREFIX_SUFFIX(Fem)
+set_property(TARGET Fem APPEND PROPERTY INSTALL_RPATH "/opt/vtk-qt4/lib")
+
INSTALL(TARGETS Fem DESTINATION ${CMAKE_INSTALL_LIBDIR})
diff --git a/src/Mod/Fem/Gui/CMakeLists.txt b/src/Mod/Fem/Gui/CMakeLists.txt
index cec8d78..b3a7c48 100755
--- a/src/Mod/Fem/Gui/CMakeLists.txt
+++ b/src/Mod/Fem/Gui/CMakeLists.txt
@@ -344,5 +344,6 @@ INSTALL(FILES ${FemGuiIcon_SVG} DESTINATION "${CMAKE_INSTALL_DATADIR}/Mod/Fem/Re
SET_BIN_DIR(FemGui FemGui /Mod/Fem)
SET_PYTHON_PREFIX_SUFFIX(FemGui)
+set_property(TARGET FemGui APPEND PROPERTY INSTALL_RPATH "/opt/vtk-qt4/lib")
INSTALL(TARGETS FemGui DESTINATION ${CMAKE_INSTALL_LIBDIR})