fix all the stupid paths

This commit is contained in:
Grey Christoforo 2021-05-09 15:07:41 +02:00
parent 1d49449a21
commit f5c1724981
3 changed files with 36 additions and 22 deletions

View file

@ -1,6 +1,6 @@
pkgbase = freecad-git pkgbase = freecad-git
pkgdesc = A general purpose 3D CAD modeler - git checkout pkgdesc = A general purpose 3D CAD modeler - git checkout
pkgver = 0.19.r581.g20e756306d pkgver = 0.19.r582.g0cfea3fee3
pkgrel = 1 pkgrel = 1
epoch = 0 epoch = 0
url = https://www.freecadweb.org/ url = https://www.freecadweb.org/

1
.gitignore vendored
View file

@ -3,3 +3,4 @@ pkg/
FreeCAD/ FreeCAD/
*.tar.xz *.tar.xz
*.tar.gz *.tar.gz
*.tar.zst

View file

@ -1,7 +1,7 @@
# Maintainer: Grey Christoforo <first name at last name dot net> # Maintainer: Grey Christoforo <first name at last name dot net>
pkgname=freecad-git pkgname=freecad-git
pkgver=0.19.r581.g20e756306d pkgver=0.19.r582.g0cfea3fee3
pkgrel=1 pkgrel=1
epoch=0 epoch=0
pkgdesc='A general purpose 3D CAD modeler - git checkout' pkgdesc='A general purpose 3D CAD modeler - git checkout'
@ -64,17 +64,16 @@ pkgver() {
prepare() { prepare() {
cd FreeCAD cd FreeCAD
# add support for vtk version 9
curl https://github.com/wwmayer/FreeCAD/commit/52599f771fa934ceeb11a970c3639bfa8f90411e.patch | patch -p1 --forward || true
#git revert --no-commit 663ac994a794606e56d086cac85598517bd323dc #git revert --no-commit 663ac994a794606e56d086cac85598517bd323dc
#git checkout 927fdc9edc #git checkout 927fdc9edc
} }
_destdir="/usr"
build() { build() {
cd FreeCAD cd FreeCAD
cmake -Wno-dev \ cmake -Wno-dev -G Ninja -B build_dir -S . \
-D BUILD_ENABLE_CXX_STD=C++14 \ -D BUILD_ENABLE_CXX_STD=C++14 \
-D BUILD_QT5=ON \ -D BUILD_QT5=ON \
-D BUILD_FEM=ON \ -D BUILD_FEM=ON \
@ -82,8 +81,8 @@ build() {
-D BUILD_MESH_PART=ON \ -D BUILD_MESH_PART=ON \
-D BUILD_SHIP=ON \ -D BUILD_SHIP=ON \
-D BUILD_ASSEMBLY=OFF \ -D BUILD_ASSEMBLY=OFF \
-D BUILD_COMPLETE=ON \
-D BUILD_PLOT=ON \ -D BUILD_PLOT=ON \
-D CMAKE_INSTALL_PREFIX="" \
-D CMAKE_BUILD_TYPE=None \ -D CMAKE_BUILD_TYPE=None \
-D CMAKE_C_FLAGS="${CFLAGS} -fPIC -w" \ -D CMAKE_C_FLAGS="${CFLAGS} -fPIC -w" \
-D CMAKE_CXX_FLAGS="${CXXFLAGS} -fPIC -w" \ -D CMAKE_CXX_FLAGS="${CXXFLAGS} -fPIC -w" \
@ -91,9 +90,13 @@ build() {
-D FREECAD_USE_OCC_VARIANT="Official Version" \ -D FREECAD_USE_OCC_VARIANT="Official Version" \
-D FREECAD_USE_QT_FILEDIALOG=ON \ -D FREECAD_USE_QT_FILEDIALOG=ON \
-D PYTHON_EXECUTABLE=/usr/bin/python \ -D PYTHON_EXECUTABLE=/usr/bin/python \
-G Ninja \ -D INSTALL_TO_SITEPACKAGES=ON \
-B build_dir \ -D CMAKE_INSTALL_PREFIX="${_destdir}/lib/freecad" \
-S . -D CMAKE_INSTALL_BINDIR=bin \
-D CMAKE_INSTALL_LIBDIR='../../lib' \
-D CMAKE_INSTALL_DATADIR='../../share/freecad' \
-D CMAKE_INSTALL_DATAROOTDIR='../../share' \
-D CMAKE_INSTALL_DOCDIR='../../share/doc/freecad'
cmake --build build_dir cmake --build build_dir
} }
@ -102,7 +105,10 @@ check() {
cd FreeCAD cd FreeCAD
DESTDIR=check cmake --build build_dir -- install DESTDIR=check cmake --build build_dir -- install
cd build_dir/check cd "build_dir/check/${_destdir}"
mkdir -p bin
ln -sf "../lib/freecad/bin/FreeCADCmd" bin/FreeCADCmd
export PATH_TO_FREECAD_LIBDIR="$(pwd)/lib"
export LD_LIBRARY_PATH="$(pwd)/lib" export LD_LIBRARY_PATH="$(pwd)/lib"
export PYTHONPATH="$(pwd)/lib" export PYTHONPATH="$(pwd)/lib"
bin/FreeCADCmd --console --run-test 0 bin/FreeCADCmd --console --run-test 0
@ -110,25 +116,32 @@ check() {
package() { package() {
cd FreeCAD cd FreeCAD
local _destdir=/usr # maybe this belongs in /opt/freecad-git DESTDIR="${pkgdir}" cmake --build build_dir -- install
DESTDIR="${pkgdir}${_destdir}" cmake --build build_dir -- install
# fix some bad install locations # get python site package folder in the right place
mkdir -p "${pkgdir}${_destdir}"/share/freecad cp -a "${pkgdir}${_destdir}"/lib/freecad/lib "${pkgdir}${_destdir}"
mv "${pkgdir}${_destdir}"/share/{examples,Mod,Gui} "${pkgdir}${_destdir}"/share/freecad rm -rf "${pkgdir}${_destdir}"/lib/freecad/lib
# fix Ext & Mod locations # link all the .sos into python site package dir
mkdir -p "${pkgdir}${_destdir}"/lib/freecad python_site_packages="$(python -c 'import sys; print(sys.path[-1])')"
mv "${pkgdir}${_destdir}"/{Ext,Mod,bin} "${pkgdir}${_destdir}"/lib/freecad mkdir -p "${pkgdir}/${python_site_packages}"
FILES="${pkgdir}${_destdir}"/lib/*.so
for f in $FILES
do
ln -s ${_destdir}/lib/$(basename $f) "${pkgdir}/${python_site_packages}/$(basename $f)"
done
# links for bin # links for bin
mkdir -p "${pkgdir}${_destdir}"/bin mkdir -p "${pkgdir}${_destdir}"/bin
FILES="${pkgdir}${_destdir}"/lib/freecad/bin/* FILES="${pkgdir}${_destdir}"/lib/freecad/bin/*
for f in $FILES for f in $FILES
do do
ln -s ${_destdir}/lib/freecad/bin/$(basename $f) "${pkgdir}${_destdir}"/bin/$(basename $f) ln -s '../lib/freecad/bin/'$(basename $f) "${pkgdir}${_destdir}"/bin/$(basename $f)
done done
install -Dt "${pkgdir}/usr/share/licenses/${pkgname}" -m644 "${pkgdir}${_destdir}"/share/License.txt # env var for __init__.py
install -Dt "${pkgdir}/usr/share/licenses/${pkgname}" -m644 LICENSE mkdir -p "${pkgdir}"/etc/profile.d
echo "export PATH_TO_FREECAD_LIBDIR=${_destdir}/lib" > "${pkgdir}"/etc/profile.d/freecad.sh
install -Dt "${pkgdir}${_destdir}/share/licenses/${pkgname}" -m644 LICENSE
} }