freecad/PKGBUILD

88 lines
3.2 KiB
Text
Raw Normal View History

2018-10-18 01:03:07 +02:00
# Maintainer: Grey Christoforo <first name at last name dot net>
2019-04-03 19:14:00 +02:00
# Maintainer: Sebastiaan Lokhorst <sebastiaanlokhorst@gmail.com>
2017-03-29 14:32:08 +02:00
_appname=freecad
pkgname="${_appname}-git"
2019-06-22 23:03:37 +02:00
pkgver=0.19pre.r633.g063582241
2019-04-03 19:14:00 +02:00
pkgrel=1
2016-09-22 14:53:49 +02:00
epoch=1
pkgdesc='A general purpose 3D CAD modeler - git checkout'
2019-03-15 20:13:11 +01:00
arch=('x86_64')
url='https://www.freecadweb.org/'
license=('LGPL')
2019-04-03 19:14:00 +02:00
depends=('boost-libs' 'curl' 'desktop-file-utils' 'glew' 'hicolor-icon-theme'
'jsoncpp' 'libspnav' 'med' 'opencascade' 'shiboken2' 'xerces-c'
'pyside2' 'python-matplotlib' 'python-netcdf4' 'python-pivy'
'qt5-svg' 'qt5-webkit' 'qt5-webengine')
makedepends=('boost' 'cmake' 'eigen' 'git' 'gcc-fortran'
'pyside2-tools' 'swig' 'qt5-tools')
optdepends=('pycollada: Create, edit and load COLLADA documents.')
provides=('freecad')
conflicts=('freecad')
2017-03-30 22:21:50 +02:00
source=("${pkgname}::git+https://github.com/FreeCAD/FreeCAD.git"
2016-09-22 14:53:49 +02:00
"freecad.desktop"
2019-04-03 19:14:00 +02:00
"freecad.xml")
2016-09-22 14:53:49 +02:00
md5sums=('SKIP'
2019-06-22 23:03:37 +02:00
'9e958fe0b5267a8eae2433731b949a24'
2017-06-01 11:23:35 +02:00
'c2f4154c8e4678825411de8e7fa54c6b')
pkgver() {
2017-03-30 22:21:50 +02:00
cd "${srcdir}/${pkgname}"
2017-03-29 14:32:08 +02:00
git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/_//'
}
build() {
2017-03-30 22:21:50 +02:00
cd "${srcdir}/${pkgname}"
PYVER="$(/usr/bin/python3 -c 'import sys; print("{}.{}".format(sys.version_info.major,sys.version_info.minor))')"
2019-03-15 20:13:11 +01:00
cmake . \
2019-04-03 19:14:00 +02:00
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="/usr/lib/freecad" \
-DCMAKE_INSTALL_DOCDIR="/usr/share/freecad/doc" \
-DCMAKE_INSTALL_DATADIR="/usr/share/freecad" \
-DFREECAD_USE_OCC_VARIANT="Official Version" \
-DBUILD_QT5=ON \
-DPYTHON_EXECUTABLE=/usr/bin/python3 \
-DOPENMPI_INCLUDE_DIRS=/usr/include \
-DSHIBOKEN_INCLUDE_DIR=/usr/include/shiboken2 \
-DSHIBOKEN_BINARY=/usr/bin/shiboken2 \
-DSHIBOKEN_LIBRARY="/usr/lib/libshiboken2.cpython-${PYVER//.}m-x86_64-linux-gnu.so" \
2019-04-03 19:14:00 +02:00
-DPYSIDE_INCLUDE_DIR=/usr/include/PySide2 \
-DPYSIDE_LIBRARY="/usr/lib/libpyside2.cpython-${PYVER//.}m-x86_64-linux-gnu.so" \
-DPYSIDE_PYTHONPATH="/usr/lib/python${PYVER}/site-packages/PySide2" \
2019-04-03 19:14:00 +02:00
-DPYSIDE_TYPESYSTEMS=/usr/share/PySide2/typesystems
2017-03-29 14:32:08 +02:00
make
}
package() {
2017-03-30 22:21:50 +02:00
cd "${srcdir}/${pkgname}"
2017-03-29 14:32:08 +02:00
local bin="FreeCAD"
local bin_cmd="FreeCADCmd"
2017-03-30 22:21:50 +02:00
make DESTDIR="${pkgdir}" install
2019-04-03 19:14:00 +02:00
2017-03-29 14:32:08 +02:00
# Symlink binaries to /usr/bin.
2017-03-30 22:21:50 +02:00
mkdir -p "${pkgdir}/usr/bin"
2019-04-03 19:14:00 +02:00
ln -s "/usr/lib/freecad/bin/${bin}" "${pkgdir}/usr/bin/${bin}"
ln -s "/usr/lib/freecad/bin/${bin_cmd}" "${pkgdir}/usr/bin/${bin_cmd}"
# Lowercase aliases for convenience.
2017-03-30 22:21:50 +02:00
ln -s "/usr/bin/${bin}" "${pkgdir}/usr/bin/${bin,,}"
ln -s "/usr/bin/${bin_cmd}" "${pkgdir}/usr/bin/${bin_cmd,,}"
2017-03-29 14:32:08 +02:00
# Install pixmaps and desktop shortcut.
for i in 16 32 48 64; do
install -Dm644 "src/Gui/Icons/freecad-icon-${i}.png" \
2017-03-30 22:21:50 +02:00
"${pkgdir}/usr/share/icons/hicolor/${i}x${i}/apps/${_appname}.png"
2017-03-29 14:32:08 +02:00
done
install -Dm644 "src/Gui/Icons/freecad.svg" \
2017-03-30 22:21:50 +02:00
"${pkgdir}/usr/share/icons/hicolor/scalable/apps/${_appname}.svg"
2017-03-29 14:32:08 +02:00
desktop-file-install \
2017-03-30 22:21:50 +02:00
--dir="${pkgdir}/usr/share/applications" "${srcdir}/${_appname}.desktop"
2017-03-29 14:32:08 +02:00
# Install mime info.
2017-03-30 22:21:50 +02:00
install -D -m644 "${srcdir}/${_appname}.xml" \
"${pkgdir}/usr/share/mime/packages/${_appname}.xml"
}