orca-slicer/PKGBUILD
2025-03-24 14:33:54 +01:00

62 lines
2.2 KiB
Bash

# Maintainer: lod <aur@cyber-anlage.de>
pkgname=orca-slicer
pkgver=2.3.0
pkgrel=1
pkgdesc="G-code generator for 3D printers (Bambu, Prusa, Voron, VzBot, RatRig, Creality, etc.) "
arch=('x86_64')
url="https://github.com/SoftFever/OrcaSlicer"
license=('AGPL-3.0-only')
depends=('cairo' 'dbus' 'expat' 'fontconfig' 'gcc-libs' 'gdk-pixbuf2' 'glib2' 'glibc'
'gst-plugins-base-libs' 'gstreamer' 'gtk3' 'hicolor-icon-theme' 'libglvnd' 'libjpeg-turbo'
'libspnav' 'libtiff' 'libx11' 'pango' 'python' 'wayland' 'webkit2gtk-4.1' 'zlib')
makedepends=('cmake' 'extra-cmake-modules' 'git' 'glew' 'm4' 'ninja' 'pkgconf' 'wayland-protocols')
options=('!debug' '!emptydirs')
provides=("orca-slicer")
source=("$pkgname::git+https://github.com/SoftFever/OrcaSlicer.git#tag=v$pkgver")
b2sums=('543653c5769e2f022877608c14bad64ea05dbc30d41a58dc1a82eaca6615c0183f7573ced790a263b8509f6a4abdfa6b259ae0701a2468e10c15eb40d1926555')
prepare() {
cd $pkgname
# C++20 disallows the use of the Point<T> syntax in the constructor
sed -i 's/explicit Point<T>(/explicit Point(/' src/clipper2/Clipper2Lib/include/clipper2/clipper.core.h
# abuse FLATPAK IF statement to build against some system libs
sed -i 's/if(FLATPAK)/if(true)/' deps/CMakeLists.txt
# System Freetype has some breaking changes
sed -i 's/find_package(Freetype)/# find_package(Freetype)/' deps/CMakeLists.txt
sed -i 's|https://www.mpfr.org/mpfr-current/mpfr-4.2.1.tar.bz2|https://www.mpfr.org/mpfr-4.2.1/mpfr-4.2.1.tar.bz2|' deps/MPFR/MPFR.cmake
}
build() {
cd $pkgname
export CXXFLAGS="${CXXFLAGS} -flto"
cmake \
-G Ninja \
-S deps \
-B deps/build \
-DDEP_WX_GTK3=ON
ninja -C deps/build
cmake \
-G Ninja \
-S . \
-B build \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_FULL_DATAROOTDIR=/usr/share/ \
-DCMAKE_PREFIX_PATH="$srcdir/$pkgname/deps/build/destdir/usr/local" \
-DSLIC3R_STATIC=1 \
-DORCA_TOOLS=1 \
-DSLIC3R_FHS=1 \
-DSLIC3R_GTK=3
ninja -C build
./run_gettext.sh
}
package() {
cd $pkgname
DESTDIR="$pkgdir" ninja -C build install
install -Dm644 doc/*.md -t "$pkgdir/usr/share/doc/OrcaSlicer/"
install -Dm644 LICENSE.txt "$pkgdir/usr/share/licenses/OrcaSlicer/LICENSE"
rm -rf "$pkgdir/usr/LICENSE.txt"
}