Skip to content

Commit

Permalink
Merge pull request #14 from SoftFever/main
Browse files Browse the repository at this point in the history
from upstream
  • Loading branch information
henrivdr authored Jan 16, 2025
2 parents 3638c05 + 2ea2ab0 commit bb3eb24
Show file tree
Hide file tree
Showing 1,906 changed files with 107,935 additions and 36,159 deletions.
2 changes: 2 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE}
11 changes: 9 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
{
"name": "OrcaSlicer",
"image": "mcr.microsoft.com/devcontainers/cpp:ubuntu-20.04",
"build": {
"dockerfile": "Dockerfile",
"args": {
"PLATFORM": "linux/amd64",
"BASE_IMAGE": "mcr.microsoft.com/devcontainers/cpp:ubuntu-20.04"
},
"options": ["--platform=linux/amd64"]
},
"runArgs": ["--env-file", "/tmp/devcontainer.env"],
"features": {
"ghcr.io/devcontainers/features/desktop-lite:1": {
Expand Down Expand Up @@ -48,4 +55,4 @@
"Set postCreate executable flag": "chmod +x .devcontainer/postCreate.sh"
},
"postCreateCommand": "sudo .devcontainer/postCreate.sh"
}
}
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 2
updates:
# Only care about major updates to github actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
ignore: # Only suggest major updates for built-in actions
- dependency-name: "github/*"
update-types: ["version-update:semver-patch", "version-update:semver-minor"]
- dependency-name: "actions/*"
update-types: ["version-update:semver-patch", "version-update:semver-minor"]
# Docker dependencies
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "monthly"
# no support for c/cpp
65 changes: 47 additions & 18 deletions .github/workflows/build_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,50 @@ jobs:
arch: ${{ matrix.arch }}
build-deps-only: ${{ inputs.build-deps-only || false }}
secrets: inherit
# flatpak:
# name: "Flatpak"
# runs-on: ubuntu-latest
# container:
# image: bilelmoussaoui/flatpak-github-actions:gnome-45
# options: --privileged
# steps:
# # maybe i'm too dumb and fucked up to do CI. OH WELL :D -ppd
# - name: "Remove unneeded stuff to free disk space"
# run:
# sudo rm -rf /usr/share/dotnet /opt/ghc "/usr/local/share/boost" "$AGENT_TOOLSDIRECTORY"
# - uses: actions/checkout@v4
# - uses: flatpak/flatpak-github-actions/flatpak-builder@v6
# with:
# bundle: orcaslicer.flatpak
# manifest-path: flatpak/io.github.softfever.OrcaSlicer.yml
# cache-key: flatpak-builder-${{ github.sha }}
# cache: false
flatpak:
name: "Flatpak"
runs-on: ubuntu-latest
env:
date:
ver:
ver_pure:
container:
image: bilelmoussaoui/flatpak-github-actions:gnome-46
options: --privileged
volumes:
- /usr/local/lib/android:/usr/local/lib/android
- /usr/share/dotnet:/usr/share/dotnet
- /opt/ghc:/opt/ghc1
- /usr/local/share/boost:/usr/local/share/boost1
steps:
- name: "Remove unneeded stuff to free disk space"
run:
rm -rf /usr/local/lib/android/* /usr/share/dotnet/* /opt/ghc1/* "/usr/local/share/boost1/*"
- uses: actions/checkout@v4
- name: Get the version and date
run: |
ver_pure=$(grep 'set(SoftFever_VERSION' version.inc | cut -d '"' -f2)
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
ver="PR-${{ github.event.number }}"
else
ver=V$ver_pure
fi
echo "ver=$ver" >> $GITHUB_ENV
echo "ver_pure=$ver_pure" >> $GITHUB_ENV
echo "date=$(date +'%Y%m%d')" >> $GITHUB_ENV
shell: bash
- uses: flatpak/flatpak-github-actions/flatpak-builder@v6
with:
bundle: OrcaSlicer-Linux-flatpak_${{ env.ver }}.flatpak
manifest-path: flatpak/io.github.softfever.OrcaSlicer.yml
cache: true
- name: Deploy Flatpak to nightly release
if: ${{github.ref == 'refs/heads/main'}}
uses: WebFreak001/[email protected]
with:
upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label}
release_id: 137995723
asset_path: /__w/OrcaSlicer/OrcaSlicer/OrcaSlicer-Linux-flatpak_${{ env.ver }}.flatpak
asset_name: OrcaSlicer-Linux-flatpak_${{ env.ver }}.flatpak
asset_content_type: application/octet-stream
max_releases: 1 # optional, if there are more releases than this matching the asset_name, the oldest ones are going to be deleted
24 changes: 17 additions & 7 deletions .github/workflows/build_orca.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,18 @@ jobs:
- name: Install tools mac
if: inputs.os == 'macos-14'
run: |
brew install tree ninja libtool
brew install ninja libtool
brew list
mkdir -p ${{ github.workspace }}/deps/build_${{inputs.arch}}
mkdir -p ${{ github.workspace }}/deps/build_${{inputs.arch}}/OrcaSlicer_dep_${{inputs.arch}}
tree ${{ github.workspace }}/deps/build_${{inputs.arch}}/OrcaSlicer_dep_${{inputs.arch}}
- name: Free disk space
if: inputs.os == 'macos-14'
run: |
df -hI /dev/disk3s1s1
sudo find /Applications -maxdepth 1 -type d -name "Xcode_*.app" ! -name "Xcode_15.4.app" -exec rm -rf {} +
sudo rm -rf ~/Library/Developer/CoreSimulator/Caches/*
df -hI /dev/disk3s1s1
- name: Build slicer mac
if: inputs.os == 'macos-14'
Expand Down Expand Up @@ -159,6 +166,9 @@ jobs:
- name: Build slicer Win
if: inputs.os == 'windows-latest'
working-directory: ${{ github.workspace }}
env:
WindowsSdkDir: 'C:\Program Files (x86)\Windows Kits\10\'
WindowsSDKVersion: '10.0.22000.0\'
run: .\build_release_vs2022.bat slicer

- name: Create installer Win
Expand Down Expand Up @@ -254,8 +264,8 @@ jobs:
ubuntu-ver-str: ${{ (inputs.os == 'ubuntu-24.04' && '_Ubuntu2404') || '' }}
run: |
./BuildLinux.sh -isr
mv -n ./build/OrcaSlicer_Linux_V${{ env.ver_pure }}.AppImage ./build/OrcaSlicer_Linux${{ env.ubuntu-ver-str }}_${{ env.ver }}.AppImage
chmod +x ./build/OrcaSlicer_Linux${{ env.ubuntu-ver-str }}_${{ env.ver }}.AppImage
mv -n ./build/OrcaSlicer_Linux_V${{ env.ver_pure }}.AppImage ./build/OrcaSlicer_Linux_AppImage${{ env.ubuntu-ver-str }}_${{ env.ver }}.AppImage
chmod +x ./build/OrcaSlicer_Linux_AppImage${{ env.ubuntu-ver-str }}_${{ env.ver }}.AppImage
- name: Build orca_custom_preset_tests
if: github.ref == 'refs/heads/main' && inputs.os == 'ubuntu-20.04'
Expand All @@ -274,7 +284,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: OrcaSlicer_Linux_ubuntu_${{ env.ubuntu-ver }}_${{ env.ver }}
path: './build/OrcaSlicer_Linux${{ env.ubuntu-ver-str }}_${{ env.ver }}.AppImage'
path: './build/OrcaSlicer_Linux_AppImage${{ env.ubuntu-ver-str }}_${{ env.ver }}.AppImage'

- name: Deploy Ubuntu release
if: ${{ ! env.ACT && github.ref == 'refs/heads/main' && (inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04') }}
Expand All @@ -284,8 +294,8 @@ jobs:
with:
upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label}
release_id: 137995723
asset_path: ./build/OrcaSlicer_Linux${{ env.ubuntu-ver-str }}_${{ env.ver }}.AppImage
asset_name: OrcaSlicer_Linux${{ env.ubuntu-ver-str }}_${{ env.ver }}.AppImage
asset_path: ./build/OrcaSlicer_Linux_AppImage${{ env.ubuntu-ver-str }}_${{ env.ver }}.AppImage
asset_name: OrcaSlicer_Linux_AppImage${{ env.ubuntu-ver-str }}_${{ env.ver }}.AppImage
asset_content_type: application/octet-stream
max_releases: 1 # optional, if there are more releases than this matching the asset_name, the oldest ones are going to be deleted

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_profiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
jobs:
check_translation:
name: Check profiles
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ src/OrcaSlicer-doc/
/deps/DL_CACHE
**/.flatpak-builder/
resources/profiles/user/default
OrcaSlicer.code-workspace
*.code-workspace
2 changes: 1 addition & 1 deletion BuildLinux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ fi

