From acc75e8a1a077eec2623e4b63a055fbcf3ffaea8 Mon Sep 17 00:00:00 2001 From: supermerill Date: Sun, 13 Oct 2024 20:37:05 +0200 Subject: [PATCH] update workflow & build script (from 2.7) --- .github/workflows/ccpp_mac.yml | 19 +- .github/workflows/ccpp_mac_arm.yml | 19 +- .github/workflows/ccpp_mac_arm_debug.yml | 6 +- .github/workflows/ccpp_mac_arm_rc.yml | 21 +- .github/workflows/ccpp_mac_debug.yml | 8 +- .github/workflows/ccpp_mac_rc.yml | 21 +- .github/workflows/ccpp_ubuntu.yml | 14 +- .github/workflows/ccpp_ubuntu_debug.yml | 17 +- .github/workflows/ccpp_ubuntu_gtk3.yml | 17 +- .github/workflows/ccpp_ubuntu_gtk3_debug.yml | 17 +- .github/workflows/ccpp_ubuntu_gtk3_rc.yml | 17 +- .github/workflows/ccpp_ubuntu_rc.yml | 17 +- .github/workflows/ccpp_win.yml | 2 +- .github/workflows/ccpp_win_debug.yml | 4 +- .github/workflows/ccpp_win_deps.yml | 4 +- .github/workflows/ccpp_win_rc.yml | 2 +- BuildLinux.sh | 444 +++++++++---------- BuildMacOS.sh | 147 +++--- src/platform/msw/Slic3r.rc.in | 2 +- src/platform/msw/gcodeviewer.rc.in | 2 +- src/platform/osx/BuildMacOSImage.sh.in | 103 ++--- src/platform/osx/Info.plist.in | 32 +- src/platform/unix/BuildLinuxImage.sh.in | 80 ++-- src/platform/unix/build_appimage.sh.in | 6 +- 24 files changed, 501 insertions(+), 520 deletions(-) diff --git a/.github/workflows/ccpp_mac.yml b/.github/workflows/ccpp_mac.yml index 33e828139cc..061bc4a9632 100644 --- a/.github/workflows/ccpp_mac.yml +++ b/.github/workflows/ccpp_mac.yml @@ -11,19 +11,30 @@ on: jobs: build: - runs-on: macos-11 + runs-on: macos-12 steps: - uses: actions/checkout@v3 + - name: check autoconf version + run: autoconf --version + - name: update automake for mpfr + run: | + curl -O -L http://ftpmirror.gnu.org/automake/automake-1.16.5.tar.gz + tar -xzf automake-1.16.5.tar.gz + cd automake-* + ./configure + make + sudo make install + automake --version - name: build deps & slicer - run: ./BuildMacOS.sh -i + run: ./BuildMacOS.sh -dsi - name: Upload artifact - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v4.0.0 with: name: nightly_macos.tar path: build/${{ github.event.repository.name }}.tar - name: Upload artifact - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v4.0.0 with: name: nightly_macos.dmg path: build/${{ github.event.repository.name }}.dmg diff --git a/.github/workflows/ccpp_mac_arm.yml b/.github/workflows/ccpp_mac_arm.yml index 090671cc17d..7519c407e3f 100644 --- a/.github/workflows/ccpp_mac_arm.yml +++ b/.github/workflows/ccpp_mac_arm.yml @@ -15,15 +15,28 @@ jobs: steps: - uses: actions/checkout@v3 + - name: install autoconf + run: brew install autoconf + - name: check autoconf version + run: autoconf --version + - name: update automake for mpfr + run: | + curl -O -L http://ftpmirror.gnu.org/automake/automake-1.16.5.tar.gz + tar -xzf automake-1.16.5.tar.gz + cd automake-* + ./configure + make + sudo make install + automake --version - name: build deps & slicer - run: ./BuildMacOS.sh -ia + run: ./BuildMacOS.sh -adsi - name: Upload artifact - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v4.0.0 with: name: nightly_macos_arm_debug.dmg path: build/${{ github.event.repository.name }}.dmg - name: Upload artifact - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v4.0.0 with: name: nightly_arm_macos.tar path: build/${{ github.event.repository.name }}.tar diff --git a/.github/workflows/ccpp_mac_arm_debug.yml b/.github/workflows/ccpp_mac_arm_debug.yml index 10b4e1ce387..9faf0c8df8e 100644 --- a/.github/workflows/ccpp_mac_arm_debug.yml +++ b/.github/workflows/ccpp_mac_arm_debug.yml @@ -15,17 +15,17 @@ jobs: with: ref: 'debug_macos' - name: build deps & slicer - run: ./BuildMacOS.sh -bia + run: ./BuildMacOS.sh -badsi - name: ls build working-directory: ./build run: ls - name: Upload artifact - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v4.0.0 with: name: nightly_macos_arm_debug.dmg path: build/${{ github.event.repository.name }}.dmg - name: Upload artifact - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v4.0.0 with: name: nightly_arm_macos.tar path: build/${{ github.event.repository.name }}.tar diff --git a/.github/workflows/ccpp_mac_arm_rc.yml b/.github/workflows/ccpp_mac_arm_rc.yml index 0fbba7b9c21..b9888593588 100644 --- a/.github/workflows/ccpp_mac_arm_rc.yml +++ b/.github/workflows/ccpp_mac_arm_rc.yml @@ -11,18 +11,31 @@ jobs: runs-on: macos-14 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: ref: 'rc' + - name: install autoconf + run: brew install autoconf + - name: check autoconf version + run: autoconf --version + - name: update automake for mpfr + run: | + curl -O -L http://ftpmirror.gnu.org/automake/automake-1.16.5.tar.gz + tar -xzf automake-1.16.5.tar.gz + cd automake-* + ./configure + make + sudo make install + automake --version - name: build deps & slicer - run: ./BuildMacOS.sh -ia + run: ./BuildMacOS.sh -adsi - name: Upload artifact - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v4.0.0 with: name: rc_arm_macos.dmg path: build/${{ github.event.repository.name }}.dmg - name: Upload artifact - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v4.0.0 with: name: rc_arm_macos.tar path: build/${{ github.event.repository.name }}.tar diff --git a/.github/workflows/ccpp_mac_debug.yml b/.github/workflows/ccpp_mac_debug.yml index ede4c408301..75e7894385a 100644 --- a/.github/workflows/ccpp_mac_debug.yml +++ b/.github/workflows/ccpp_mac_debug.yml @@ -8,24 +8,24 @@ on: jobs: build: - runs-on: macos-11 + runs-on: macos-12 steps: - uses: actions/checkout@v2 with: ref: 'debug_macos' - name: build deps & slicer - run: ./BuildMacOS.sh -bi + run: ./BuildMacOS.sh -bdsi - name: tar the pack working-directory: ./build run: ls - name: Upload artifact - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v4.0.0 with: name: nightly_macos_debug.dmg path: build/${{ github.event.repository.name }}.dmg - name: Upload artifact - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v4.0.0 with: name: nightly_macos.tar path: build/${{ github.event.repository.name }}.tar diff --git a/.github/workflows/ccpp_mac_rc.yml b/.github/workflows/ccpp_mac_rc.yml index d8c77fb8582..de70cb1dff8 100644 --- a/.github/workflows/ccpp_mac_rc.yml +++ b/.github/workflows/ccpp_mac_rc.yml @@ -8,21 +8,32 @@ on: jobs: build: - runs-on: macos-11 + runs-on: macos-12 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: ref: 'rc' + - name: check autoconf version + run: autoconf --version + - name: update automake for mpfr + run: | + curl -O -L http://ftpmirror.gnu.org/automake/automake-1.16.5.tar.gz + tar -xzf automake-1.16.5.tar.gz + cd automake-* + ./configure + make + sudo make install + automake --version - name: build deps & slicer - run: ./BuildMacOS.sh -i + run: ./BuildMacOS.sh -dsi - name: Upload artifact - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v4.0.0 with: name: rc_macos.tar path: build/${{ github.event.repository.name }}.tar - name: Upload artifact - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v4.0.0 with: name: rc_macos.dmg path: build/${{ github.event.repository.name }}.dmg diff --git a/.github/workflows/ccpp_ubuntu.yml b/.github/workflows/ccpp_ubuntu.yml index 363cdba227c..ce719acb181 100644 --- a/.github/workflows/ccpp_ubuntu.yml +++ b/.github/workflows/ccpp_ubuntu.yml @@ -30,21 +30,15 @@ jobs: run: sudo apt update - name: install gtk2 glew run: sudo apt install libgtk2.0-dev libglew-dev libudev-dev libdbus-1-dev gettext - - name: build deps & slicer - run: ./BuildLinux.sh -dgs - - name: make .pot - working-directory: ./build - run: make gettext_make_pot - - name: build tar & appimage - working-directory: ./build - run: src/BuildLinuxImage.sh -i + - name: build deps & slicer, tar & appimage + run: ./BuildLinux.sh -dgsi - name: Upload artifact - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v4.0.0 with: name: nightly_linux_gtk2.tar path: build/${{ github.event.repository.name }}.tar - name: Upload appimage - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v4.0.0 with: name: ${{ github.event.repository.name }}-gtk2.AppImage path: build/${{ github.event.repository.name }}_ubu64.AppImage diff --git a/.github/workflows/ccpp_ubuntu_debug.yml b/.github/workflows/ccpp_ubuntu_debug.yml index 824b34b4af4..7c45ea3a3c6 100644 --- a/.github/workflows/ccpp_ubuntu_debug.yml +++ b/.github/workflows/ccpp_ubuntu_debug.yml @@ -18,9 +18,6 @@ jobs: uses: jwlawson/actions-setup-cmake@v1.13 with: cmake-version: '3.16.x' - - name: update submodule profiles - working-directory: ./resources/profiles - run: git submodule update --init - name: change date in version run: sed -i "s/+UNKNOWN/_$(date '+%F')/" version.inc - name: update clock @@ -29,21 +26,15 @@ jobs: run: sudo apt update - name: install gtk2 glew run: sudo apt install libgtk2.0-dev libglew-dev libudev-dev libdbus-1-dev libssl-dev libcurl4-openssl-dev gettext - - name: build deps & slicer - run: ./BuildLinux.sh -bdgs - - name: make .pot - working-directory: ./build - run: make gettext_make_pot - - name: build tar & appimage - working-directory: ./build - run: src/BuildLinuxImage.sh -i + - name: build deps & slicer, tar & appimage + run: ./BuildLinux.sh -bdgsi - name: Upload artifact - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v4.0.0 with: name: nightly_linux_gtk2.tar path: build/${{ github.event.repository.name }}.tar - name: Upload appimage - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v4.0.0 with: name: ${{ github.event.repository.name }}-gtk2.AppImage path: build/${{ github.event.repository.name }}_ubu64.AppImage diff --git a/.github/workflows/ccpp_ubuntu_gtk3.yml b/.github/workflows/ccpp_ubuntu_gtk3.yml index 6bcf54eb255..42b0916e67d 100644 --- a/.github/workflows/ccpp_ubuntu_gtk3.yml +++ b/.github/workflows/ccpp_ubuntu_gtk3.yml @@ -19,9 +19,6 @@ jobs: uses: jwlawson/actions-setup-cmake@v1.13 with: cmake-version: '3.16.x' - - name: update submodule profiles - working-directory: ./resources/profiles - run: git submodule update --init - name: change date in version run: sed -i "s/+UNKNOWN/_$(date '+%F')/" version.inc - name: update clock @@ -30,21 +27,15 @@ jobs: run: sudo apt update - name: install gtk3 glew run: sudo apt install libgtk-3-dev libglew-dev libudev-dev libdbus-1-dev gettext - - name: build deps & slicer - run: ./BuildLinux.sh -ds - - name: make .pot - working-directory: ./build - run: make gettext_make_pot - - name: build tar & appimage - working-directory: ./build - run: src/BuildLinuxImage.sh -i + - name: build deps & slicer, tar & appimage + run: ./BuildLinux.sh -dsi - name: Upload artifact - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v4.0.0 with: name: nightly_linux_gtk3.tar path: build/${{ github.event.repository.name }}.tar - name: Upload appimage - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v4.0.0 with: name: ${{ github.event.repository.name }}-gtk3.AppImage path: build/${{ github.event.repository.name }}_ubu64.AppImage diff --git a/.github/workflows/ccpp_ubuntu_gtk3_debug.yml b/.github/workflows/ccpp_ubuntu_gtk3_debug.yml index c8c4d69bd55..b9ec06dc550 100644 --- a/.github/workflows/ccpp_ubuntu_gtk3_debug.yml +++ b/.github/workflows/ccpp_ubuntu_gtk3_debug.yml @@ -18,9 +18,6 @@ jobs: uses: jwlawson/actions-setup-cmake@v1.13 with: cmake-version: '3.16.x' - - name: update submodule profiles - working-directory: ./resources/profiles - run: git submodule update --init - name: change date in version run: sed -i "s/+UNKNOWN/_$(date '+%F')/" version.inc - name: update clock @@ -29,21 +26,15 @@ jobs: run: sudo apt update - name: install gtk3 glew run: sudo apt install libgtk-3-dev libglew-dev libudev-dev libdbus-1-dev libssl-dev libcurl4-openssl-dev gettext - - name: build deps & slicer - run: ./BuildLinux.sh -bds - - name: make .pot - working-directory: ./build - run: make gettext_make_pot - - name: build tar & appimage - working-directory: ./build - run: src/BuildLinuxImage.sh -i + - name: build deps & slicer, tar & appimage + run: ./BuildLinux.sh -bdsi - name: Upload artifact - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v4.0.0 with: name: nightly_linux_gtk3.tar path: build/${{ github.event.repository.name }}.tar - name: Upload appimage - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v4.0.0 with: name: ${{ github.event.repository.name }}-gtk3.AppImage path: build/${{ github.event.repository.name }}_ubu64.AppImage diff --git a/.github/workflows/ccpp_ubuntu_gtk3_rc.yml b/.github/workflows/ccpp_ubuntu_gtk3_rc.yml index 70c07c82277..911373382b0 100644 --- a/.github/workflows/ccpp_ubuntu_gtk3_rc.yml +++ b/.github/workflows/ccpp_ubuntu_gtk3_rc.yml @@ -20,9 +20,6 @@ jobs: uses: jwlawson/actions-setup-cmake@v1.13 with: cmake-version: '3.16.x' - - name: update submodule profiles - working-directory: ./resources/profiles - run: git submodule update --init - name: change date in version run: sed -i "s/+UNKNOWN/_$(date '+%F')/" version.inc - name: update clock @@ -31,21 +28,15 @@ jobs: run: sudo apt update - name: install gtk3 glew run: sudo apt install libgtk-3-dev libglew-dev libudev-dev libdbus-1-dev gettext - - name: build deps & slicer - run: ./BuildLinux.sh -ds - - name: make .pot - working-directory: ./build - run: make gettext_make_pot - - name: build tar & appimage - working-directory: ./build - run: src/BuildLinuxImage.sh -i + - name: build deps & slicer, tar & appimage + run: ./BuildLinux.sh -dsi - name: Upload artifact - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v4.0.0 with: name: rc_linux_gtk3.tar path: build/${{ github.event.repository.name }}.tar - name: Upload appimage - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v4.0.0 with: name: rc-${{ github.event.repository.name }}-gtk3.AppImage path: build/${{ github.event.repository.name }}_ubu64.AppImage diff --git a/.github/workflows/ccpp_ubuntu_rc.yml b/.github/workflows/ccpp_ubuntu_rc.yml index a8412e7a131..0d935098a48 100644 --- a/.github/workflows/ccpp_ubuntu_rc.yml +++ b/.github/workflows/ccpp_ubuntu_rc.yml @@ -18,9 +18,6 @@ jobs: uses: jwlawson/actions-setup-cmake@v1.13 with: cmake-version: '3.16.x' - - name: update submodule profiles - working-directory: ./resources/profiles - run: git submodule update --init - name: change date in version run: sed -i "s/+UNKNOWN//" version.inc - name: update clock @@ -29,21 +26,15 @@ jobs: run: sudo apt update - name: install gtk2 glew run: sudo apt install libgtk2.0-dev libglew-dev libudev-dev libdbus-1-dev gettext - - name: build deps & slicer - run: ./BuildLinux.sh -dgs - - name: make .pot - working-directory: ./build - run: make gettext_make_pot - - name: build tar & appimage - working-directory: ./build - run: src/BuildLinuxImage.sh -i + - name: build deps & slicer, tar & appimage + run: ./BuildLinux.sh -dgsi - name: Upload artifact - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v4.0.0 with: name: rc_linux_gtk2.tar path: build/${{ github.event.repository.name }}.tar - name: Upload appimage - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v4.0.0 with: name: rc-${{ github.event.repository.name }}-gtk2.AppImage path: build/${{ github.event.repository.name }}_ubu64.AppImage diff --git a/.github/workflows/ccpp_win.yml b/.github/workflows/ccpp_win.yml index 6ede51d046f..414d8d86af3 100644 --- a/.github/workflows/ccpp_win.yml +++ b/.github/workflows/ccpp_win.yml @@ -99,7 +99,7 @@ jobs: # shell: cmd # run: '"C:/Program Files/7-Zip/7z.exe" a -tzip nightly.zip *' - name: Upload artifact - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v4.0.0 with: name: nightly_win64 path: build/package/ diff --git a/.github/workflows/ccpp_win_debug.yml b/.github/workflows/ccpp_win_debug.yml index fe6abf9cb46..f17b973d9be 100644 --- a/.github/workflows/ccpp_win_debug.yml +++ b/.github/workflows/ccpp_win_debug.yml @@ -69,7 +69,7 @@ jobs: cmake .. -G "Visual Studio 16 2019" -A x64 msbuild /m ALL_BUILD.vcxproj - name: Upload artifact - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v4.0.0 with: name: deps_win path: ./deps/build/destdir/ @@ -160,7 +160,7 @@ jobs: # shell: cmd # run: '"C:/Program Files/7-Zip/7z.exe" a -tzip nightly.zip *' - name: Upload artifact - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v4.0.0 with: name: nightly_win64_debug path: build/package/ diff --git a/.github/workflows/ccpp_win_deps.yml b/.github/workflows/ccpp_win_deps.yml index 9155f24fd8f..fdb790c9f2d 100644 --- a/.github/workflows/ccpp_win_deps.yml +++ b/.github/workflows/ccpp_win_deps.yml @@ -20,7 +20,7 @@ jobs: cmake .. -G "Visual Studio 16 2019" -A x64 msbuild /m ALL_BUILD.vcxproj - name: Upload artifact - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v4.0.0 with: name: deps_win path: ./deps/build/destdir/ @@ -112,7 +112,7 @@ jobs: # shell: cmd # run: '"C:/Program Files/7-Zip/7z.exe" a -tzip nightly.zip *' - name: Upload artifact - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v4.0.0 with: name: nightly_win64 path: build/package/ diff --git a/.github/workflows/ccpp_win_rc.yml b/.github/workflows/ccpp_win_rc.yml index ea5f0563844..25691de7966 100644 --- a/.github/workflows/ccpp_win_rc.yml +++ b/.github/workflows/ccpp_win_rc.yml @@ -99,7 +99,7 @@ jobs: # shell: cmd # run: '"C:/Program Files/7-Zip/7z.exe" a -tzip nightly.zip *' - name: Upload artifact - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v4.0.0 with: name: rc_win64 path: build/package/ diff --git a/BuildLinux.sh b/BuildLinux.sh index 6090315dea9..5c3eeb9da53 100755 --- a/BuildLinux.sh +++ b/BuildLinux.sh @@ -9,264 +9,229 @@ # # 20 Nov 2023, wschadow, branding and minor changes # 01 Jan 2024, wschadow, added build options +# 08 august 2024, various people, many updates # -set -e # exit on first error - export ROOT=`pwd` export NCORES=`nproc` +FOUND_GTK2=$(dpkg -l libgtk* | grep gtk2) +FOUND_GTK3=$(dpkg -l libgtk* | grep gtk-3) -function usage() { - echo "Usage: ./BuildLinux.sh [-h][-u][-w][-g][-b][-r][-d][-s][-l][-t][-i]" +unset name +while getopts ":hwdrigbsyu" opt; do + case ${opt} in + u ) + UPDATE_LIB="1" + ;; + i ) + BUILD_IMAGE="1" + ;; + d ) + BUILD_DEPS="1" + ;; + s ) + BUILD_SLIC3R="1" + ;; + t) + BUILD_TESTS="1" + ;; + b ) + BUILD_DEBUG="1" + ;; + g ) + FOUND_GTK3="" + ;; + w ) + BUILD_WIPE="1" + ;; + r ) + BUILD_CLEANDEPEND="1" + ;; + h ) echo "Usage: ./BuildLinux.sh [-h][-w][-d][-r][-i][-g][-b][-s][-t][-u]" + echo " -h: this message" + echo " -w: wipe build directories before building" + echo " -d: build deps (optional)" + echo " -r: clean dependencies building files (reduce disk usage)" + echo " -i: Generate appimage (optional)" + echo " -g: force gtk2 build" + echo " -b: build with debug symbols" + echo " -s: build Slic3r/SuperSlicer" + echo " -t: build tests (in combination with -s)" + echo " -u: only update clock & dependency packets (optional and need sudo)" + echo "For a first use, you want to 'sudo ./BuildLinux.sh -u'" + echo " and then './BuildLinux.sh -dsi'" + exit 0 + ;; + esac +done + +if [ $OPTIND -eq 1 ] +then + echo "Usage: ./BuildLinux.sh [-h][-w][-d][-r][-i][-g][-b][-s][-t][-u]" echo " -h: this message" - echo " -u: only update dependency packets (optional and need sudo)" echo " -w: wipe build directories before building" + echo " -d: build deps (optional)" + echo " -r: clean dependencies building files (reduce disk usage)" + echo " -i: Generate appimage (optional)" echo " -g: force gtk2 build" - echo " -b: build in debug mode" - echo " -r: clean dependencies" - echo " -d: build deps" - echo " -s: build SuperSlicer" - echo " -l: update language .pot file" + echo " -b: build with debug symbols" + echo " -s: build Slic3r/SuperSlicer" echo " -t: build tests (in combination with -s)" - echo " -i: generate .tgz and appimage (optional)" - echo -e "\n For a first use, you want to 'sudo ./BuildLinux.sh -u'" - echo -e " and then './BuildLinux.sh -dsi'\n" + echo " -u: only update clock & dependency packets (optional and need sudo)" + echo "For a first use, you want to 'sudo ./BuildLinux.sh -u'" + echo " and then './BuildLinux.sh -dsi'" exit 0 -} - -function check_operating_system() { -# check operating system - - OS_FOUND=$( command -v uname) - - case $( "${OS_FOUND}" | tr '[:upper:]' '[:lower:]') in - linux*) - TARGET_OS="linux" - ;; - msys*|cygwin*|mingw*) - # or possible 'bash on windows' - TARGET_OS='windows' - ;; - nt|win*) - TARGET_OS='windows' - ;; - darwin) - TARGET_OS='macos' - ;; - *) - TARGET_OS='unknown' - ;; - esac - - echo - if [ $TARGET_OS == "linux" ]; then - if [ $(uname -m) == "x86_64" ]; then - echo -e "$(tput setaf 2)Linux 64-bit found$(tput sgr0)\n" - Processor="64" - elif [[ $(uname -m) == "i386" || $(uname -m) == "i686" ]]; then - echo "$(tput setaf 2)Linux 32-bit found$(tput sgr0)\n" - Processor="32" - else - echo "$(tput setaf 1)Unsupported OS: Linux $(uname -m)" - exit -1 - fi - else - echo -e "$(tput setaf 1)This script doesn't support your Operating system!" - echo -e "Please use Linux 64-bit or Windows 10 64-bit with Linux subsystem / git-bash.$(tput sgr0)\n" - exit -1 - fi -} - -function check_available_memory_and_disk() { - FREE_MEM_GB=$(free -g -t | grep 'Mem:' | rev | cut -d" " -f1 | rev) - MIN_MEM_GB=5 - - FREE_DISK_KB=$(df -k . | tail -1 | awk '{print $4}') - MIN_DISK_KB=$((10 * 1024 * 1024)) +fi - if [ ${FREE_MEM_GB} -le ${MIN_MEM_GB} ]; then - echo -e "\nERROR: SuperSlicer Builder requires at least ${MIN_MEM_GB}G of 'available' mem (systen has only ${FREE_MEM_GB}G available)" - echo && free -h && echo - exit 2 +if [[ -n "$FOUND_GTK3" ]] +then + echo "Found GTK3" +else + if [[ -n "$FOUND_GTK2" ]] + then + echo "Found GTK2" fi +fi - if [[ ${FREE_DISK_KB} -le ${MIN_DISK_KB} ]]; then - echo -e "\nERROR: SuperSlicer Builder requires at least $(echo ${MIN_DISK_KB} |awk '{ printf "%.1fG\n", $1/1024/1024; }') (systen has only $(echo ${FREE_DISK_KB} | awk '{ printf "%.1fG\n", $1/1024/1024; }') disk free)" - echo && df -h . && echo - exit 1 +if [[ -n "$UPDATE_LIB" ]] +then + echo -n -e "Updating linux ...\n" + hwclock -s + apt update + apt install g++ m4 + if [[ -z "$FOUND_GTK3" ]] + then + echo -e "\nInstalling: libgtk2.0-dev libglew-dev libudev-dev libdbus-1-dev cmake git gettext fuse\n" + apt install libgtk2.0-dev libglew-dev libudev-dev libdbus-1-dev cmake git gettext fuse + else + echo -e "\nFind libgtk-3, installing: libgtk-3-dev libglew-dev libudev-dev libdbus-1-dev cmake git gettext fuse\n" + apt install libgtk-3-dev libglew-dev libudev-dev libdbus-1-dev cmake git gettext fuse fi -} - -function check_distribution() { - DISTRIBUTION=$(awk -F= '/^ID=/ {print $2}' /etc/os-release) - # treat ubuntu as debian - if [ "${DISTRIBUTION}" == "ubuntu" ] + # for ubuntu 22.04: + ubu_version="$(cat /etc/issue)" + if [[ $ubu_version == "Ubuntu 22.04"* ]] then - DISTRIBUTION="debian" + apt install curl libssl-dev libcurl4-openssl-dev m4 fi - echo -e "$(tput setaf 2)${DISTRIBUTION} found$(tput sgr0)\n" - if [ ! -f ./src/platform/unix/linux.d/${DISTRIBUTION} ] + if [[ -n "$BUILD_DEBUG" ]] then - echo "Your distribution does not appear to be currently supported by these build scripts" - exit 1 + echo -e "\nInstalling: libssl-dev libcurl4-openssl-dev\n" + apt install libssl-dev libcurl4-openssl-dev fi -} - -#======================================================================================= - -check_operating_system -check_distribution -check_available_memory_and_disk - -#--------------------------------------------------------------------------------------- -#check command line arguments -unset name -while getopts ":hugbdrsltiw" opt; do - case ${opt} in - u ) - UPDATE_LIB="1" - ;; - i ) - BUILD_IMAGE="1" - ;; - d ) - BUILD_DEPS="1" - ;; - s ) - BUILD_SUPERSLICER="1" - ;; - l ) - UPDATE_POTFILE="1" - ;; - t ) - BUILD_TESTS="1" - ;; - b ) - BUILD_DEBUG="1" - ;; - g ) - FORCE_GTK2="-g" - ;; - r ) - BUILD_CLEANDEPEND="1" - ;; - w ) - BUILD_WIPE="1" - ;; - h ) usage -# exit 0 - ;; - * ) usage -# exit 0 - ;; - esac -done - + echo -e "done\n" + exit 0 +fi -if [ ${OPTIND} -eq 1 ] +FOUND_GTK2_DEV=$(dpkg -l libgtk* | grep gtk2.0-dev) +FOUND_GTK3_DEV=$(dpkg -l libgtk* | grep gtk-3-dev) +echo "FOUND_GTK2=$FOUND_GTK2)" +if [[ -z "$FOUND_GTK2_DEV" ]] +then +if [[ -z "$FOUND_GTK3_DEV" ]] then - usage + echo "Error, you must install the dependencies before." + echo "Use option -u with sudo" exit 0 fi +fi -#--------------------------------------------------------------------------------------- +echo "[1/9] Updating submodules..." +{ + # update submodule profiles + pushd resources/profiles + git submodule update --init + popd +} -# check installation of required packages or update when -u is set +echo "[2/9] Changing date in version..." +{ + # change date in version + sed -i "s/+UNKNOWN/_$(date '+%F')/" version.inc +} +echo "done" -source ./src/platform/unix/linux.d/${DISTRIBUTION} +# mkdir build +if [ ! -d "build" ] +then + mkdir build +fi -if [[ -n "$FORCE_GTK2" ]] +# mkdir in deps +if [ ! -d "deps/build" ] then - FOUND_GTK2=$(dpkg -l libgtk* | grep gtk2) - FOUND_GTK2_DEV=$(dpkg -l libgtk* | grep gtk2.0-dev) - echo -e "\nFOUND_GTK2:\n$FOUND_GTK2\n" -else - FOUND_GTK3=$(dpkg -l libgtk* | grep gtk-3) - FOUND_GTK3_DEV=$(dpkg -l libgtk* | grep gtk-3-dev) - echo -e "\nFOUND_GTK3:\n$FOUND_GTK3)\n" + mkdir deps/build fi if [[ -n "$BUILD_DEPS" ]] then if [[ -n $BUILD_WIPE ]] then - echo -e "\n wiping deps/build directory...\n" + echo -e "\n wiping deps/build directory ...\n" rm -fr deps/build echo -e " ... done\n" fi - # mkdir build in deps + # mkdir in deps if [ ! -d "deps/build" ] then - mkdir deps/build + mkdir deps/build fi - echo -e "[1/9] Configuring dependencies ...\n" + echo "[3/9] Configuring dependencies..." BUILD_ARGS="" if [[ -n "$FOUND_GTK3_DEV" ]] then BUILD_ARGS="-DDEP_WX_GTK3=ON" - else - BUILD_ARGS="-DDEP_WX_GTK3=OFF" fi if [[ -n "$BUILD_DEBUG" ]] then # have to build deps with debug & release or the cmake won't find evrything it needs - if [ ! -d "deps/build/release" ] - then mkdir deps/build/release - fi - pushd deps/build/release > /dev/null - cmake ../.. -DDESTDIR="../destdir" $BUILD_ARGS - popd > /dev/null + pushd deps/build/release + cmake ../.. -DDESTDIR="../destdir" $BUILD_ARGS + make -j$NCORES + popd BUILD_ARGS="${BUILD_ARGS} -DCMAKE_BUILD_TYPE=Debug" fi - - pushd deps/build > /dev/null - cmake .. $BUILD_ARGS - echo -e "\n ... done\n" - - echo -e "\n[2/9] Building dependencies...\n" - # make deps - make -j$NCORES - echo -e "\n ... done\n" - - # rename wxscintilla - echo "[3/9] Renaming wxscintilla library..." - pushd destdir/usr/local/lib > /dev/null - if [[ -z "$FOUND_GTK3_DEV" ]] - then - cp libwxscintilla-3.1.a libwx_gtk2u_scintilla-3.1.a - else - cp libwxscintilla-3.1.a libwx_gtk3u_scintilla-3.1.a - fi - popd > /dev/null - popd > /dev/null - echo -e "\n ... done\n" + + # cmake deps + pushd deps/build + cmake .. $BUILD_ARGS + echo "done" + + # make deps + echo "[4/9] Building dependencies..." + make -j$NCORES + echo "done" + + # rename wxscintilla + echo "[5/9] Renaming wxscintilla library..." + pushd destdir/usr/local/lib + if [[ -z "$FOUND_GTK3_DEV" ]] + then + cp libwxscintilla-3.2.a libwx_gtk2u_scintilla-3.2.a + else + cp libwxscintilla-3.2.a libwx_gtk3u_scintilla-3.2.a + fi + popd + echo "done" + + popd + echo "done" fi +# clean deps if [[ -n "$BUILD_CLEANDEPEND" ]] then - echo -e "[4/9] Cleaning dependencies...\n" - pushd deps/build > /dev/null + echo -e "[6/9] Cleaning dependencies...\n" + pushd deps/build + pwd rm -fr dep_* popd > /dev/null - echo -e " ... done\n" + echo -e "\n ... done\n" fi -if [[ -n "$BUILD_SUPERSLICER" ]] +if [[ -n "$BUILD_SLIC3R" ]] then - echo -e "[5/9] Configuring SuperSlicer ...\n" - if [[ -n $BUILD_WIPE ]] - then - echo -e "\n wiping build directory ...\n" - rm -fr build - echo -e "\n ... done" - fi - # mkdir build - if [ ! -d "build" ] - then - mkdir build - fi - + echo "[7/9] Configuring Slic3r..." BUILD_ARGS="" if [[ -n "$FOUND_GTK3_DEV" ]] then @@ -276,48 +241,47 @@ then then BUILD_ARGS="${BUILD_ARGS} -DCMAKE_BUILD_TYPE=Debug" fi - - if [[ -n "$BUILD_TESTS" ]] - then - BUILD_ARGS="${BUILD_ARGS} -DCMAKE_BUILD_TESTS=1" - else - BUILD_ARGS="${BUILD_ARGS} -DCMAKE_BUILD_TESTS=0" - fi - - # cmake - pushd build > /dev/null - cmake .. -DCMAKE_PREFIX_PATH="$PWD/../deps/build/destdir/usr/local" -DSLIC3R_STATIC=1 ${BUILD_ARGS} - echo " ... done" - # make SuperSlicer - echo -e "\n[6/9] Building SuperSlicer ...\n" - make -j$NCORES Slic3r - make -j$NCORES OCCTWrapper - echo -e "\n ... done" - - echo -e "\n[7/9] Generating language files ...\n" - #make .mo - if [[ -n "$UPDATE_POTFILE" ]] + if [[ -n "$BUILD_TESTS" ]] then - make gettext_make_pot + BUILD_ARGS="${BUILD_ARGS} -DCMAKE_BUILD_TESTS=1" + else + BUILD_ARGS="${BUILD_ARGS} -DCMAKE_BUILD_TESTS=0" fi - make gettext_po_to_mo - - popd > /dev/null - echo -e "\n ... done" - - # Give proper permissions to script - chmod 755 $ROOT/build/src/BuildLinuxImage.sh - - pushd build > /dev/null - $ROOT/build/src/BuildLinuxImage.sh -a $FORCE_GTK2 - popd > /dev/null + + # cmake + pushd build + cmake .. -DCMAKE_PREFIX_PATH="$PWD/../deps/build/destdir/usr/local" -DSLIC3R_STATIC=1 ${BUILD_ARGS} + echo "done" + + #make avrdude-slic3r + make avrdude-slic3r + + # make Slic3r + echo "[8/9] Building Slic3r..." + make -j$NCORES Slic3r + + # make .mo + make gettext_po_to_mo + + # make OCCTWrapper.so + make OCCTWrapper + + # update the pot + make gettext_make_pot + popd + echo "done" fi -if [[ -n "$BUILD_IMAGE" ]] -then - # Give proper permissions to script - chmod 755 $ROOT/build/src/BuildLinuxImage.sh - pushd build > /dev/null - $ROOT/build/src/BuildLinuxImage.sh -i $FORCE_GTK2 - popd > /dev/null -fi +# Give proper permissions to script +chmod 755 $ROOT/build/src/BuildLinuxImage.sh + +echo "[9/9] Generating Linux app..." + pushd build + if [[ -n "$BUILD_IMAGE" ]] + then + $ROOT/build/src/BuildLinuxImage.sh -i + else + $ROOT/build/src/BuildLinuxImage.sh + fi + popd +echo "done" diff --git a/BuildMacOS.sh b/BuildMacOS.sh index f7da5905d47..46701bbbcb0 100755 --- a/BuildMacOS.sh +++ b/BuildMacOS.sh @@ -9,10 +9,13 @@ # # 20 Nov 2023, wschadow, branding and minor changes # 01 Jan 2024, wschadow, added build options +# 08 august 2024, various people, many updates, allow arm native build. # export ROOT=`pwd` export NCORES=`sysctl -n hw.ncpu` +export CMAKE_INSTALLED=`which cmake` +export ARCH=$(uname -m) OS_FOUND=$( command -v uname) @@ -39,32 +42,29 @@ esac echo if [ $TARGET_OS == "macos" ]; then if [ $(uname -m) == "x86_64" ]; then - echo -e "$(tput setaf 2)macOS x86_64 found$(tput sgr0)\n" - Processor="64" - elif [[ $(uname -m) == "i386" || $(uname -m) == "i686" ]]; then - echo "$(tput setaf 2)macOS arm64 found$(tput sgr0)\n" - Processor="64" + echo -e "$(output setaf 2)macOS x86_64 found$(output sgr0)\n" + Processor="x86_64" + elif [[ $(uname -m) == "i386" || $(uname -m) == "i686" || $(uname -m) == "arm64" ]]; then + echo "$(output setaf 2)macOS arm64 found$(output sgr0)\n" + Processor="arm64" else - echo "$(tput setaf 1)Unsupported OS: macOS $(uname -m)" + echo "$(output setaf 1)Unsupported OS: macOS $(uname -m)" exit -1 fi else - echo -e "$(tput setaf 1)This script doesn't support your Operating system!" - echo -e "Please use a macOS.$(tput sgr0)\n" + echo -e "$(output setaf 1)This script doesn't support your Operating system!" + echo -e "Please use a macOS.$(output sgr0)\n" exit -1 fi # Check if CMake is installed -export CMAKE_INSTALLED=`which cmake` if [[ -z "$CMAKE_INSTALLED" ]] then echo "Can't find CMake. Either is not installed or not in the PATH. Aborting!" exit -1 fi -BUILD_ARCH=$(uname -m) - -while getopts ":idaxbhcsltwr" opt; do +while getopts ":idaxbhcstwr" opt; do case ${opt} in i ) BUILD_IMAGE="1" @@ -84,32 +84,32 @@ while getopts ":idaxbhcsltwr" opt; do BUILD_DEBUG="1" ;; s ) - BUILD_SUPERSLICER="1" + BUILD_SLIC3R="1" ;; - l ) - UPDATE_POTFILE="1" + t) + BUILD_TESTS="1" ;; c) BUILD_XCODE="1" ;; w ) BUILD_WIPE="1" - ;; + ;; r ) BUILD_CLEANDEPEND="1" - ;; - h ) echo "Usage: ./BuildMacOS.sh [-h][-w][-a][-r][-x][-b][-c][-d][-s][-l][-t][-i]" + ;; + h ) echo "Usage: ./BuildMacOS.sh [-h][-w][-d][-r][-a][-x][-b][-c][-s][-t][-i]" echo " -h: this message" - echo " -w: wipe build directories bfore building" + echo " -w: wipe build directories before building" + echo " -d: build dependencies" + echo " -r: clean dependencies building files (reduce disk usage)" echo " -a: build for arm64 (Apple Silicon)" - echo " -r: clean dependencies" echo " -x: build for x86_64 (Intel)" echo " -b: build with debug symbols" echo " -c: build for XCode" - echo " -d: build dependencies" - echo " -s: build SuperSlicer" + echo " -s: build Slic3r/SuperSlicer" echo " -t: build tests (in combination with -s)" - echo " -i: generate .tgz and DMG image (optional)\n" + echo " -i: generate DMG image (optional)\n" exit 0 ;; esac @@ -117,23 +117,60 @@ done if [ $OPTIND -eq 1 ] then - echo "Usage: ./BuildLinux.sh [-h][-w][-a][-r][-x][-b][-c][-d][-s][-l][-t][-i]" + echo "Usage: ./BuildLinux.sh [-h][-w][-d][-r][-a][-x][-b][-c][-s][-t][-i]" echo " -h: this message" - echo " -w: wipe build directories bfore building" - echo " -a: Build for arm64 (Apple Silicon)" - echo " -r: clean dependencies" + echo " -w: wipe build directories before building" + echo " -d: build dependencies" + echo " -r: clean dependencies building files (reduce disk usage)" + echo " -a: build for arm64 (Apple Silicon)" echo " -x: build for x86_64 (Intel)" echo " -b: build with debug symbols" echo " -c: build for XCode" - echo " -d: build dependencies" - echo " -s: build SuperSlicer" + echo " -s: build Slic3r/SuperSlicer" echo " -t: build tests (in combination with -s)" - echo -e " -i: Generate .tgz and DMG image (optional)\n" + echo -e " -i: Generate DMG image (optional)\n" exit 0 fi -export $BUILD_ARCH +echo "Build architecture: ${BUILD_ARCH}" + +echo "\n/Applications:\n" +ls /Applications +echo "\n/Applications/Xcode_13.2.1.app:\n" +ls /Applications/Xcode_13.2.1.app +echo "\n/Applications/Xcode_13.2.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs:\n" +ls /Applications/Xcode_13.2.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs +echo "\n/Applications/Xcode_13.2.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/lib:\n" +ls /Applications/Xcode_13.2.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/lib + +# Iconv: /Applications/Xcode_13.2.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/lib/libiconv.tbd +echo "\nbrew --prefix libiconv:\n" +brew --prefix libiconv +echo "\nbrew --prefix zstd:\n" +brew --prefix zstd export LIBRARY_PATH=$LIBRARY_PATH:$(brew --prefix zstd)/lib/ +# not enough to fix the issue on cross-compiling +#if [[ -n "$BUILD_ARCH" ]] +#then +# export LIBRARY_PATH=$LIBRARY_PATH:$(brew --prefix libiconv)/lib/ +#fi + +echo -n "[1/9] Updating submodules..." +{ + # update submodule profiles + pushd resources/profiles + git submodule update --init + popd +} #> $ROOT/build/Build.log # Capture all command output +echo "done" + +echo -n "[2/9] Changing date in version..." +{ + # change date in version + sed "s/+UNKNOWN/_$(date '+%F')/" version.inc > version.date.inc + mv version.date.inc version.inc +} #&> $ROOT/build/Build.log # Capture all command output +echo "done" if [[ -n "$BUILD_DEPS" ]] then @@ -146,9 +183,9 @@ then # mkdir in deps if [ ! -d "deps/build" ] then - mkdir deps/build + mkdir deps/build fi - echo -e " \n[1/9] Configuring dependencies ... \n" + echo -e " \n[3/9] Configuring dependencies ... \n" BUILD_ARGS="" if [[ -n "$BUILD_ARCH" ]] then @@ -159,24 +196,24 @@ then BUILD_ARGS="${BUILD_ARGS} -DCMAKE_BUILD_TYPE=Debug" fi # cmake deps - echo "Cmake command: cmake .. -DCMAKE_OSX_DEPLOYMENT_TARGET=\"10.15\" ${BUILD_ARCH} " + echo "Cmake command: cmake .. -DCMAKE_OSX_DEPLOYMENT_TARGET=\"10.14\" ${BUILD_ARCH} " pushd deps/build > /dev/null - cmake .. -DCMAKE_OSX_DEPLOYMENT_TARGET="10.15" $BUILD_ARGS + cmake .. -DCMAKE_OSX_DEPLOYMENT_TARGET="10.14" $BUILD_ARGS echo -e "\n ... done\n" - echo -e "[2/9] Building dependencies ...\n" + echo -e "[4/9] Building dependencies ...\n" # make deps - make -j1 + make -j$NCORES echo -e "\n ... done\n" - echo -e "[3/9] Renaming wxscintilla library ...\n" + echo -e "[5/9] Renaming wxscintilla library ...\n" # rename wxscintilla pushd destdir/usr/local/lib > /dev/null - cp libwxscintilla-3.1.a libwx_osx_cocoau_scintilla-3.1.a + cp libwxscintilla-3.2.a libwx_osx_cocoau_scintilla-3.2.a popd > /dev/null popd > /dev/null @@ -185,17 +222,17 @@ fi if [[ -n "$BUILD_CLEANDEPEND" ]] then - echo -e "[4/9] Cleaning dependencies...\n" - pushd deps/build > /dev/null + echo -e "[6/9] Cleaning dependencies...\n" + pushd deps/build pwd rm -fr dep_* popd > /dev/null echo -e "\n ... done\n" fi -if [[ -n "$BUILD_SUPERSLICER" ]] +if [[ -n "$BUILD_SLIC3R" ]] then - echo -e "[5/9] Configuring SuperSlicer ...\n" + echo -e "[5/9] Configuring Slicer ...\n" if [[ -n $BUILD_WIPE ]] then @@ -207,7 +244,7 @@ then # mkdir build if [ ! -d "build" ] then - mkdir build + mkdir build fi BUILD_ARGS="" @@ -239,17 +276,12 @@ then # make Slic3r if [[ -z "$BUILD_XCODE" ]] then - echo -e "\n[6/9] Building SuperSlicer ...\n" + echo -e "\n[6/9] Building Slicer ...\n" make -j$NCORES echo -e "\n ... done" fi - - echo -e "\n[7/9] Generating language files ...\n" + echo -e "\n[7/9] Generating language files ...\n" #make .mo - if [[ -n "$UPDATE_POTFILE" ]] - then - make gettext_make_pot - fi make gettext_po_to_mo popd > /dev/null @@ -259,8 +291,15 @@ then chmod 755 $ROOT/build/src/BuildMacOSImage.sh pushd build > /dev/null - $ROOT/build/src/BuildMacOSImage.sh -a + $ROOT/build/src/BuildMacOSImage.sh -p $BUILD_IMG popd > /dev/null + + echo "ls ROOT" + ls $ROOT + echo "ls ROOT/build" + ls $ROOT/build + echo "ls -al ROOT/build/src" + ls -al $ROOT/build/src fi if [[ -n "$BUILD_IMAGE" ]] @@ -268,6 +307,8 @@ then # Give proper permissions to script chmod 755 $ROOT/build/src/BuildMacOSImage.sh pushd build > /dev/null - $ROOT/build/src/BuildMacOSImage.sh -i + $ROOT/build/src/BuildMacOSImage.sh -i $BUILD_IMG popd > /dev/null fi + + diff --git a/src/platform/msw/Slic3r.rc.in b/src/platform/msw/Slic3r.rc.in index 3daf56ba9aa..83c10a5fca3 100644 --- a/src/platform/msw/Slic3r.rc.in +++ b/src/platform/msw/Slic3r.rc.in @@ -12,7 +12,7 @@ PRODUCTVERSION @SLIC3R_RC_VERSION@ VALUE "ProductName", "@SLIC3R_APP_NAME@" VALUE "ProductVersion", "@SLIC3R_BUILD_ID@" VALUE "InternalName", "@SLIC3R_APP_NAME@" - VALUE "LegalCopyright", "Copyright \251 2018-2022 Remi Durand, \251 2016-2022 Prusa Research, \251 2011-2018 Alessandro Ranellucci" + VALUE "LegalCopyright", "Copyright \251 2018-2023 Remi Durand, \251 2016-2023 Prusa Research, \251 2011-2018 Alessandro Ranellucci" VALUE "OriginalFilename", "slic3r.exe" } } diff --git a/src/platform/msw/gcodeviewer.rc.in b/src/platform/msw/gcodeviewer.rc.in index 758f9641cf7..efe5b182e84 100644 --- a/src/platform/msw/gcodeviewer.rc.in +++ b/src/platform/msw/gcodeviewer.rc.in @@ -12,7 +12,7 @@ PRODUCTVERSION @SLIC3R_RC_VERSION@ VALUE "ProductName", "@GCODEVIEWER_APP_NAME@" VALUE "ProductVersion", "@SLIC3R_BUILD_ID@" VALUE "InternalName", "@GCODEVIEWER_APP_NAME@" - VALUE "LegalCopyright", "Copyright \251 2019-2022 Durand Remi, \251 2016-2022 Prusa Research, \251 2018-2021 Joseph Lenox, \251 2011-2018 Alessandro Ranellucci" + VALUE "LegalCopyright", "Copyright \251 2019-2023 Durand Remi, \251 2016-2023 Prusa Research, \251 2018-2021 Joseph Lenox, \251 2011-2018 Alessandro Ranellucci" VALUE "OriginalFilename", "@GCODEVIEWER_APP_CMD@.exe" } } diff --git a/src/platform/osx/BuildMacOSImage.sh.in b/src/platform/osx/BuildMacOSImage.sh.in index 5ec5e1dd50b..0c0bc6c2ccf 100644 --- a/src/platform/osx/BuildMacOSImage.sh.in +++ b/src/platform/osx/BuildMacOSImage.sh.in @@ -11,87 +11,66 @@ # 10 Mar 2024, wschadow, added options # -while getopts ":ihag" opt; do +export ROOT=`pwd` +export NCORES=`sysctl -n hw.ncpu` + +while getopts ":ih" opt; do case ${opt} in i ) export BUILD_IMAGE="1" ;; - a ) - export BUILD_APP="1" - ;; - g ) - export FORCE_GTK2="1" - ;; - h ) echo "Usage: ./BuildLinuxImage.sh [-g][-i][-a][-h]" - echo " -g: force gtk2 build" - echo " -i: generate Appimage (optional)" - echo " -a: generate tgz (optional)" - echo " -h: help" + h ) echo "Usage: ./BuildMacOSImage.sh [-i]" + echo " -i: Generate DMG image (optional)" exit 0 ;; esac done -if [[ -n "$BUILD_APP" ]] -then - echo -e "\n[8/9] Generating MacOS app..." - { - # update Info.plist - pushd src - sed "s/+UNKNOWN/_$(date '+%F')/" Info.plist >Info.date.plist - popd - - # create directory and copy into it - if [ -d "pack" ] - then - rm -rf pack/* - fi - mkdir pack - mkdir pack/@SLIC3R_APP_KEY@ - mkdir pack/@SLIC3R_APP_KEY@/@SLIC3R_APP_KEY@.app - mkdir pack/@SLIC3R_APP_KEY@/@SLIC3R_APP_KEY@.app/Contents - mkdir pack/@SLIC3R_APP_KEY@/@SLIC3R_APP_KEY@.app/Contents/_CodeSignature - mkdir pack/@SLIC3R_APP_KEY@/@SLIC3R_APP_KEY@.app/Contents/Frameworks - mkdir pack/@SLIC3R_APP_KEY@/@SLIC3R_APP_KEY@.app/Contents/MacOS +echo -n "[9/9] Generating MacOS app..." +{ + # update Info.plist + pushd src + sed "s/+UNKNOWN/_$(date '+%F')/" Info.plist >Info.date.plist + popd - # copy Resources - cp -Rf ../resources pack/@SLIC3R_APP_KEY@/@SLIC3R_APP_KEY@.app/Contents/Resources - cp pack/@SLIC3R_APP_KEY@/@SLIC3R_APP_KEY@.app/Contents/Resources/icons/@SLIC3R_APP_KEY@.icns pack/@SLIC3R_APP_KEY@/@SLIC3R_APP_KEY@.app/Contents/resources/@SLIC3R_APP_KEY@.icns - cp src/Info.date.plist pack/@SLIC3R_APP_KEY@/@SLIC3R_APP_KEY@.app/Contents/Info.plist - echo -n -e 'APPL????\x0a' > PkgInfo - cp PkgInfo pack/@SLIC3R_APP_KEY@/@SLIC3R_APP_KEY@.app/Contents/PkgInfo - # remove unneeded po from resources - find pack/@SLIC3R_APP_KEY@/@SLIC3R_APP_KEY@.app/Contents/Resources/localization -name "*.po" -type f -delete - find pack/@SLIC3R_APP_KEY@/@SLIC3R_APP_KEY@.app/Contents/Resources/localization -name "*.pot" -type f -delete - find pack/@SLIC3R_APP_KEY@/@SLIC3R_APP_KEY@.app/Contents/Resources/localization -name "*.ini" -type f -delete - find pack/@SLIC3R_APP_KEY@/@SLIC3R_APP_KEY@.app/Contents/Resources/localization -name "*.py" -type f -delete - find pack/@SLIC3R_APP_KEY@/@SLIC3R_APP_KEY@.app/Contents/Resources/localization -name "*.md" -type f -delete - find pack/@SLIC3R_APP_KEY@/@SLIC3R_APP_KEY@.app/Contents/Resources/localization -name "*.txt" -type f -delete - find pack/@SLIC3R_APP_KEY@/@SLIC3R_APP_KEY@.app/Contents/Resources/localization -name "*database.mo" -type f -delete - find pack/@SLIC3R_APP_KEY@/@SLIC3R_APP_KEY@.app/Contents/Resources/localization -name "Slic3r.mo" -type f -delete + # create directory and copy into it + if [ -d "pack" ] + then + rm -rf pack/* + fi + mkdir pack + mkdir pack/@SLIC3R_APP_KEY@ + mkdir pack/@SLIC3R_APP_KEY@/@SLIC3R_APP_KEY@.app + mkdir pack/@SLIC3R_APP_KEY@/@SLIC3R_APP_KEY@.app/Contents + mkdir pack/@SLIC3R_APP_KEY@/@SLIC3R_APP_KEY@.app/Contents/_CodeSignature + mkdir pack/@SLIC3R_APP_KEY@/@SLIC3R_APP_KEY@.app/Contents/Frameworks + mkdir pack/@SLIC3R_APP_KEY@/@SLIC3R_APP_KEY@.app/Contents/MacOS - # copy bin and do not let it lower case - cp -f src/@SLIC3R_APP_CMD@ pack/@SLIC3R_APP_KEY@/@SLIC3R_APP_KEY@.app/Contents/MacOS/@SLIC3R_APP_KEY@ - chmod u+x pack/@SLIC3R_APP_KEY@/@SLIC3R_APP_KEY@.app/Contents/MacOS/@SLIC3R_APP_KEY@ - cp /usr/local/opt/zstd/lib/libzstd.1.dylib pack/@SLIC3R_APP_KEY@/@SLIC3R_APP_KEY@.app/Contents/MacOS/libzstd.1.dylib + # copy Resources + cp -Rf ../resources pack/@SLIC3R_APP_KEY@/@SLIC3R_APP_KEY@.app/Contents/Resources + cp pack/@SLIC3R_APP_KEY@/@SLIC3R_APP_KEY@.app/Contents/Resources/icons/@SLIC3R_APP_KEY@.icns pack/@SLIC3R_APP_KEY@/@SLIC3R_APP_KEY@.app/Contents/resources/@SLIC3R_APP_KEY@.icns + cp src/Info.date.plist pack/@SLIC3R_APP_KEY@/@SLIC3R_APP_KEY@.app/Contents/Info.plist + echo -n -e 'APPL????\x0a' > PkgInfo + cp PkgInfo pack/@SLIC3R_APP_KEY@/@SLIC3R_APP_KEY@.app/Contents/PkgInfo + # remove unneeded po from resources + find pack/@SLIC3R_APP_KEY@/@SLIC3R_APP_KEY@.app/Contents/Resources/localization -name "*.po" -type f -delete - } &> $ROOT/Build.log # Capture all command output - echo -e "\n ... done\n" -fi + # copy bin and do not let it lower case + cp -f src/@SLIC3R_APP_CMD@ pack/@SLIC3R_APP_KEY@/@SLIC3R_APP_KEY@.app/Contents/MacOS/@SLIC3R_APP_KEY@ + chmod u+x pack/@SLIC3R_APP_KEY@/@SLIC3R_APP_KEY@.app/Contents/MacOS/@SLIC3R_APP_KEY@ +} &> $ROOT/Build.log # Capture all command output +echo "done" if [[ -n "$BUILD_IMAGE" ]] then -echo -e "\n[9/9] Creating .tgz and DMG Image for distribution..." +echo -n "Creating DMG Image for distribution..." { - - tar -czvf @SLIC3R_APP_KEY@-@SLIC3R_VERSION_FULL@-macOS.tgz pack/@SLIC3R_APP_KEY@ + tar -cvf @SLIC3R_APP_KEY@.tar pack/@SLIC3R_APP_KEY@ # create dmg hdiutil create -ov -fs HFS+ -volname "@SLIC3R_APP_KEY@" -srcfolder "pack/@SLIC3R_APP_KEY@" temp.dmg - hdiutil convert temp.dmg -format UDZO -o @SLIC3R_APP_KEY@-@SLIC3R_VERSION_FULL@-macOS.dmg - rm -f temp.dmg - + hdiutil convert temp.dmg -format UDZO -o @SLIC3R_APP_KEY@.dmg popd } &> $ROOT/Build.log # Capture all command output -echo -e "\n ... done\n" +echo "done" fi diff --git a/src/platform/osx/Info.plist.in b/src/platform/osx/Info.plist.in index e8e2f3fc853..9dc9fe2bad0 100644 --- a/src/platform/osx/Info.plist.in +++ b/src/platform/osx/Info.plist.in @@ -5,7 +5,7 @@ CFBundleExecutable @SLIC3R_APP_KEY@ CFBundleGetInfoString - @SLIC3R_APP_NAME@ Copyright (C) 2011-2020 Alessandro Ranellucci, (C) 2016-2022 Prusa Reseach, (C) 2018-2022 Remi Durand + @SLIC3R_APP_NAME@ Copyright (C) 2011-2019 Alessandro Ranellucci, (C) 2016-2023 Prusa Reseach, (C) 2018-2023 Remi Durand CFBundleIconFile @SLIC3R_APP_KEY@.icns CFBundleName @@ -109,9 +109,37 @@ LSHandlerRank Alternate + + CFBundleTypeExtensions + + bgcode + BGCODE + + CFBundleTypeIconFile + bgcode.icns + CFBundleTypeName + BGCODE + CFBundleTypeRole + Viewer + LISsAppleDefaultForType + + LSHandlerRank + Alternate + + CFBundleURLTypes + + + CFBundleURLName + Slic3r Downloads + CFBundleURLSchemes + + slic3r + + + LSMinimumSystemVersion - 10.10 + 10.12 NSPrincipalClass NSApplication NSHighResolutionCapable diff --git a/src/platform/unix/BuildLinuxImage.sh.in b/src/platform/unix/BuildLinuxImage.sh.in index 1bd6566e294..f7ba3a495fd 100644 --- a/src/platform/unix/BuildLinuxImage.sh.in +++ b/src/platform/unix/BuildLinuxImage.sh.in @@ -19,32 +19,22 @@ else sysctl_bin=sysctl # If not found in sbin, hope fi export ROOT=`pwd` -export NCORES=`nproc` +export NCORES=`"$sysctl_bin" -n hw.ncpu` -while getopts ":ihag" opt; do +while getopts ":ih" opt; do case ${opt} in i ) export BUILD_IMAGE="1" ;; - a ) - export BUILD_APP="1" - ;; - g ) - export FORCE_GTK2="1" - ;; - h ) echo "Usage: ./BuildLinuxImage.sh [-g][-i][-a][-h]" - echo " -g: force gtk2 build" - echo " -i: generate .tgz and Appimage (optional)" - echo " -a: generate app (optional)" - echo " -h: help" + h ) echo "Usage: ./BuildLinuxImage.sh [-i]" + echo " -i: Generate Appimage (optional)" exit 0 ;; esac done -if [[ -n "$BUILD_APP" ]] -then - echo -e "\n[8/9] Generating Linux app ..." +echo -n "[9/9] Generating Linux app..." +#{ # create directory and copy into it if [ -d "package" ] then @@ -56,51 +46,33 @@ then mkdir package/bin # copy Resources - cp -rf ../resources/ package/resources - cp -f src/@SLIC3R_APP_CMD@ package/bin/@SLIC3R_APP_CMD@ - cp -f src/OCCTWrapper.so package/bin - ln -rs package/bin/@SLIC3R_APP_CMD@ package/bin/@GCODEVIEWER_APP_CMD@ + cp -Rf ../resources package/resources + cp -f bin/@SLIC3R_APP_CMD@ package/bin/@SLIC3R_APP_CMD@ # remove unneeded po from resources find package/resources/localization -name "*.po" -type f -delete - find package/resources/localization -name "*.pot" -type f -delete - find package/resources/localization -name "*.ini" -type f -delete - find package/resources/localization -name "*.py" -type f -delete - find package/resources/localization -name "*.md" -type f -delete - find package/resources/localization -name "*.txt" -type f -delete - find package/resources/localization -name "*database*" -type f -delete - find package/resources/localization -name "Slic3r.mo" -type f -delete - + # copy occtwrapper cp src/OCCTWrapper.so package/bin/OCCTWrapper.so # create bin - echo -e '#!/bin/bash\nDIR=$(readlink -f "$0" | xargs dirname)\nexport LD_LIBRARY_PATH="$DIR/bin"\nexec "$DIR/bin/@SLIC3R_APP_CMD@" "$@"' > package/@SLIC3R_APP_CMD@ - chmod ug+x package/@SLIC3R_APP_CMD@ - echo -e '#!/bin/bash\nDIR=$(readlink -f "$0" | xargs dirname)\nexport LD_LIBRARY_PATH="$DIR/bin"\nexec "$DIR/bin/@GCODEVIEWER_APP_CMD@" "$@"' > package/@GCODEVIEWER_APP_CMD@ - chmod ug+x package/@GCODEVIEWER_APP_CMD@ - echo -e "\n... done\n" -fi + echo -e '#!/bin/bash\nDIR=$(readlink -f "$0" | xargs dirname)\nexport LD_LIBRARY_PATH="$DIR/bin"\nexec "$DIR/bin/@SLIC3R_APP_CMD@" "$@"' >@SLIC3R_APP_CMD@ + chmod ug+x @SLIC3R_APP_CMD@ + cp -f @SLIC3R_APP_CMD@ package/@SLIC3R_APP_CMD@ + pushd package + tar -cvf ../@SLIC3R_APP_KEY@.tar . &>/dev/null + popd +#} &> $ROOT/Build.log # Capture all command output +echo "done" if [[ -n "$BUILD_IMAGE" ]] then - echo -e "\n[9/9] Creating .tgz and Appimage for distribution ...\n" - - pushd package > /dev/null - if [[ -z "$FORCE_GTK2" ]] - then - tar -czvf ../@SLIC3R_APP_KEY@-@SLIC3R_VERSION_FULL@-linux-x64-GTK3.tgz . &>/dev/null - else - tar -czvf ../@SLIC3R_APP_KEY@-@SLIC3R_VERSION_FULL@-linux-x64-GTK2.tgz . &>/dev/null - fi - - chmod +x ../src/build_appimage.sh - ../src/build_appimage.sh - popd > /dev/null - if [[ -z "$FORCE_GTK2" ]] - then - mv package/"@SLIC3R_APP_KEY@_ubu64.AppImage" "@SLIC3R_APP_KEY@-@SLIC3R_VERSION_FULL@-linux-x64-GTK3.AppImage" - else - mv package/"@SLIC3R_APP_KEY@_ubu64.AppImage" "@SLIC3R_APP_KEY@-@SLIC3R_VERSION_FULL@-linux-x64-GTK2.AppImage" - fi - echo -e "\n... done\n" +echo -n "Creating Appimage for distribution..." +#{ + pushd package + chmod +x ../build_appimage.sh + ../build_appimage.sh + popd + mv package/"@SLIC3R_APP_KEY@_ubu64.AppImage" "@SLIC3R_APP_KEY@_ubu64.AppImage" +#} &> $ROOT/Build.log # Capture all command output +echo "done" fi diff --git a/src/platform/unix/build_appimage.sh.in b/src/platform/unix/build_appimage.sh.in index 42810da8e0c..7ef56325fc3 100644 --- a/src/platform/unix/build_appimage.sh.in +++ b/src/platform/unix/build_appimage.sh.in @@ -18,8 +18,8 @@ APP_IMAGE="@SLIC3R_APP_KEY@_ubu64.AppImage" wget ${APPIMAGETOOLURL} -O ../appimagetool.AppImage chmod +x ../appimagetool.AppImage -sed -i -e 's#/usr#././#g' bin/@SLIC3R_APP_NAME@ -cp @SLIC3R_APP_CMD@ AppRun +sed -i -e 's#/usr#././#g' bin/@SLIC3R_APP_CMD@ +mv @SLIC3R_APP_CMD@ AppRun chmod +x AppRun cp resources/icons/@SLIC3R_APP_KEY@_192px.png @SLIC3R_APP_KEY@.png @@ -35,7 +35,7 @@ Categories=Utility; MimeType=model/stl;application/vnd.ms-3mfdocument;application/prs.wavefront-obj;application/x-amf; EOF + ../appimagetool.AppImage . mv @SLIC3R_APP_KEY@-x86_64.AppImage ${APP_IMAGE} chmod +x ${APP_IMAGE} -rm -fr usr \ No newline at end of file