Initial commit for the builder

This commit is contained in:
Aidan Case
2024-02-18 22:27:09 -06:00
parent f9849d1302
commit 08e687e2ac
22 changed files with 3047 additions and 13 deletions

42
deps/CMakeLists.txt vendored
View File

@@ -204,16 +204,19 @@ else()
endif()
set(ZLIB_PKG "")
find_package(ZLIB)
if (NOT ZLIB_FOUND)
include(ZLIB/ZLIB.cmake)
set(ZLIB_PKG dep_ZLIB)
endif ()
set(PNG_PKG "")
find_package(PNG)
if (NOT PNG_FOUND)
include(PNG/PNG.cmake)
set(PNG_PKG dep_PNG)
endif ()
set(EXPAT_PKG "")
find_package(EXPAT)
if (NOT EXPAT_FOUND)
include(EXPAT/EXPAT.cmake)
set(EXPAT_PKG dep_EXPAT)
@@ -226,6 +229,7 @@ include(Boost/Boost.cmake)
include(Cereal/Cereal.cmake)
include(Qhull/Qhull.cmake)
include(GLEW/GLEW.cmake)
include(GLFW/GLFW.cmake)
include(OpenCSG/OpenCSG.cmake)
@@ -241,23 +245,45 @@ include(CGAL/CGAL.cmake)
include(NLopt/NLopt.cmake)
include(OpenSSL/OpenSSL.cmake)
set(CURL_PKG "")
find_package(CURL)
if (NOT CURL_FOUND)
message(WARNING "no curl package found, building openssl and curl")
include(OpenSSL/OpenSSL.cmake)
include(CURL/CURL.cmake)
set(OPENSSL_PKG dep_OpenSSL)
set(CURL_PKG dep_CURL)
endif ()
include(JPEG/JPEG.cmake)
include(TIFF/TIFF.cmake)
set(JPEG_PKG "")
find_package(JPEG)
if (NOT JPEG_FOUND)
include(JPEG/JPEG.cmake)
set(JPEG_PKG dep_JPEG)
endif()
set(TIFF_PKG "")
find_package(TIFF)
if (NOT TIFF_FOUND)
include(TIFF/TIFF.cmake)
set(TIFF_PKG "dep_TIFF")
endif()
include(wxWidgets/wxWidgets.cmake)
set(FREETYPE_PKG "")
find_package(Freetype)
if(NOT FREETYPE_FOUND)
include(FREETYPE/FREETYPE.cmake)
set(FREETYPE_PKG "dep_FREETYPE")
endif()
include(OCCT/OCCT.cmake)
include(FREETYPE/FREETYPE.cmake)
set(_dep_list
dep_Boost
dep_TBB
${OPENSSL_PKG}
${CURL_PKG}
dep_wxWidgets
dep_Cereal
@@ -265,8 +291,9 @@ set(_dep_list
dep_OpenVDB
dep_OpenCSG
dep_CGAL
dep_OpenSSL
dep_GLFW
dep_OCCT
${FREETYPE_PKG}
${PNG_PKG}
${ZLIB_PKG}
${EXPAT_PKG}
@@ -281,9 +308,6 @@ else()
#list(APPEND _dep_list "dep_libigl")
endif()
list(APPEND _dep_list "dep_OCCT")
list(APPEND _dep_list "dep_FREETYPE")
add_custom_target(deps ALL DEPENDS ${_dep_list})
# Note: I'm not using any of the LOG_xxx options in ExternalProject_Add() commands

View File

@@ -14,7 +14,7 @@ orcaslicer_add_cmake_project(OCCT
#PATCH_COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-OCCT-fix.patch
PATCH_COMMAND git apply --directory ${BINARY_DIR_REL}/dep_OCCT-prefix/src/dep_OCCT --verbose --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-OCCT-fix.patch
#DEPENDS dep_Boost
#DEPENDS dep_FREETYPE
DEPENDS ${FREETYPE_PKG}
CMAKE_ARGS
-DBUILD_LIBRARY_TYPE=${library_build_type}
-DUSE_TK=OFF
@@ -31,4 +31,4 @@ orcaslicer_add_cmake_project(OCCT
-DBUILD_MODULE_Visualization=OFF
)
add_dependencies(dep_OCCT dep_FREETYPE)
# add_dependencies(dep_OCCT ${FREETYPE_PKG})

View File

@@ -31,7 +31,7 @@ orcaslicer_add_cmake_project(
GIT_REPOSITORY "https://github.com/wxWidgets/wxWidgets"
GIT_TAG ${_wx_git_tag}
PATCH_COMMAND ${_patch_cmd}
DEPENDS ${PNG_PKG} ${ZLIB_PKG} ${EXPAT_PKG} dep_TIFF dep_JPEG
DEPENDS ${PNG_PKG} ${ZLIB_PKG} ${EXPAT_PKG} ${TIFF_PKG} ${JPEG_PKG}
CMAKE_ARGS
-DwxBUILD_PRECOMP=ON
${_wx_toolkit}
@@ -62,4 +62,4 @@ orcaslicer_add_cmake_project(
if (MSVC)
add_debug_dep(dep_wxWidgets)
endif ()
endif ()

2
flatpak/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
builddir
.flatpak-builder/*

3
flatpak/README.md Normal file
View File

@@ -0,0 +1,3 @@
# OrcaSlicer
This is basically a copy of [com.bambulab.BambuStudio](https://github.com/flathub/com.bambulab.BambuStudio). As such, same rules apply here as does over there.

15
flatpak/entrypoint Normal file
View File

@@ -0,0 +1,15 @@
#!/usr/bin/env sh
# Work-around https://gitlab.gnome.org/GNOME/gnome-build-meta/-/issues/754
grep -q org.freedesktop.Platform.GL.nvidia /.flatpak-info && export WEBKIT_DISABLE_DMABUF_RENDERER=1
# Work-around https://github.com/bambulab/BambuStudio/issues/3440
export LC_ALL=C.UTF-8
if [ $BAMBU_STUDIO_DARK_THEME == true ]; then
export GTK_THEME='Adwaita:dark'
# echo "Message: $(date +%T): INFO: using dark theme variant"
fi
exec /app/bin/orca-slicer "$@" &
$(/app/bin/set-dark-theme-variant.py) &

BIN
flatpak/images/1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 KiB

BIN
flatpak/images/2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 976 KiB

View File

@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
<id>io.github.softfever.OrcaSlicer</id>
<launchable type="desktop-id">io.github.softfever.OrcaSlicer.desktop</launchable>
<provides>
<id>io.github.softfever.OrcaSlicer.desktop</id>
</provides>
<name>OrcaSlicer</name>
<!-- hehe hadess @ppd
... seriously though, thanks -->
<summary>Get even more perfect prints!</summary>
<developer_name>SoftFever</developer_name>
<url type="homepage">https://github.com/SoftFever/OrcaSlicer</url>
<url type="help">https://github.com/SoftFever/OrcaSlicer/wiki</url>
<url type="bugtracker">https://github.com/SoftFever/OrcaSlicer/issues/</url>
<url type="donation">https://ko-fi.com/SoftFever</url>
<metadata_license>0BSD</metadata_license>
<project_license>AGPL-3.0-only</project_license>
<content_rating type="oars-1.1" />
<requires>
<display_length compare="gt">768</display_length>
</requires>
<recommends>
<control>keyboard</control>
<control>pointing</control>
</recommends>
<screenshots>
<screenshot type="default">
<image>https://raw.githubusercontent.com/powpingdone/com.github.softfever.orcaslicer/master/images/1.png</image>
<caption>A model ready to be sliced on a buildplate.</caption>
</screenshot>
<screenshot>
<image>https://raw.githubusercontent.com/powpingdone/com.github.softfever.orcaslicer/master/images/2.png
</image>
<caption>A calibration test ready to be printed out.</caption>
</screenshot>
</screenshots>
<description>
<p>A 3D printer slicer forked from Bambu Studio, PrusaSlicer, and SuperSlicer with many more printer profiles, helpful calibration prints, and many more features to get your 3D printer printing perfectly!</p>
</description>
<branding>
<color type="primary" scheme_preference="light">#009688</color>
</branding>
<releases>
<release version="2.0.0-951fc8e" date="2024-01-30"> <url>https://github.com/SoftFever/OrcaSlicer/commit/951fc8e98a0d5ca0ccb254315646ce7889a44836</url>
</release>
</releases>
</component>

View File

@@ -0,0 +1,392 @@
app-id: io.github.softfever.OrcaSlicer
runtime: org.gnome.Platform
runtime-version: "45"
sdk: org.gnome.Sdk
command: entrypoint
separate-locales: true
rename-icon: OrcaSlicer
finish-args:
- --share=ipc
- --socket=x11
- --share=network
- --device=all
- --filesystem=home
- --filesystem=xdg-run/gvfs
- --filesystem=/run/media
- --filesystem=/media
# Allow OrcaSlicer to talk to other instances
- --talk-name=io.github.softfever.OrcaSlicer.InstanceCheck.*
- --system-talk-name=org.freedesktop.UDisks2
# set dark theme
- --env=BAMBU_STUDIO_DARK_THEME=false
modules:
# JPEG codec for the liveview
- name: gst-plugins-good
buildsystem: meson
config-opts:
- -Dauto_features=disabled
- -Djpeg=enabled
- -Ddoc=disabled
- -Dexamples=disabled
- -Dtests=disabled
sources:
- type: archive
url: https://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-1.22.8.tar.xz
sha256: e305b9f07f52743ca481da0a4e0c76c35efd60adaf1b0694eb3bb021e2137e39
# xprop, xlib is needed to manipulate the X11 window and set _GTK_THEME_VARIANT dark on X11
# and paint the window dark when PRUSA_SLICER_DARK_THEME is true
# see: entrypoint & set-dark-theme-variant.py (originated from spotify client flatpak)
- name: xprop
sources:
- type: archive
url: http://mirrors.ircam.fr/pub/x.org/individual/app/xprop-1.2.5.tar.gz
sha256: b7bf6b6be6cf23e7966a153fc84d5901c14f01ee952fbd9d930aa48e2385d670
- name: python-setuptools_scm
buildsystem: simple
build-commands:
- pip3 install --no-deps --no-build-isolation --verbose --prefix=${FLATPAK_DEST} .
sources:
- type: archive
url: https://files.pythonhosted.org/packages/57/38/930b1241372a9f266a7df2b184fb9d4f497c2cef2e016b014f82f541fe7c/setuptools_scm-6.0.1.tar.gz
sha256: d1925a69cb07e9b29416a275b9fadb009a23c148ace905b2fb220649a6c18e92
- name: python-xlib
buildsystem: simple
build-commands:
- pip3 install --no-deps --no-build-isolation --verbose --prefix=${FLATPAK_DEST} .
sources:
- type: archive
url: https://files.pythonhosted.org/packages/86/f5/8c0653e5bb54e0cbdfe27bf32d41f27bc4e12faa8742778c17f2a71be2c0/python-xlib-0.33.tar.gz
sha256: 55af7906a2c75ce6cb280a584776080602444f75815a7aff4d287bb2d7018b32
# For libOSMesa
- name: mesa
buildsystem: meson
config-opts:
- -Dosmesa=classic
- -Ddri-drivers=[]
- -Dgallium-drivers=[]
- -Dvulkan-drivers=[]
- -Dplatforms=[]
build-options:
arch:
aarch64:
config-opts:
- -Dlibunwind=disabled
cleanup:
- /share/drirc.d
- /include
- "*.a"
sources:
- type: archive
# url: https://archive.mesa3d.org/mesa-20.2.6.tar.xz
url: https://ftp.icm.edu.pl/pub/graphics/mesa/mesa-20.2.6.tar.xz
sha256: f12ca3c6c622f11cd79ad66b4220f04514fa96f795062fe92a37339ab19885db
- name: glu
config-opts:
- --disable-static
sources:
- type: archive
url: https://ftp.osuosl.org/pub/blfs/conglomeration/glu/glu-9.0.2.tar.xz
sha256: 6e7280ff585c6a1d9dfcdf2fca489251634b3377bfc33c29e4002466a38d02d4
cleanup:
- /include
- /lib/*.a
- /lib/*.la
- /lib/pkgconfig
- name: kde-extra-cmake-modules
buildsystem: cmake
sources:
- type: git
url: https://github.com/KDE/extra-cmake-modules
tag: v5.249.0
cleanup:
- /
# - name: boost
# buildsystem: simple
# build-commands:
# - ./bootstrap.sh --prefix=/app --with-libraries=system,iostreams,filesystem,thread,log,locale,regex,date_time
# - ./b2 headers
# - ./b2 -j$FLATPAK_BUILDER_N_JOBS install variant=release cxxstd=17 --layout=system
# sources:
# - type: archive
# url: https://freefr.dl.sourceforge.net/project/boost/boost/1.78.0/boost_1_78_0.zip
# sha256: f22143b5528e081123c3c5ed437e92f648fe69748e95fa6e2bd41484e2986cc3
# cleanup:
# - /include
# - /lib/cmake
#- name: glfw
# buildsystem: cmake-ninja
# config-opts:
# - -DCMAKE_BUILD_TYPE=RelWithDebInfo
# - -DBUILD_SHARED_LIBS:BOOL=ON
# - -DGLFW_USE_WAYLAND=OFF
# sources:
# - type: git
# url: https://github.com/glfw/glfw.git
# tag: 3.3.9
# - type: patch
# path: patches/glfw-Don-t-crash-on-calls-to-focus-or-icon.patch
# cleanup:
# - /include
# - /lib/cmake
# - /lib/pkgconfig
#- name: wxwidgets
# buildsystem: cmake-ninja
# config-opts:
# - -DwxBUILD_PRECOMP=ON
# - -DwxBUILD_TOOLKIT=gtk3
# - -DwxBUILD_DEBUG_LEVEL=0
# - -DwxBUILD_SAMPLES=OFF
# - -DwxBUILD_SHARED=OFF
# - -DwxUSE_MEDIACTRL=ON
# - -DwxUSE_DETECT_SM=OFF
# - -DwxUSE_UNICODE=ON
# - -DwxUSE_PRIVATE_FONTS=1
# - -DwxUSE_OPENGL=ON
# - -DwxUSE_WEBREQUEST=ON
# - -DwxUSE_WEBVIEW=ON
# - -DwxUSE_REGEX=sys
# - -DwxUSE_LIBSDL=OFF
# - -DwxUSE_XTEST=OFF
# - -DwxUSE_STC=OFF
# - -DwxUSE_AUI=ON
# - -DwxUSE_LIBPNG=sys
# - -DwxUSE_ZLIB=sys
# - -DwxUSE_LIBJPEG=sys
# - -DwxUSE_LIBTIFF=sys
# - -DwxUSE_NANOSVG=OFF
# - -DwxUSE_EXPAT=sys
# sources:
# - type: archive
# url: https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.5/wxWidgets-3.1.5.tar.bz2
# sha256: d7b3666de33aa5c10ea41bb9405c40326e1aeb74ee725bb88f90f1d50270a224
# # https://github.com/bambulab/BambuStudio/issues/3279
# - type: patch
# path: patches/disable-gstplayer.patch
# # https://github.com/wxWidgets/wxWidgets/issues/23630
# - type: patch
# path: patches/0001-Add-support-for-building-WebView-with-libwebkit2gtk-.patch
# # wx-config/build fixes between 3.1.5 and 3.1.6
# - type: patch
# path: patches/wxwidgets-not-found.patch
# #- type: patch
# # path: patches/wxwidgets-system-def.patch
# cleanup:
# - /include
# - /lib/cmake
- name: orca_deps
buildsystem: simple
build-commands:
# start build
- |
mkdir deps/build && cd deps/build
cmake ../ \
-DDEP_WX_GTK3=1 \
-DDEP_DOWNLOAD_DIR=/run/build/orca_deps/external-packages \
-DCMAKE_INSTALL_LIBDIR=/app/lib \
-DCMAKE_INSTALL_PREFIX=/app
cmake --build .
cleanup:
- /app/include
- "*.a"
- "*.la"
sources:
# -
# Section bellow fetches all OrcaSlicer dependencies before the build process and stores them in external-packages/*/* .
# -DDEP_DOWNLOAD_DIR is set in the build process which has to match with dest.
#
# NOTE: The url, dest folder name and sha256 must match from OrcaSlicer's cmake scripts and folder names in OrcaSlicer/deps/
# -
# OrcaSlicer Source Archive
- type: dir
path: ../
# Blosc
- type: file
url: https://github.com/tamasmeszaros/c-blosc/archive/refs/heads/v1.17.0_tm.zip
dest: external-packages/Blosc
sha256: dcb48bf43a672fa3de6a4b1de2c4c238709dad5893d1e097b8374ad84b1fc3b3
# Cereal
- type: file
url: https://github.com/USCiLab/cereal/archive/refs/tags/v1.3.0.zip
dest: external-packages/Cereal
sha256: 71642cb54658e98c8f07a0f0d08bf9766f1c3771496936f6014169d3726d9657
# CGAL
- type: file
url: https://github.com/CGAL/cgal/archive/refs/tags/v5.4.zip
dest: external-packages/CGAL
sha256: d7605e0a5a5ca17da7547592f6f6e4a59430a0bc861948974254d0de43eab4c0
# GMP
- type: file
url: https://github.com/SoftFever/OrcaSlicer_deps/releases/download/gmp-6.2.1/gmp-6.2.1.tar.bz2
dest: external-packages/GMP
sha256: eae9326beb4158c386e39a356818031bd28f3124cf915f8c5b1dc4c7a36b4d7c
# MPFR
- type: file
url: https://www.mpfr.org/mpfr-current/mpfr-4.2.1.tar.bz2
dest: external-packages/MPFR
sha256: b9df93635b20e4089c29623b19420c4ac848a1b29df1cfd59f26cab0d2666aa0
# NLopt
- type: file
url: https://github.com/stevengj/nlopt/archive/v2.5.0.tar.gz
dest: external-packages/NLopt
sha256: c6dd7a5701fff8ad5ebb45a3dc8e757e61d52658de3918e38bab233e7fd3b4ae
# OCCT
- type: file
url: https://github.com/Open-Cascade-SAS/OCCT/archive/refs/tags/V7_6_0.zip
dest: external-packages/OCCT
sha256: 28334f0e98f1b1629799783e9b4d21e05349d89e695809d7e6dfa45ea43e1dbc
# OpenCSG
- type: file
url: https://github.com/floriankirsch/OpenCSG/archive/refs/tags/opencsg-1-4-2-release.zip
dest: external-packages/OpenCSG
sha256: 51afe0db79af8386e2027d56d685177135581e0ee82ade9d7f2caff8deab5ec5
# OpenEXR
- type: file
url: https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/v2.5.5.zip
dest: external-packages/OpenEXR
sha256: 0307a3d7e1fa1e77e9d84d7e9a8694583fbbbfd50bdc6884e2c96b8ef6b902de
# OpenVDB
- type: file
url: https://github.com/tamasmeszaros/openvdb/archive/a68fd58d0e2b85f01adeb8b13d7555183ab10aa5.zip
dest: external-packages/OpenVDB
sha256: f353e7b99bd0cbfc27ac9082de51acf32a8bc0b3e21ff9661ecca6f205ec1d81
# Qhull
- type: file
url: https://github.com/qhull/qhull/archive/v8.0.1.zip
dest: external-packages/Qhull
sha256: 5287f5edd6a0372588f5d6640799086a4033d89d19711023ef8229dd9301d69b
# TBB
- type: file
url: https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.5.0.zip
dest: external-packages/TBB
sha256: 83ea786c964a384dd72534f9854b419716f412f9d43c0be88d41874763e7bb47
# Patched TBB cmake to make build without lto flag
- type: file
dest: deps/TBB
path: patches/TBB/GNU.cmake
# Apply TTB patches to fix linking failure. More info: https://github.com/prusa3d/PrusaSlicer/issues/8922
- type: patch
path: patches/0001-Apply-TBB-LTO-patch.patch
# Boost
- type: file
url: https://github.com/boostorg/boost/releases/download/boost-1.84.0/boost-1.84.0.tar.gz
dest: external-packages/Boost
sha256: 4d27e9efed0f6f152dc28db6430b9d3dfb40c0345da7342eaa5a987dde57bd95
# GLFW
- type: file
url: https://github.com/glfw/glfw/archive/refs/tags/3.3.7.zip
dest: external-packages/GLFW
sha256: e02d956935e5b9fb4abf90e2c2e07c9a0526d7eacae8ee5353484c69a2a76cd0
# wxWidgets
- type: git
url: https://github.com/wxWidgets/wxWidgets
dest: external-packages/wxWidgets
tag: v3.1.5
- name: OrcaSlicer
buildsystem: simple
build-commands:
- |
mkdir -p build && cd build
CXXFLAGS=-std=gnu++20 cmake ../ \
-GNinja \
-DCMAKE_INSTALL_PREFIX=/app \
-DCMAKE_INSTALL_LIBDIR=/app/lib \
-DCMAKE_PREFIX_PATH=/run/build/OrcaSlicer/deps/build/destdir/usr/local \
-DSLIC3R_PCH=OFF \
-DSLIC3R_FHS=ON \
-DSLIC3R_GTK=3 \
-DSLIC3R_STATIC=ON \
-DSLIC3R_BUILD_TESTS=OFF \
-DSLIC3R_DESKTOP_INTEGRATION=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DBBL_RELEASE_TO_PUBLIC=1
CXXFLAGS=-std=gnu++20 cmake --build . --target install -j$FLATPAK_BUILDER_N_JOBS
cleanup:
- /include
post-install:
- | # Desktop Integration files
install -Dm644 -t /app/share/icons/hicolor/scalable/apps/ resources/images/OrcaSlicer.svg
install -Dm644 ${FLATPAK_ID}.metainfo.xml /app/share/metainfo/${FLATPAK_ID}.metainfo.xml
mv /app/share/applications/OrcaSlicer.desktop /app/share/applications/${FLATPAK_ID}.desktop
desktop-file-edit --set-key=Exec --set-value="entrypoint %U" /app/share/applications/${FLATPAK_ID}.desktop
install -Dm755 set-dark-theme-variant.py /app/bin
install -Dm755 entrypoint /app/bin
install -Dm755 umount /app/bin
sources:
# -
# Section bellow fetches all OrcaSlicer dependencies before the build process and stores them in external-packages/*/* .
# -DDEP_DOWNLOAD_DIR is set in the build process which has to match with dest.
#
# NOTE: The url, dest folder name and sha256 must match from OrcaSlicer's cmake scripts and folder names in OrcaSlicer/deps/
# -
# OrcaSlicer Source Archive
- type: dir
path: ../
- type: patch
path: patches/0001-Work-around-ClipperLib-union_-declaration-problem.patch
# Use system deps instead of building them within BambuStudio
# https://github.com/hadess/BambuStudio/tree/wip/hadess/use-sysdeps , modified
- type: patch
path: patches/use-sysdeps.patch
## other patches to contrib
#- type: patch
# path: patches/0001-megapatch.patch
# AppData metainfo for Gnome Software & Co.
- type: file
path: io.github.softfever.OrcaSlicer.metainfo.xml
# script to set dark theme variant
- type: file
path: set-dark-theme-variant.py
# start-up script
# README: workaround for the following issues, also enables dark theme variant:
# SEE: https://github.com/flathub/com.bambulab.BambuStudio/issues/27
# SEE: https://github.com/flathub/com.bambulab.BambuStudio/issues/3
# SEE: https://github.com/prusa3d/PrusaSlicer/issues/2365
- type: file
path: entrypoint
# umount wrapper used to redirect umount calls to udisk2
- type: file
path: umount

8
flatpak/local-build.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/usr/bin/env bash
rm -rf _build ; mkdir _build
rm -rf _repo ; mkdir _repo
BRANCH=test
powerprofilesctl launch flatpak-builder --ccache --force-clean --default-branch=$BRANCH _build com.bambulab.BambuStudio.yml --repo=_repo

View File

@@ -0,0 +1,167 @@
From df46add1165314bce93d70e611ddc453561ffb60 Mon Sep 17 00:00:00 2001
From: Scott Talbert <swt@techie.net>
Date: Mon, 12 Jun 2023 20:28:35 -0400
Subject: [PATCH] Add support for building WebView with libwebkit2gtk-4.1
libwebkit2gtk-4.1 has the same API as libwebkit2gtk-4.0, except that the
former links with libsoup-3.0 and the latter links with libsoup-2.4.
Fixes #23630.
(cherry picked from commit 1b8664426603376b68f8ca3c54de97ec630e5940)
---
build/cmake/init.cmake | 10 ++-
build/cmake/modules/FindLIBSOUP.cmake | 14 +++-
build/cmake/modules/FindWEBKIT2.cmake | 5 +-
configure | 95 +++++++++++++++++++++++++--
configure.in | 16 ++++-
src/gtk/webview_webkit2.cpp | 4 ++
6 files changed, 129 insertions(+), 15 deletions(-)
diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake
index fc206cf2e03a..5d88a7e487cc 100644
--- a/build/cmake/init.cmake
+++ b/build/cmake/init.cmake
@@ -453,15 +453,21 @@ if(wxUSE_GUI)
if(wxUSE_WEBVIEW)
if(WXGTK)
if(wxUSE_WEBVIEW_WEBKIT)
- find_package(LIBSOUP)
+ set(WEBKIT_LIBSOUP_VERSION 2.4)
if(WXGTK2)
find_package(WEBKIT 1.0)
elseif(WXGTK3)
- find_package(WEBKIT2)
+ find_package(WEBKIT2 4.1 QUIET)
+ if(WEBKIT2_FOUND)
+ set(WEBKIT_LIBSOUP_VERSION 3.0)
+ else()
+ find_package(WEBKIT2 4.0)
+ endif()
if(NOT WEBKIT2_FOUND)
find_package(WEBKIT 3.0)
endif()
endif()
+ find_package(LIBSOUP ${WEBKIT_LIBSOUP_VERSION})
endif()
set(wxUSE_WEBVIEW_WEBKIT OFF)
set(wxUSE_WEBVIEW_WEBKIT2 OFF)
diff --git a/build/cmake/modules/FindLIBSOUP.cmake b/build/cmake/modules/FindLIBSOUP.cmake
index cbfba1cf9366..2433d141eaf7 100644
--- a/build/cmake/modules/FindLIBSOUP.cmake
+++ b/build/cmake/modules/FindLIBSOUP.cmake
@@ -31,19 +31,27 @@
# LibSoup does not provide an easy way to retrieve its version other than its
# .pc file, so we need to rely on PC_LIBSOUP_VERSION and REQUIRE the .pc file
# to be found.
+SET(LIBSOUP_VERSION 2.4)
+if(DEFINED LIBSOUP_FIND_VERSION)
+ SET(LIBSOUP_VERSION ${LIBSOUP_FIND_VERSION})
+endif()
+
+set(LIBSOUP_INCLUDE_DIRS LIBSOUP_INCLUDE_DIRS-NOTFOUND)
+set(LIBSOUP_LIBRARIES LIBSOUP_LIBRARIES-NOTFOUND)
+
FIND_PACKAGE(PkgConfig)
-PKG_CHECK_MODULES(PC_LIBSOUP QUIET libsoup-2.4)
+PKG_CHECK_MODULES(PC_LIBSOUP QUIET libsoup-${LIBSOUP_VERSION})
if(PC_LIBSOUP_FOUND)
FIND_PATH(LIBSOUP_INCLUDE_DIRS
NAMES libsoup/soup.h
HINTS ${PC_LIBSOUP_INCLUDEDIR}
${PC_LIBSOUP_INCLUDE_DIRS}
- PATH_SUFFIXES libsoup-2.4
+ PATH_SUFFIXES libsoup-${LIBSOUP_VERSION}
)
FIND_LIBRARY(LIBSOUP_LIBRARIES
- NAMES soup-2.4
+ NAMES soup-${LIBSOUP_VERSION}
HINTS ${PC_LIBSOUP_LIBDIR}
${PC_LIBSOUP_LIBRARY_DIRS}
)
diff --git a/build/cmake/modules/FindWEBKIT2.cmake b/build/cmake/modules/FindWEBKIT2.cmake
index 133e7a4563ea..e39077ac4a71 100644
--- a/build/cmake/modules/FindWEBKIT2.cmake
+++ b/build/cmake/modules/FindWEBKIT2.cmake
@@ -5,7 +5,10 @@
# WEBKIT2_LIBRARIES - List of libraries when using Webkit2.
# WEBKIT2_FOUND - True if Webkit2 found.
-SET( WEBKIT2_VERSION 4.0)
+SET(WEBKIT2_VERSION 4.0)
+if(DEFINED WEBKIT2_FIND_VERSION)
+ SET(WEBKIT2_VERSION ${WEBKIT2_FIND_VERSION})
+endif()
set(WEBKIT2_INCLUDE_DIR WEBKIT2_INCLUDE_DIR-NOTFOUND)
set(WEBKIT2_LIBRARY WEBKIT2_LIBRARY-NOTFOUND)
diff --git a/configure.in b/configure.in
index 957be8dda34c..257c95a6009b 100644
--- a/configure.in
+++ b/configure.in
@@ -7529,15 +7529,27 @@ if test "$wxUSE_WEBVIEW" = "yes"; then
if test "$wxUSE_GTK" = 1; then
if test "$WXGTK3" = 1; then
PKG_CHECK_MODULES([WEBKIT],
- [webkit2gtk-4.0],
+ [webkit2gtk-4.1],
[
USE_WEBVIEW_WEBKIT2=1
CXXFLAGS="$CXXFLAGS $WEBKIT_CFLAGS"
EXTRALIBS_WEBVIEW="$WEBKIT_LIBS"
],
[
- AC_MSG_WARN([webkit2gtk not found, falling back to webkitgtk])
+ AC_MSG_WARN([webkit2gtk-4.1 not found, falling back to webkit2gtk-4.0])
])
+ if test "$USE_WEBVIEW_WEBKIT2" = 0; then
+ PKG_CHECK_MODULES([WEBKIT],
+ [webkit2gtk-4.0],
+ [
+ USE_WEBVIEW_WEBKIT2=1
+ CXXFLAGS="$CXXFLAGS $WEBKIT_CFLAGS"
+ EXTRALIBS_WEBVIEW="$WEBKIT_LIBS"
+ ],
+ [
+ AC_MSG_WARN([webkit2gtk-4.0 not found, falling back to webkitgtk])
+ ])
+ fi
fi
if test "$USE_WEBVIEW_WEBKIT2" = 0; then
webkitgtk=webkit-1.0
diff --git a/src/gtk/webview_webkit2.cpp b/src/gtk/webview_webkit2.cpp
index 191cbcf2cc18..87a9bd5ad3a8 100644
--- a/src/gtk/webview_webkit2.cpp
+++ b/src/gtk/webview_webkit2.cpp
@@ -173,15 +173,18 @@ wxgtk_webview_webkit_load_failed(WebKitWebView *,
{
switch (error->code)
{
+#if SOUP_MAJOR_VERSION < 3
case SOUP_STATUS_CANCELLED:
type = wxWEBVIEW_NAV_ERR_USER_CANCELLED;
break;
case SOUP_STATUS_CANT_RESOLVE:
+#endif
case SOUP_STATUS_NOT_FOUND:
type = wxWEBVIEW_NAV_ERR_NOT_FOUND;
break;
+#if SOUP_MAJOR_VERSION < 3
case SOUP_STATUS_CANT_RESOLVE_PROXY:
case SOUP_STATUS_CANT_CONNECT:
case SOUP_STATUS_CANT_CONNECT_PROXY:
@@ -193,6 +196,7 @@ wxgtk_webview_webkit_load_failed(WebKitWebView *,
case SOUP_STATUS_MALFORMED:
type = wxWEBVIEW_NAV_ERR_REQUEST;
break;
+#endif
case SOUP_STATUS_BAD_REQUEST:
type = wxWEBVIEW_NAV_ERR_REQUEST;
--
2.43.0

View File

@@ -0,0 +1,16 @@
diff --git a/deps/TBB/TBB.cmake b/deps/TBB/TBB.cmake
index 6bf28ca2e..5bd158e30 100644
--- a/deps/TBB/TBB.cmake
+++ b/deps/TBB/TBB.cmake
@@ -1,8 +1,10 @@
+set(_patch_command ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_LIST_DIR}/GNU.cmake cmake/compilers/GNU.cmake)
+
orcaslicer_add_cmake_project(
TBB
URL "https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.5.0.zip"
URL_HASH SHA256=83ea786c964a384dd72534f9854b419716f412f9d43c0be88d41874763e7bb47
- #PATCH_COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-TBB-GCC13.patch
+ PATCH_COMMAND ${_patch_command}
CMAKE_ARGS
-DTBB_BUILD_SHARED=OFF
-DTBB_BUILD_TESTS=OFF

View File

@@ -0,0 +1,57 @@
From 504e2a789502b76cf2553124a777e32e08bfa15c Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Wed, 13 Dec 2023 12:38:11 +0100
Subject: [PATCH] Work-around ClipperLib/union_ declaration problem
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[116/471] Building CXX object src/libslic3r/CMakeFiles/libslic3r.dir/Format/svg.cpp.o
FAILED: src/libslic3r/CMakeFiles/libslic3r.dir/Format/svg.cpp.o
/run/ccache/bin/c++ -DBOOST_ATOMIC_NO_LIB -DBOOST_CHRONO_NO_LIB -DBOOST_DATE_TIME_NO_LIB -DBOOST_FILESYSTEM_NO_LIB -DBOOST_IOSTREAMS_NO_LIB -DBOOST_LOCALE_NO_LIB -DBOOST_LOG_NO_LIB -DBOOST_REGEX_NO_LIB -DBOOST_SYSTEM_NO_LIB -DBOOST_THREAD_NO_LIB -DHAVE_FREETYPE -DHAVE_OPENGL_EXT -DHAVE_XLIB -DLIBNEST2D_GEOMETRIES_libslic3r -DLIBNEST2D_OPTIMIZER_nlopt -DLIBNEST2D_STATIC -DLIBNEST2D_THREADING_tbb -DOCC_CONVERT_SIGNALS -DOPENVDB_OPENEXR_STATICLIB -DOPENVDB_STATICLIB -DSLIC3R_GUI -DTBB_USE_CAPTURED_EXCEPTION=0 -DUNICODE -DUSE_TBB -DWXINTL_NO_GETTEXT_MACRO -D_UNICODE -DwxNO_UNSAFE_WXSTRING_CONV -DwxUSE_UNICODE -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/run/build/BambuStudio/src -I/run/build/BambuStudio/build/src/platform -I/run/build/BambuStudio/src/libslic3r -I/run/build/BambuStudio/build/src/libslic3r -I/run/build/BambuStudio/deps/build/destdir/usr/local/include/opencascade -I/run/build/BambuStudio/src/libnest2d/include -I/run/build/BambuStudio/src/miniz -I/run/build/BambuStudio/src/glu-libtess/include -I/run/build/BambuStudio/src/clipper2/Clipper2Lib/include -isystem /run/build/BambuStudio/src/eigen -isystem /run/build/BambuStudio/src/libigl -isystem /run/build/BambuStudio/deps/build/destdir/usr/local/include -isystem /run/build/BambuStudio/deps/build/destdir/usr/local/include/boost-1_78 -isystem /run/build/BambuStudio/deps/build/destdir/usr/local/include/OpenEXR -O2 -pipe -g -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -fext-numeric-literals -Wall -Wno-reorder -O3 -DNDEBUG -std=gnu++17 -fPIC -fsigned-char -Werror=return-type -Wno-ignored-attributes -Wno-unknown-pragmas -DOPENVDB_ABI_VERSION_NUMBER=8 -MD -MT src/libslic3r/CMakeFiles/libslic3r.dir/Format/svg.cpp.o -MF src/libslic3r/CMakeFiles/libslic3r.dir/Format/svg.cpp.o.d -o src/libslic3r/CMakeFiles/libslic3r.dir/Format/svg.cpp.o -c /run/build/BambuStudio/src/libslic3r/Format/svg.cpp
/run/build/BambuStudio/src/libslic3r/Format/svg.cpp:214:29: error: Path is not a member of Slic3r::ClipperLib; did you mean ClipperLib::Path?
214 | ClipperLib::Path pt_path;
| ^~~~
In file included from /run/build/BambuStudio/src/libslic3r/Format/svg.cpp:22:
/run/build/BambuStudio/src/clipper/clipper.hpp:113:31: note: ClipperLib::Path declared here
113 | typedef std::vector<IntPoint> Path;
| ^~~~
/run/build/BambuStudio/src/libslic3r/Format/svg.cpp:240:28: error: union_ was not declared in this scope; did you mean union?
240 | polygons = union_(polygons);
| ^~~~~~
| union
---
src/libslic3r/Format/svg.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/libslic3r/Format/svg.cpp b/src/libslic3r/Format/svg.cpp
index 4a96274b99e4..ff895402255d 100644
--- a/src/libslic3r/Format/svg.cpp
+++ b/src/libslic3r/Format/svg.cpp
@@ -204,12 +204,14 @@ bool get_svg_profile(const char *path, std::vector<Element_Info> &element_infos,
path_line_points.push_back(profile_line_points);
}
+#if 0
if (shape->fill.gradient == nullptr) {
double scale_size = 1e6;
std::vector<std::vector<std::pair<gp_Pnt, gp_Pnt>>> new_path_line_points;
float stroke_width = shape->strokeWidth * scale_size;
Polygons polygons;
bool close_polygon = false;
+
for (int i = 0; i < path_line_points.size(); ++i) {
ClipperLib::Path pt_path;
for (auto line_point : path_line_points[i]) {
@@ -253,7 +255,7 @@ bool get_svg_profile(const char *path, std::vector<Element_Info> &element_infos,
path_line_points = new_path_line_points;
}
-
+#endif
// generate all profile curves
std::vector<TopoDS_Wire> wires;
int index = 0;
--
2.43.0

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,79 @@
# Copyright (c) 2020-2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
if (MINGW)
set(TBB_LINK_DEF_FILE_FLAG "")
set(TBB_DEF_FILE_PREFIX "")
elseif (APPLE)
set(TBB_LINK_DEF_FILE_FLAG -Wl,-exported_symbols_list,)
set(TBB_DEF_FILE_PREFIX mac${TBB_ARCH})
# For correct ucontext.h structures layout
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -D_XOPEN_SOURCE)
else()
set(TBB_LINK_DEF_FILE_FLAG -Wl,--version-script=)
set(TBB_DEF_FILE_PREFIX lin${TBB_ARCH})
endif()
# Add -Wno-error=stringop-overflow to fix GCC 12+ build as suggested on https://github.com/oneapi-src/oneTBB/issues/843#issuecomment-1152646035
set(TBB_WARNING_LEVEL -Wall -Wextra $<$<BOOL:${TBB_STRICT}>:-Werror> -Wfatal-errors -Wno-error=stringop-overflow)
set(TBB_TEST_WARNING_FLAGS -Wshadow -Wcast-qual -Woverloaded-virtual -Wnon-virtual-dtor)
# Depfile options (e.g. -MD) are inserted automatically in some cases.
# Don't add -MMD to avoid conflicts in such cases.
if (NOT CMAKE_GENERATOR MATCHES "Ninja" AND NOT CMAKE_CXX_DEPENDS_USE_COMPILER)
set(TBB_MMD_FLAG -MMD)
endif()
# Enable Intel(R) Transactional Synchronization Extensions (-mrtm) and WAITPKG instructions support (-mwaitpkg) on relevant processors
if (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86|AMD64)")
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -mrtm $<$<AND:$<NOT:$<CXX_COMPILER_ID:Intel>>,$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},11.0>>>:-mwaitpkg>)
endif()
if (NOT MINGW)
set(TBB_COMMON_LINK_LIBS dl)
endif()
# Ignore -Werror set through add_compile_options() or added to CMAKE_CXX_FLAGS if TBB_STRICT is disabled.
if (NOT TBB_STRICT AND COMMAND tbb_remove_compile_flag)
tbb_remove_compile_flag(-Werror)
endif()
if (NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL Intel)
# gcc 6.0 and later have -flifetime-dse option that controls elimination of stores done outside the object lifetime
set(TBB_DSE_FLAG $<$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},6.0>>:-flifetime-dse=1>)
endif()
# Workaround for heavy tests and too many symbols in debug (rellocation truncated to fit: R_MIPS_CALL16)
if ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "mips")
set(TBB_TEST_COMPILE_FLAGS ${TBB_TEST_COMPILE_FLAGS} -DTBB_TEST_LOW_WORKLOAD $<$<CONFIG:DEBUG>:-mxgot>)
endif()
if (MINGW)
list(APPEND TBB_COMMON_COMPILE_FLAGS -U__STRICT_ANSI__)
endif()
# For some reason GCC does not instrument code with Thread Sanitizer when lto is enabled and C linker is used.
if (NOT TBB_SANITIZE MATCHES "thread")
set(TBB_IPO_COMPILE_FLAGS $<$<NOT:$<CONFIG:Debug>>:-flto>)
set(TBB_IPO_LINK_FLAGS $<$<NOT:$<CONFIG:Debug>>:-flto>)
endif()
# Disable lto flag
set(TBB_IPO_COMPILE_FLAGS "")
set(TBB_IPO_LINK_FLAGS "")
# TBB malloc settings
set(TBBMALLOC_LIB_COMPILE_FLAGS -fno-rtti -fno-exceptions)
set(TBB_OPENMP_FLAG -fopenmp)

View File

@@ -0,0 +1,26 @@
From 2ef88023ba3eb323f47af89d92ce14a41f311c9e Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Tue, 2 Jan 2024 00:55:20 +0100
Subject: [PATCH] Disable GstPlayer media player version
---
build/cmake/init.cmake | 3 ---
1 file changed, 3 deletions(-)
diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake
index 5ba4b6165b45..1931277f11c8 100644
--- a/build/cmake/init.cmake
+++ b/build/cmake/init.cmake
@@ -501,9 +501,6 @@ if(wxUSE_GUI)
set(wxUSE_GSTREAMER ${GSTREAMER_FOUND})
set(wxUSE_GSTREAMER_PLAYER OFF)
- if(GSTREAMER_PLAYER_INCLUDE_DIRS)
- set(wxUSE_GSTREAMER_PLAYER ON)
- endif()
if(NOT GSTREAMER_FOUND)
message(WARNING "GStreamer not found, wxMediaCtrl won't be available")
--
2.43.0

View File

@@ -0,0 +1,45 @@
From d8dcacd96df849760b41fb71667379a81659dafc Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Fri, 19 Jan 2024 11:34:47 +0100
Subject: [PATCH] wayland: Downgrade runtime errors to warnings
---
src/wl_window.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/src/wl_window.c b/src/wl_window.c
index 985a57116816..19e5dac259d4 100644
--- a/src/wl_window.c
+++ b/src/wl_window.c
@@ -2163,8 +2163,7 @@ void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title)
void _glfwPlatformSetWindowIcon(_GLFWwindow* window,
int count, const GLFWimage* images)
{
- _glfwInputError(GLFW_PLATFORM_ERROR,
- "Wayland: Setting window icon not supported");
+ fprintf(stderr, "!!! Ignoring Wayland error: Setting window icon not supported\n");
}
void _glfwPlatformGetWindowPos(_GLFWwindow* window, int* xpos, int* ypos)
@@ -2172,16 +2171,14 @@ void _glfwPlatformGetWindowPos(_GLFWwindow* window, int* xpos, int* ypos)
// A Wayland client is not aware of its position, so just warn and leave it
// as (0, 0)
- _glfwInputError(GLFW_PLATFORM_ERROR,
- "Wayland: Window position retrieval not supported");
+ fprintf(stderr, "!!! Ignoring Wayland error: Window position retrieval not supported\n");
}
void _glfwPlatformSetWindowPos(_GLFWwindow* window, int xpos, int ypos)
{
// A Wayland client can not set its position, so just warn
- _glfwInputError(GLFW_PLATFORM_ERROR,
- "Wayland: Window position setting not supported");
+ fprintf(stderr, "!!! Ignoring Wayland error: Window position setting not supported\n");
}
void _glfwPlatformGetWindowSize(_GLFWwindow* window, int* width, int* height)
--
2.43.0

View File

@@ -0,0 +1,180 @@
diff --git a/deps/CGAL/CGAL.cmake b/deps/CGAL/CGAL.cmake
index 18fee7c15..7b886e93d 100644
--- a/deps/CGAL/CGAL.cmake
+++ b/deps/CGAL/CGAL.cmake
@@ -5,7 +5,7 @@ orcaslicer_add_cmake_project(
# For whatever reason, this keeps downloading forever (repeats downloads if finished)
URL https://github.com/CGAL/cgal/archive/refs/tags/v5.4.zip
URL_HASH SHA256=d7605e0a5a5ca17da7547592f6f6e4a59430a0bc861948974254d0de43eab4c0
- DEPENDS dep_Boost dep_GMP dep_MPFR
+ DEPENDS dep_GMP dep_MPFR
)
include(GNUInstallDirs)
diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt
index 02a07ffd3..70ba0dcd4 100644
--- a/deps/CMakeLists.txt
+++ b/deps/CMakeLists.txt
@@ -208,11 +208,6 @@ if (NOT ZLIB_FOUND)
include(ZLIB/ZLIB.cmake)
set(ZLIB_PKG dep_ZLIB)
endif ()
-set(PNG_PKG "")
-if (NOT PNG_FOUND)
- include(PNG/PNG.cmake)
- set(PNG_PKG dep_PNG)
-endif ()
set(EXPAT_PKG "")
if (NOT EXPAT_FOUND)
include(EXPAT/EXPAT.cmake)
@@ -220,13 +215,11 @@ if (NOT EXPAT_FOUND)
endif ()
set(DEP_Boost_COMPONENTS system iostreams filesystem thread log locale regex date_time)
-include(Boost/Boost.cmake)
# The order of includes respects the dependencies between libraries
include(Cereal/Cereal.cmake)
include(Qhull/Qhull.cmake)
include(GLEW/GLEW.cmake)
-include(GLFW/GLFW.cmake)
include(OpenCSG/OpenCSG.cmake)
include(TBB/TBB.cmake)
@@ -241,33 +234,22 @@ include(CGAL/CGAL.cmake)
include(NLopt/NLopt.cmake)
-include(OpenSSL/OpenSSL.cmake)
-
set(CURL_PKG "")
if (NOT CURL_FOUND)
include(CURL/CURL.cmake)
set(CURL_PKG dep_CURL)
endif ()
-include(JPEG/JPEG.cmake)
-include(TIFF/TIFF.cmake)
-include(wxWidgets/wxWidgets.cmake)
include(OCCT/OCCT.cmake)
-include(FREETYPE/FREETYPE.cmake)
set(_dep_list
- dep_Boost
dep_TBB
${CURL_PKG}
- dep_wxWidgets
dep_Cereal
dep_NLopt
dep_OpenVDB
dep_OpenCSG
dep_CGAL
- dep_OpenSSL
- dep_GLFW
- ${PNG_PKG}
${ZLIB_PKG}
${EXPAT_PKG}
)
@@ -282,7 +264,6 @@ else()
endif()
list(APPEND _dep_list "dep_OCCT")
-list(APPEND _dep_list "dep_FREETYPE")
add_custom_target(deps ALL DEPENDS ${_dep_list})
diff --git a/deps/CURL/CURL.cmake b/deps/CURL/CURL.cmake
index 9846c7c9c..b5d924e6f 100644
--- a/deps/CURL/CURL.cmake
+++ b/deps/CURL/CURL.cmake
@@ -72,10 +72,6 @@ orcaslicer_add_cmake_project(CURL
${_curl_platform_flags}
)
-# if (APPLE OR (CMAKE_SYSTEM_NAME STREQUAL "Linux"))
- add_dependencies(dep_CURL dep_OpenSSL)
-# endif ()
-
if (MSVC)
add_debug_dep(dep_CURL)
endif ()
diff --git a/deps/OCCT/OCCT.cmake b/deps/OCCT/OCCT.cmake
index 541412b1c..363a9dda2 100644
--- a/deps/OCCT/OCCT.cmake
+++ b/deps/OCCT/OCCT.cmake
@@ -14,7 +14,6 @@ orcaslicer_add_cmake_project(OCCT
#PATCH_COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-OCCT-fix.patch
PATCH_COMMAND git apply --directory ${BINARY_DIR_REL}/dep_OCCT-prefix/src/dep_OCCT --verbose --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-OCCT-fix.patch
#DEPENDS dep_Boost
- #DEPENDS dep_FREETYPE
CMAKE_ARGS
-DBUILD_LIBRARY_TYPE=${library_build_type}
-DUSE_TK=OFF
@@ -30,5 +29,3 @@ orcaslicer_add_cmake_project(OCCT
-DBUILD_MODULE_ModelingData=OFF
-DBUILD_MODULE_Visualization=OFF
)
-
-add_dependencies(dep_OCCT dep_FREETYPE)
diff --git a/deps/OpenVDB/OpenVDB.cmake b/deps/OpenVDB/OpenVDB.cmake
index 7080b8b5d..e8b3695b2 100644
--- a/deps/OpenVDB/OpenVDB.cmake
+++ b/deps/OpenVDB/OpenVDB.cmake
@@ -10,7 +10,7 @@ orcaslicer_add_cmake_project(OpenVDB
# support vs2022, update to 8.2
URL https://github.com/tamasmeszaros/openvdb/archive/a68fd58d0e2b85f01adeb8b13d7555183ab10aa5.zip
URL_HASH SHA256=f353e7b99bd0cbfc27ac9082de51acf32a8bc0b3e21ff9661ecca6f205ec1d81
- DEPENDS dep_TBB dep_Blosc dep_OpenEXR dep_Boost
+ DEPENDS dep_TBB dep_Blosc dep_OpenEXR
CMAKE_ARGS
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
-DOPENVDB_BUILD_PYTHON_MODULE=OFF
@@ -34,4 +34,4 @@ if (MSVC)
WORKING_DIRECTORY "${BINARY_DIR}"
)
endif ()
-endif ()
\ No newline at end of file
+endif ()
diff --git a/deps/TIFF/TIFF.cmake b/deps/TIFF/TIFF.cmake
index b9c004d65..f74775a9d 100644
--- a/deps/TIFF/TIFF.cmake
+++ b/deps/TIFF/TIFF.cmake
@@ -5,7 +5,7 @@ if (APPLE)
orcaslicer_add_cmake_project(TIFF
URL https://gitlab.com/libtiff/libtiff/-/archive/v4.3.0/libtiff-v4.3.0.zip
URL_HASH SHA256=4fca1b582c88319f3ad6ecd5b46320eadaf5eb4ef6f6c32d44caaae4a03d0726
- DEPENDS ${ZLIB_PKG} ${PNG_PKG} dep_JPEG
+ DEPENDS ${ZLIB_PKG} ${PNG_PKG}
CMAKE_ARGS
-Dlzma:BOOL=OFF
-Dwebp:BOOL=OFF
@@ -17,7 +17,7 @@ else()
orcaslicer_add_cmake_project(TIFF
URL https://gitlab.com/libtiff/libtiff/-/archive/v4.1.0/libtiff-v4.1.0.zip
URL_HASH SHA256=c56edfacef0a60c0de3e6489194fcb2f24c03dbb550a8a7de5938642d045bd32
- DEPENDS ${ZLIB_PKG} ${PNG_PKG} dep_JPEG
+ DEPENDS ${ZLIB_PKG} ${PNG_PKG}
CMAKE_ARGS
-Dlzma:BOOL=OFF
-Dwebp:BOOL=OFF
diff --git a/deps/wxWidgets/wxWidgets.cmake b/deps/wxWidgets/wxWidgets.cmake
index 50cf991a6..31f039bd8 100644
--- a/deps/wxWidgets/wxWidgets.cmake
+++ b/deps/wxWidgets/wxWidgets.cmake
@@ -31,7 +31,7 @@ orcaslicer_add_cmake_project(
GIT_REPOSITORY "https://github.com/wxWidgets/wxWidgets"
GIT_TAG ${_wx_git_tag}
PATCH_COMMAND ${_patch_cmd}
- DEPENDS ${PNG_PKG} ${ZLIB_PKG} ${EXPAT_PKG} dep_TIFF dep_JPEG
+ DEPENDS ${PNG_PKG} ${ZLIB_PKG} ${EXPAT_PKG}
CMAKE_ARGS
-DwxBUILD_PRECOMP=ON
${_wx_toolkit}
@@ -62,4 +62,4 @@ orcaslicer_add_cmake_project(
if (MSVC)
add_debug_dep(dep_wxWidgets)
-endif ()
\ No newline at end of file
+endif ()

View File

@@ -0,0 +1,166 @@
From 28f59e8900c3a54d4fe6bce43f62d1c4b0070e2c Mon Sep 17 00:00:00 2001
From: Scott Talbert <swt@techie.net>
Date: Mon, 11 Oct 2021 12:43:52 -0400
Subject: [PATCH] cmake: also link with GLU when using EGL
Fixes #19282
---
build/cmake/init.cmake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake
index e1426afd428f..d5ecda9c98de 100644
--- a/build/cmake/init.cmake
+++ b/build/cmake/init.cmake
@@ -411,7 +411,7 @@ if(wxUSE_GUI)
else()
find_package(OpenGL)
if(WXGTK3 AND OpenGL_EGL_FOUND AND wxUSE_GLCANVAS_EGL)
- set(OPENGL_LIBRARIES OpenGL::OpenGL OpenGL::EGL)
+ set(OPENGL_LIBRARIES OpenGL::OpenGL OpenGL::GLU OpenGL::EGL)
find_package(WAYLANDEGL)
if(WAYLANDEGL_FOUND AND wxHAVE_GDK_WAYLAND)
list(APPEND OPENGL_LIBRARIES ${WAYLANDEGL_LIBRARIES})
--
2.43.0
From 0d6485797e23b5df5dded689fd63c86e3149abc9 Mon Sep 17 00:00:00 2001
From: Maarten Bent <MaartenBent@users.noreply.github.com>
Date: Thu, 29 Apr 2021 21:39:15 +0200
Subject: [PATCH 1/4] CMake: don't define WXUSINGDLL in wx-config for static
library
---
build/cmake/config.cmake | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/build/cmake/config.cmake b/build/cmake/config.cmake
index 91d11acba206..98b505cbef28 100644
--- a/build/cmake/config.cmake
+++ b/build/cmake/config.cmake
@@ -153,10 +153,14 @@ function(wx_write_config)
set(WXCONFIG_CFLAGS "-pthread")
set(WXCONFIG_LDFLAGS "-pthread")
endif()
- set(WXCONFIG_CPPFLAGS "-DWXUSINGDLL")
+ set(WXCONFIG_CPPFLAGS)
+ if(wxBUILD_SHARED)
+ wx_string_append(WXCONFIG_CPPFLAGS " -DWXUSINGDLL")
+ endif()
foreach(flag IN LISTS wxTOOLKIT_DEFINITIONS)
wx_string_append(WXCONFIG_CPPFLAGS " -D${flag}")
endforeach()
+ string(STRIP "${WXCONFIG_CPPFLAGS}" WXCONFIG_CPPFLAGS)
set(WXCONFIG_CXXFLAGS ${WXCONFIG_CFLAGS})
set(WXCONFIG_LDFLAGS_GUI)
set(WXCONFIG_RESFLAGS)
--
2.43.0
From ea6049598d806023cd7157600942ed78b719b74f Mon Sep 17 00:00:00 2001
From: Maarten Bent <MaartenBent@users.noreply.github.com>
Date: Thu, 29 Apr 2021 21:41:06 +0200
Subject: [PATCH 2/4] CMake: add '-l' prefix to all library dependencies
---
build/cmake/config.cmake | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/build/cmake/config.cmake b/build/cmake/config.cmake
index 98b505cbef28..d5ec8cf4fbad 100644
--- a/build/cmake/config.cmake
+++ b/build/cmake/config.cmake
@@ -39,11 +39,10 @@ macro(wx_get_dependencies var lib)
else()
get_target_property(dep_name ${dep} OUTPUT_NAME)
endif()
- set(dep_name "-l${dep_name}")
else()
get_filename_component(dep_name ${dep} NAME)
endif()
- wx_string_append(${var} "${dep_name} ")
+ wx_string_append(${var} "-l${dep_name} ")
endforeach()
string(STRIP ${${var}} ${var})
endif()
--
2.43.0
From 4fae03bdd774b65211d6515104305d1993179eb3 Mon Sep 17 00:00:00 2001
From: Maarten Bent <MaartenBent@users.noreply.github.com>
Date: Tue, 4 May 2021 21:30:29 +0200
Subject: [PATCH 3/4] CMake: Improve adding external libraries to wx-config
Don't add -l to libraries already containing it (for example -lpthread).
Change libraries with format libName.so or libName.a to -lName,
configure also uses -l for these libraries. Account for possible invalid
libraries (Name-NOTFOUND) which could happen with imported libraries,
for example OpenGL::OpenGL.
Closes https://github.com/wxWidgets/wxWidgets/pull/2359
---
build/cmake/config.cmake | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/build/cmake/config.cmake b/build/cmake/config.cmake
index d5ec8cf4fbad..c2aa026ef059 100644
--- a/build/cmake/config.cmake
+++ b/build/cmake/config.cmake
@@ -42,7 +42,13 @@ macro(wx_get_dependencies var lib)
else()
get_filename_component(dep_name ${dep} NAME)
endif()
- wx_string_append(${var} "-l${dep_name} ")
+ if(dep_name MATCHES "^-l(.*)" OR dep_name STREQUAL "libc.so")
+ wx_string_append(${var} "${dep_name} ")
+ elseif(dep_name MATCHES "^lib(.*)(.so|.a)")
+ wx_string_append(${var} "-l${CMAKE_MATCH_1} ")
+ elseif(dep_name)
+ wx_string_append(${var} "-l${dep_name} ")
+ endif()
endforeach()
string(STRIP ${${var}} ${var})
endif()
--
2.43.0
From 8455b3a48baf73e91f34ac9301642832aec9b544 Mon Sep 17 00:00:00 2001
From: Vadim Zeitlin <vadim@wxwidgets.org>
Date: Wed, 25 Aug 2021 23:31:45 +0200
Subject: [PATCH 4/4] Fix wx-config --libs output for static monolithic build
Include all extra libraries we need (except for OpenGL ones, as there is
still a separate library for it, even in monolithic build) in wx-config
--libs output for static monolithic build as the application (may) need
all of them, as all the libraries are part of the single monolithic one
in this case.
It seems that we had an attempt to fix this as far back as in 5719eab2bf
(Fix missing 3rd party builtin libs for static monolithic builds.,
2006-09-17), but it was insufficient as it didn't take the dependencies
of the other GUI libraries (e.g. "media") into account.
Closes #19175.
---
wx-config.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/wx-config.in b/wx-config.in
index 441f88ce9203..e3f7d115bbbd 100755
--- a/wx-config.in
+++ b/wx-config.in
@@ -1218,7 +1218,7 @@ if is_monolithic; then
# We still need the core lib deps for a static build though
if is_static; then
link_deps="${libdir}/libwx_@TOOLCHAIN_NAME@.a"
- wx_libs="$wx_libs $link_deps $ldlibs_core $ldlibs_base"
+ wx_libs="$wx_libs $link_deps $ldlibs_html $ldlibs_media $ldlibs_stc $ldlibs_webview $ldlibs_core $ldlibs_xml $ldlibs_base"
else
wx_libs="$wx_libs -lwx_@TOOLCHAIN_NAME@"
fi
--
2.43.0

View File

@@ -0,0 +1,85 @@
#!/usr/bin/env python3
import Xlib
import Xlib.display
import time
import subprocess
import os
import sys
disp = Xlib.display.Display()
root = disp.screen().root
NET_CLIENT_LIST = disp.intern_atom('_NET_CLIENT_LIST')
def set_theme_variant_by_window_id(id, variant):
# Use subprocess to call
# xprop and set the variant from id.
try:
s = subprocess.call(['xprop', '-f', '_GTK_THEME_VARIANT', '8u', '-set', '_GTK_THEME_VARIANT', variant, '-id', str(id)],
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
if s == 0:
return True
return False
except Exception as ex:
return False
def set_theme_variant_from_win_id_collection(win_id_collection, variant):
# Loop though all of the collected
# window ids and set theme variant
for win_id in win_id_collection:
set_theme_variant_by_window_id(win_id, variant)
def collection_win_id_from_wm_class_name(win_class_name):
collect = []
# Loop though all of the windows
# and collect id's those that match
# win_class: prusa-slicer
for win_id in root.get_full_property(NET_CLIENT_LIST, Xlib.X.AnyPropertyType).value:
try:
win = disp.create_resource_object('window', win_id)
if not win.get_wm_transient_for():
win_class = win.get_wm_class()
if win_id and win_class_name in win_class:
collect.append(
win_id) if win_id not in collect else collect
except Xlib.error.BadWindow:
pass
return collect
if __name__ == '__main__':
if os.environ.get('PRUSA_SLICER_DARK_THEME', 'false') != 'true':
sys.exit(0)
# Listen for X Property Change events.
root.change_attributes(event_mask=Xlib.X.PropertyChangeMask)
# the class name of the slicer window
win_class_name = 'prusa-slicer'
# the variant to set
variant = 'dark'
start = time.time()
while True:
# collect all of the window ids
collect = collection_win_id_from_wm_class_name(win_class_name)
# give PrusaSlicer window 2 secs to
# collect the wanted window ids
# set the theme variant and exit
if time.time() - start <= 2:
# disp.next_event() blocks if no events are
# queued. In combination with while True
# it creates a very simple event loop.
disp.next_event()
set_theme_variant_from_win_id_collection(collect, variant)
else:
break

10
flatpak/umount Executable file
View File

@@ -0,0 +1,10 @@
#!/usr/bin/env sh
if [ $# -eq 0 ]; then
echo "No arguments supplied"
exit 1
fi
DEVICE=$(basename $(findmnt -oSOURCE -n "$@") )
exec /usr/bin/gdbus call -y -d org.freedesktop.UDisks2 -o /org/freedesktop/UDisks2/block_devices/$DEVICE -m org.freedesktop.UDisks2.Filesystem.Unmount "{'b': <'false'>}" 1> /dev/null