Skip to content

Instantly share code, notes, and snippets.

@SippieCup
Created July 27, 2022 05:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SippieCup/e2398fba3e8519c411a93b1192ff24bf to your computer and use it in GitHub Desktop.
Save SippieCup/e2398fba3e8519c411a93b1192ff24bf to your computer and use it in GitHub Desktop.
# Maintainer: Salamandar <felix@piedallu.me>
pkgname=prusa-slicer-git
pkgver=2.6.0.alpha0.r149.g60cd7d456
pkgrel=1
pkgdesc='G-code generator for 3D printers (RepRap, Makerbot, Ultimaker etc.)'
arch=('i686' 'x86_64' 'armv6' 'armv6h' 'armv7h')
url='https://github.com/prusa3d/PrusaSlicer'
license=('AGPL3')
makedepends=(
'cmake'
'ninja'
'clang'
'boost'
'cereal'
'eigen'
'gtest'
'glew'
)
depends=(
'boost-libs'
'cgal'
'curl'
'dbus'
'intel-tbb'
'libpng'
'nlopt'
'openvdb'
'qhull'
)
_wxcommit=489f6118256853cf5b299d595868641938566cdb
source=(
"git+${url}"
"https://github.com/prusa3d/wxWidgets/archive/${_wxcommit}/wxWidgets-${_wxcommit}.tar.gz"
'prusa-slicer-boost-placeholders.patch'
)
sha256sums=(
'SKIP'
'b4f0f6aea13b779e87c227dd7a062a6c2af4cad2f4e92b1272e43e2d45eedf51'
'58cae07a418a797222f4cb10950fa2fd7afb7570519785b082cc7d7e7f407c02'
)
conflicts=('prusa-slicer')
pkgver() {
git -C "${srcdir}/PrusaSlicer" describe --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/^version_//'
}
prepare() {
cd "PrusaSlicer"
# Fix build with Boost 1.76.0
patch -p1 < "$srcdir/prusa-slicer-boost-placeholders.patch"
}
build() {
export CC=clang
export CXX=clang++
cmake -B deps -S wxWidgets-${_wxcommit} \
-DCMAKE_INSTALL_PREFIX="${srcdir}"/deps/destdir/usr/local \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DBUILD_SHARED_LIBS=ON \
-DwxBUILD_TOOLKIT=gtk3 \
-DwxUSE_MEDIACTRL=OFF \
-DwxUSE_DETECT_SM=OFF \
-DwxUSE_UNICODE=ON \
-DwxUSE_UNICODE_UTF8=ON \
-DwxUSE_OPENGL=ON \
-DwxUSE_LIBPNG=sys \
-DwxUSE_ZLIB=sys \
-DwxUSE_REGEX=builtin \
-DwxUSE_LIBJPEG=sys \
-DwxUSE_LIBTIFF=sys \
-DwxUSE_EXPAT=sys \
-DwxUSE_LIBLZMA=sys \
-DwxUSE_LIBSDL=OFF \
-DwxUSE_XTEST=OFF
cmake --build deps
cmake --install deps
cmake -B build -S PrusaSlicer -G Ninja \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib \
-DwxWidgets_CONFIG_EXECUTABLE="${srcdir}"/deps/wx-config \
-DOPENVDB_FIND_MODULE_PATH=/usr/lib/cmake/OpenVDB \
-DSLIC3R_FHS=ON \
-DSLIC3R_PCH=OFF \
-DSLIC3R_STATIC=ON \
-DSLIC3R_GTK=3 \
-DwxWidgets_USE_STATIC=ON
ninja -C build
}
check() {
cd "build"
ctest -V
}
package () {
DESTDIR="${pkgdir}" ninja -C "build" install
# Patch desktop files
for i in PrusaGcodeviewer PrusaSlicer; do
sed -i '/^Name=/ s/$/ (Git version)/' "${pkgdir}/usr/share/applications/$i.desktop"
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment