summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorFélix Piédallu2022-09-19 10:30:11 +0200
committerFélix Piédallu2022-09-19 10:30:11 +0200
commit81ddc7dbbce472335b056c2c4dc324a17c1beebb (patch)
treec67f25ddfa50c339d010104ca814a1f486c2832a
parent00bb8ed395c485d616fa691450cc201561e24cd7 (diff)
downloadaur-81ddc7dbbce472335b056c2c4dc324a17c1beebb.tar.gz
Use statically built and linked wxwidgets
-rw-r--r--PKGBUILD52
1 files changed, 46 insertions, 6 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 6ede6c3cdbd9..9e84ae4a7d41 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -27,16 +27,23 @@ depends=(
'nlopt'
'openvdb'
'qhull'
- 'wxgtk3'
+ # wx 3.2 is not supported yet https://github.com/prusa3d/PrusaSlicer/issues/8299
+ # 'wxgtk3'
)
+# prusa-slicer use a patched wxWidgets and does not work with upstream, commit pinned in
+# https://github.com/prusa3d/PrusaSlicer/blob/version_${pkgver}/deps/wxWidgets/wxWidgets.cmake
+_wxcommit=489f6118256853cf5b299d595868641938566cdb
+
source=(
"git+${url}"
'prusa-slicer-boost-placeholders.patch'
+ "https://github.com/prusa3d/wxWidgets/archive/${_wxcommit}/wxWidgets-${_wxcommit}.tar.gz"
)
sha256sums=(
'SKIP'
'58cae07a418a797222f4cb10950fa2fd7afb7570519785b082cc7d7e7f407c02'
+ 'SKIP'
)
conflicts=('prusa-slicer')
@@ -50,10 +57,38 @@ prepare() {
patch -p1 < "$srcdir/prusa-slicer-boost-placeholders.patch"
}
+
+_build_wx_static() {
+ cmake -B deps -S wxWidgets-${_wxcommit} -G Ninja\
+ -DCMAKE_INSTALL_PREFIX="$deps_install_dir" \
+ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
+ -DBUILD_SHARED_LIBS=OFF \
+ -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
+}
+
build() {
export CC=clang
export CXX=clang++
+ deps_install_dir="$srcdir/deps/destdir/usr/local"
+ _build_wx_static
+
cmake_args=(
-DCMAKE_INSTALL_PREFIX=/usr
-DCMAKE_INSTALL_LIBDIR=lib
@@ -62,19 +97,24 @@ build() {
-DSLIC3R_GTK=3
-DOPENVDB_FIND_MODULE_PATH=/usr/lib/cmake/OpenVDB
)
- # For system-provided wx-gtk3
+ # for statically linked wx-gtk3
cmake_args+=(
- -DSLIC3R_STATIC=OFF
- -DSLIC3R_WX_STABLE=ON
- -DwxWidgets_CONFIG_EXECUTABLE="$(which wx-config-gtk3)"
+ -DwxWidgets_USE_STATIC=ON
+ -DCMAKE_PREFIX_PATH="$deps_install_dir"
)
+ # For system-provided wx-gtk3
+ # cmake_args+=(
+ # -DSLIC3R_STATIC=OFF
+ # -DSLIC3R_WX_STABLE=ON
+ # -DwxWidgets_CONFIG_EXECUTABLE=$(which wx-config-gtk3)
+ # )
cmake -B build -S PrusaSlicer -G Ninja "${cmake_args[@]}"
cmake --build build
}
check() {
- cd "build"
+ cd build
ctest -V
}