DISTRIBUTION=$(awk -F= '/^ID=/ {print $2}' /etc/os-release)
# treat ubuntu as debian
if [ "${DISTRIBUTION}" == "ubuntu" ]
if [ "${DISTRIBUTION}" == "ubuntu" ] || [ "${DISTRIBUTION}" == "linuxmint" ]
then
DISTRIBUTION="debian"
fi
Expand Down
22 changes: 20 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@ if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type (default Release)" FORCE)
endif()

find_package(Git)
if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
# Check current Git commit hash
execute_process(
COMMAND ${GIT_EXECUTABLE} log -1 --format=%h
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
add_definitions("-DGIT_COMMIT_HASH=\"${GIT_COMMIT_HASH}\"")
endif()

if(DEFINED ENV{SLIC3R_STATIC})
set(SLIC3R_STATIC_INITIAL $ENV{SLIC3R_STATIC})
else()
Expand Down Expand Up @@ -281,7 +293,7 @@ if (NOT MSVC AND ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMP
add_compile_options(-Wno-deprecated-declarations)
endif()

if (${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang" AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 15)
if((${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang") AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 15)
add_compile_options(-Wno-error=enum-constexpr-conversion)
endif()

Expand All @@ -302,6 +314,10 @@ if (NOT MSVC AND ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMP
add_compile_options(-gz=zstd)
endif()

if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 14)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=template-id-cdtor" )
endif()

endif()

if (SLIC3R_ASAN)
Expand Down Expand Up @@ -407,12 +423,14 @@ if(SLIC3R_STATIC)
set(Boost_USE_STATIC_LIBS ON)
# Use boost libraries linked statically to the C++ runtime.
# set(Boost_USE_STATIC_RUNTIME ON)
else()
add_definitions(-DBOOST_LOG_DYN_LINK)
endif()
#set(Boost_DEBUG ON)
# set(Boost_COMPILER "-mgw81")
# boost::process was introduced first in version 1.64.0,
# boost::beast::detail::base64 was introduced first in version 1.66.0
find_package(Boost 1.66 REQUIRED COMPONENTS system filesystem thread log locale regex chrono atomic date_time iostreams program_options)
find_package(Boost 1.66 REQUIRED COMPONENTS system filesystem thread log log_setup locale regex chrono atomic date_time iostreams program_options)

add_library(boost_libs INTERFACE)
add_library(boost_headeronly INTERFACE)
Expand Down
1 change: 0 additions & 1 deletion DockerBuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
PROJECT_ROOT=$(cd -P -- "$(dirname -- "$0")" && printf '%s\n' "$(pwd -P)")

set -x

# Wishlist hint: For developers, creating a Docker Compose
# setup with persistent volumes for the build & deps directories
# would speed up recompile times significantly. For end users,
Expand Down
2 changes: 2 additions & 0 deletions DockerRun.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ set -x
# -h $HOSTNAME \
# If there's problems with the X display, try this
# -v /tmp/.X11-unix:/tmp/.X11-unix \
# If you get an error like "Authorization required, but no authorization protocol specified," run line 9 in your terminal before rerunning this program
# xhost +local:docker
docker run \
`# Use the hosts networking. Printer wifi and also dbus communication` \
--net=host \
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ WORKDIR OrcaSlicer
RUN ./BuildLinux.sh -u

# Build dependencies in ./deps
RUN ./BuildLinux.sh -d
RUN ./BuildLinux.sh -dr

# Build slic3r
RUN ./BuildLinux.sh -s
RUN ./BuildLinux.sh -sr

# Build AppImage
ENV container podman
RUN ./BuildLinux.sh -i
RUN ./BuildLinux.sh -ir

# It's easier to run Orca Slicer as the same username,
# UID and GID as your workstation. Since we bind mount
Expand Down
Loading

0 comments on commit bb3eb24

Please sign in to comment.