PKGBUILDs/extra/freecad/PKGBUILD
2023-11-20 14:01:46 +00:00

83 lines
2.9 KiB
Bash

# Maintainer: Alexander F. Rødseth <xyproto@archlinux.org>
# Contributor: loqs <bugs-archlinux@entropy-collector.net>
# Contributor: Gabriel Souza Franco <gabrielfrancosouza@gmail.com>
# Contributor: Florian Pritz
# Contributor: Jonas Heinrich <onny@project-insanity.org>
# Contributor: Jordi De Groof <jordi.degroof@gmail.com>
# Contributor: mickele
# Contributor: manwithgrenade
# Contributor: bricem13
# Contributor: gborzi
# Contributor: Adrian Insaurralde
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - remove makedepends on ospray
buildarch=8
highmem=1
pkgname=freecad
pkgver=0.21.1
pkgrel=6
pkgdesc='Feature based parametric 3D CAD modeler'
arch=(x86_64)
url='https://freecadweb.org/'
license=(LGPL)
depends=(boost-libs coin fmt glew jsoncpp libspnav med-openmpi netcdf
opencascade openmpi pugixml pyside2 pyside2-tools python-gitpython
python-markdown python-matplotlib python-pip python-pivy python-ply
python-yaml qt5-svg qt5-tools qt5-webengine qt5-x11extras
qt5-xmlpatterns xerces-c verdict)
makedepends=(boost cgns cmake eigen git libharu liblas ninja openvdb openvr
pdal postgresql-libs python-mpi4py python-shiboken2
qt5-webengine shiboken2 swig utf8cpp nlohmann-json)
optdepends=('graphviz: dependency graph support'
'openscad: OpenSCAD support')
source=("git+https://github.com/$pkgname/$pkgname#commit=f6708547a9bb3f71a4aaade12109f511a72c207c"
freecad-vtk9.3.patch) # tag: 0.21.1
b2sums=('SKIP'
'709e6321a45b050187a6c5447b4381a5e9958687a1a5f25d0418f63e85f52e040fdf37fb1aa1d2886e06edb1b5b4cce847cf4865d4e6396fdfb4839557657f53')
prepare() {
patch -d freecad -Np1 -i "$srcdir"/freecad-vtk9.3.patch
}
build() {
cmake \
-B build \
-D BUILD_ENABLE_CXX_STD=C++17 \
-D BUILD_FLAT_MESH=ON \
-D BUILD_QT5=ON \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_C_FLAGS="$CFLAGS -fPIC -w" \
-D CMAKE_CXX_FLAGS="$CXXFLAGS -fPIC -w" \
-D CMAKE_INSTALL_BINDIR=/usr/lib/freecad/bin \
-D CMAKE_INSTALL_DATADIR=/usr/share/freecad \
-D CMAKE_INSTALL_DATAROOTDIR=/usr/share \
-D CMAKE_INSTALL_DOCDIR=/usr/share/freecad/doc \
-D CMAKE_INSTALL_LIBDIR=/usr/lib/freecad/lib \
-D CMAKE_INSTALL_PREFIX=/usr/lib/freecad \
-D FREECAD_USE_EXTERNAL_PIVY=ON \
-D FREECAD_USE_OCC_VARIANT='Official Version' \
-D FREECAD_USE_QT_FILEDIALOG=ON \
-D PYTHON_EXECUTABLE=/usr/bin/python \
-D INSTALL_TO_SITEPACKAGES=ON \
-G Ninja \
-S $pkgname \
-W no-dev
ninja -C build
}
package() {
DESTDIR="$pkgdir" ninja -C build install
# thumbnailer
install -Dm755 $pkgname/src/Tools/$pkgname-thumbnailer -t "$pkgdir/usr/bin/"
# symlinks
install -d "$pkgdir/usr/bin"
ln -sf /usr/lib/freecad/bin/FreeCAD "$pkgdir/usr/bin/freecad"
ln -sf /usr/lib/freecad/bin/FreeCAD "$pkgdir/usr/bin/FreeCAD"
ln -sf /usr/lib/freecad/bin/FreeCADCmd "$pkgdir/usr/bin/freecadcmd"
ln -sf /usr/lib/freecad/bin/FreeCADCmd "$pkgdir/usr/bin/FreeCADCmd"
}