minor cleanups

This commit is contained in:
Greyson Christoforo 2020-12-05 11:34:05 +00:00
parent 5f28da53eb
commit 8e815abd19

View file

@ -55,22 +55,18 @@ pkgver() {
}
prepare() {
cd "${srcdir}/FreeCAD"
cd FreeCAD
# fix a build error
#curl -L "https://github.com/FreeCAD/FreeCAD/pull/2842/commits/095984fce44931a4c8e2ace269d45a62640fbfb4.patch" | patch -p1
}
build() {
# OpenCascade requires that /bin comes before /usr/bin in $PATH
export PATH="/usr/bin:$PATH"
# OpenCascade requires that /bin comes before /usr/bin in $PATH export PATH="/usr/bin:$PATH"
mkdir -p build
cd build
cmake -Wno-dev ../FreeCAD \
cmake -Wno-dev .. \
-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_C_FLAGS="${CFLAGS} -fPIC -w" \
-D CMAKE_CXX_FLAGS="${CXXFLAGS} -fPIC -w" \
-D CMAKE_INSTALL_DATADIR="/usr/share/freecad" \
-D CMAKE_INSTALL_DOCDIR="/usr/share/freecad/doc" \
-D CMAKE_INSTALL_PREFIX="/usr/lib/freecad" \
@ -79,38 +75,43 @@ build() {
-D FREECAD_USE_QT_FILEDIALOG=ON \
-D PYTHON_EXECUTABLE=/usr/bin/python \
-G Ninja
ninja
}
build() {
cd FreeCAD
ninja -C build
}
package() {
DESTDIR="$pkgdir" ninja -C build install
cd FreeCAD
DESTDIR="${pkgdir}" ninja -C build install
# Create desktop shortcut
gendesk -f -n --pkgname "$pkgname" --pkgdesc "$pkgdesc" --name FreeCAD \
gendesk -f -n --pkgname "${pkgname}" --pkgdesc "${pkgdesc}" --name FreeCAD \
--mimetypes='application/x-extension-fcstd' --startupnotify=true
# Package desktop shortcut
install -Dm644 freecad.desktop \
"$pkgdir/usr/share/applications/freecad.desktop"
"${pkgdir}/usr/share/applications/freecad.desktop"
# Package MIME info
#install -Dm644 freecad.xml "$pkgdir/usr/share/mime/packages/freecad.xml"
cd FreeCAD/src/Gui/Icons
cd src/Gui/Icons
# Package icons
for i in 16 32 48 64; do
install -Dm644 "freecad-icon-$i.png" \
"$pkgdir/usr/share/icons/hicolor/${i}x$i/apps/freecad.png"
"${pkgdir}/usr/share/icons/hicolor/${i}x$i/apps/freecad.png"
done
install -Dm644 freecad.svg \
"$pkgdir/usr/share/icons/hicolor/scalable/apps/freecad.svg"
"${pkgdir}/usr/share/icons/hicolor/scalable/apps/freecad.svg"
# Package symlinks in /usr/bin
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"
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"
}