archrelease: copy trunk to community-any
[ArchLinux/community.git] / superslicer / repos / community-x86_64 / PKGBUILD
blobd6ea54d4959165bd31eb0687806d010b9eaf4657
1 # Maintainer: Maxime Gauduin <alucryd@archlinux.org>
2 # Contributor: Lukas1818 <aur@lukas1818.de>
4 pkgname=superslicer
5 pkgver=2.4.58.5
6 pkgrel=5
7 epoch=1
8 pkgdesc='G-code generator for 3D printers'
9 arch=(x86_64)
10 url=https://github.com/supermerill/SuperSlicer
11 license=(AGPL3)
12 options=(!emptydirs)
13 depends=(
14   boost-libs
15   cgal
16   glew
17   gtk3
18   imath
19   libjpeg-turbo
20   libspnav
21   nlopt
22   openvdb
23   qhull
24   slicer-udev
26 makedepends=(
27   boost
28   cereal
29   cmake
30   eigen
31   git
32   glu
33   gst-plugins-base
34   libigl
35   libnotify
36   ninja
37   systemd
38   webkit2gtk
40 _tag=76856c584987547eb37ceb1140a891991b491dc0
41 _wxcommit=489f6118256853cf5b299d595868641938566cdb
42 source=(
43   git+https://github.com/supermerill/SuperSlicer.git#tag=${_tag}
44   git+https://github.com/slic3r/slic3r-profiles.git
45   https://github.com/prusa3d/wxWidgets/archive/${_wxcommit}/wxWidgets-${_wxcommit}.tar.gz
46   superslicer-cereal.patch
47   superslicer-openexr3.patch
48   superslicer-boost1.79.patch
49   superslicer-wxgtk3-wayland.patch
51 b2sums=('SKIP'
52         'SKIP'
53         '05c1d81b8dd005b4a5db935e32facc4aefd27696458ff41caef50b93bf2ac12da441e534b1f9d99383bfba6db23c0e4a8b53cf567c245f11478379cf769a5a1b'
54         'a652af374ca4cdd2b1db87bac9a1a6263a3c0df954c8afa4fddea3041659b159412fe3ab850d804a27dcb4b3ca8d64de511ef11769d353d7d2a0f7021dc38e99'
55         'd351d05190977e55047504d13ab4172c7eaf7fb2077a61a448dd29a8a27084ee4b13284143102b7ea3dff0edc8b20675dff0014e9f26cd5f448e50c04a1d6779'
56         '45ff3ab349a92b072eed57a511aead233e4356fcc9ab9382902af9702aee22f73c9a9f07a58420ca20c7c2cd41e81637f1d0114033c2fdb7f597cbcb484fa8ff'
57         '6b8abda2bfee9294bd5cd97380403680d6b2c6187af178e5eb4be2665280d1ff0d66036525b485e64d38d1d464756388fd4b53c6277d691079f51e6ee0c12372')
59 prepare() {
60   cd SuperSlicer
62   git config --global protocol.file.allow always
63   git submodule init resources/profiles
64   git config submodule.resources/profiles.url ../slic3r-profiles
65   git submodule update resources/profiles
67   patch -Np1 -i ../superslicer-cereal.patch
68   patch -Np1 -i ../superslicer-openexr3.patch
69   patch -Np1 -i ../superslicer-boost1.79.patch
70   patch -Np1 -i ../superslicer-wxgtk3-wayland.patch
73 pkgver() {
74   cd SuperSlicer
75   git describe --tags
78 build() {
79   cmake -B deps -S wxWidgets-${_wxcommit} \
80     -DCMAKE_INSTALL_PREFIX="${srcdir}"/deps/destdir/usr/local \
81     -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
82     -DBUILD_SHARED_LIBS=OFF \
83     -DwxBUILD_TOOLKIT=gtk3 \
84     -DwxUSE_MEDIACTRL=OFF \
85     -DwxUSE_DETECT_SM=OFF \
86     -DwxUSE_UNICODE=ON \
87     -DwxUSE_UNICODE_UTF8=ON \
88     -DwxUSE_OPENGL=ON \
89     -DwxUSE_LIBPNG=sys \
90     -DwxUSE_ZLIB=sys \
91     -DwxUSE_REGEX=builtin \
92     -DwxUSE_LIBJPEG=sys \
93     -DwxUSE_LIBTIFF=sys \
94     -DwxUSE_EXPAT=sys \
95     -DwxUSE_LIBLZMA=sys \
96     -DwxUSE_LIBSDL=OFF \
97     -DwxUSE_XTEST=OFF
98   cmake --build deps
99   cmake --install deps
100   cmake -S SuperSlicer -B build -G Ninja \
101     -DCMAKE_BUILD_TYPE=None \
102     -DCMAKE_INSTALL_PREFIX=/usr \
103     -DCMAKE_CXX_FLAGS="$CXXFLAGS -ffat-lto-objects -DBOOST_FILESYSTEM_DEPRECATED" \
104     -DCMAKE_PREFIX_PATH="${srcdir}"/deps/destdir/usr/local \
105     -DOpenGL_GL_PREFERENCE=GLVND \
106     -DSLIC3R_ALPHA=OFF \
107     -DSLIC3R_BUILD_TESTS=OFF \
108     -DSLIC3R_FHS=ON \
109     -DSLIC3R_GTK=3 \
110     -DSLIC3R_STATIC=OFF \
111     -DwxWidgets_USE_STATIC=ON
112   cmake --build build
115 package() {
116   DESTDIR="${pkgdir}" cmake --install build
117   test ! -h "${pkgdir}/usr/share/SuperSlicer/resources" || rm "${pkgdir}/usr/share/SuperSlicer/resources"
118   rm -r "${pkgdir}"/usr/lib/udev # Provided by slicer-udev
121 # vim: ts=2 sw=2 et: