mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-04-06 00:32:05 +02:00
Compare commits
74 Commits
main
...
release/v2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0e1896e3f1 | ||
|
|
2d83918fc5 | ||
|
|
75fe485de7 | ||
|
|
c724a3f5f5 | ||
|
|
d129af20ca | ||
|
|
6187063190 | ||
|
|
b9f93ffd99 | ||
|
|
586118a875 | ||
|
|
ca1f360b83 | ||
|
|
4c73ac2fea | ||
|
|
36b764f735 | ||
|
|
ce1d91024b | ||
|
|
2f3bfd03d5 | ||
|
|
f03c34024d | ||
|
|
6b3f554732 | ||
|
|
325ced958e | ||
|
|
bbbc044e92 | ||
|
|
0c666da430 | ||
|
|
c924b8ed25 | ||
|
|
c8dde0f8ca | ||
|
|
401fb935bc | ||
|
|
7747a6e7a1 | ||
|
|
545cdc74ca | ||
|
|
b0e19d5577 | ||
|
|
df216c5105 | ||
|
|
e5d037c044 | ||
|
|
6e01d38a5c | ||
|
|
37790f2a3d | ||
|
|
6437fb57e8 | ||
|
|
a46c8970bf | ||
|
|
03bc0af038 | ||
|
|
c03fdb4ca0 | ||
|
|
1162b101b8 | ||
|
|
f91971baf9 | ||
|
|
937b356725 | ||
|
|
721ee0ab00 | ||
|
|
f054e3ad9b | ||
|
|
1a57ec13a5 | ||
|
|
c7b65ef498 | ||
|
|
31cb77116c | ||
|
|
74f75bb90d | ||
|
|
a3c067cd3b | ||
|
|
90cd00382a | ||
|
|
deef8b107d | ||
|
|
478f1fa117 | ||
|
|
3f82902ebe | ||
|
|
1c42f67000 | ||
|
|
b45c7a8112 | ||
|
|
da8be684dc | ||
|
|
dc27345b05 | ||
|
|
10cfab0501 | ||
|
|
4146066f76 | ||
|
|
8aa43d1ef7 | ||
|
|
04bf8b6bb9 | ||
|
|
84b5906ffa | ||
|
|
318b7742cc | ||
|
|
b68fd2dc21 | ||
|
|
f2cc134a8f | ||
|
|
31d9c9d087 | ||
|
|
c9ffc5a699 | ||
|
|
d37be2f4f5 | ||
|
|
4cc4da8868 | ||
|
|
9f5214d14d | ||
|
|
7e63fce706 | ||
|
|
380f4b4a18 | ||
|
|
240cf9ab5d | ||
|
|
05cb8b4d89 | ||
|
|
897a3e915f | ||
|
|
586e96479a | ||
|
|
0879b2079b | ||
|
|
c4801250ea | ||
|
|
f0386d981f | ||
|
|
cd5c8f2ad0 | ||
|
|
2d0a0568e7 |
4
.github/workflows/build_all.yml
vendored
4
.github/workflows/build_all.yml
vendored
@@ -55,7 +55,7 @@ jobs:
|
||||
if: ${{ !cancelled() && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }}
|
||||
uses: ./.github/workflows/build_check_cache.yml
|
||||
with:
|
||||
os: ${{ vars.SELF_HOSTED && 'orca-lnx-server' || 'ubuntu-24.04' }}
|
||||
os: ${{ vars.SELF_HOSTED && 'orca-lnx-server' || 'ubuntu-22.04' }}
|
||||
build-deps-only: ${{ inputs.build-deps-only || false }}
|
||||
secrets: inherit
|
||||
build_windows:
|
||||
@@ -95,7 +95,7 @@ jobs:
|
||||
secrets: inherit
|
||||
unit_tests:
|
||||
name: Unit Tests
|
||||
runs-on: ${{ vars.SELF_HOSTED && 'orca-lnx-server' || 'ubuntu-24.04' }}
|
||||
runs-on: ${{ vars.SELF_HOSTED && 'orca-lnx-server' || 'ubuntu-22.04' }}
|
||||
needs: build_linux
|
||||
if: ${{ !cancelled() && success() }}
|
||||
steps:
|
||||
|
||||
5
.github/workflows/build_orca.yml
vendored
5
.github/workflows/build_orca.yml
vendored
@@ -26,8 +26,8 @@ jobs:
|
||||
date:
|
||||
ver:
|
||||
ver_pure:
|
||||
ubuntu-ver: '2404'
|
||||
ubuntu-ver-str: '_Ubuntu2404'
|
||||
ubuntu-ver: '2204'
|
||||
ubuntu-ver-str: '_Ubuntu2204'
|
||||
ORCA_UPDATER_SIG_KEY: ${{ secrets.ORCA_UPDATER_SIG_KEY }}
|
||||
|
||||
steps:
|
||||
@@ -382,6 +382,7 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
./build_linux.sh -istrlL
|
||||
./scripts/check_appimage_libs.sh ./build/package ./build/package/bin/orca-slicer
|
||||
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
|
||||
tar -cvpf build_tests.tar build/tests
|
||||
|
||||
308
build_linux.sh
308
build_linux.sh
@@ -8,7 +8,7 @@ SCRIPT_PATH=$(dirname "$(readlink -f "${0}")")
|
||||
pushd "${SCRIPT_PATH}" > /dev/null
|
||||
|
||||
function usage() {
|
||||
echo "Usage: ./${SCRIPT_NAME} [-1][-b][-c][-d][-D][-e][-h][-i][-j N][-p][-r][-s][-t][-u][-l][-L]"
|
||||
echo "Usage: ./${SCRIPT_NAME} [-1][-b][-c][-d][-D][-e][-F][-g][-h][-i][-j N][-p][-r][-s][-t][-u][-l][-L]"
|
||||
echo " -1: limit builds to one core (where possible)"
|
||||
echo " -j N: limit builds to N cores (where possible)"
|
||||
echo " -b: build in Debug mode"
|
||||
@@ -17,6 +17,8 @@ function usage() {
|
||||
echo " -d: download and build dependencies in ./deps/ (build prerequisite)"
|
||||
echo " -D: dry run"
|
||||
echo " -e: build in RelWithDebInfo mode"
|
||||
echo " -F: rebuild the cached Docker/Podman runner image from scratch when used with -g"
|
||||
echo " -g: run the requested build steps inside a Docker/Podman Ubuntu 24.04 container similar to the GitHub Actions Linux runner"
|
||||
echo " -h: prints this help text"
|
||||
echo " -i: build the Orca Slicer AppImage (optional)"
|
||||
echo " -p: boost ccache hit rate by disabling precompiled headers (default: ON)"
|
||||
@@ -28,6 +30,9 @@ function usage() {
|
||||
echo " -L: use ld.lld as linker (if available)"
|
||||
echo "For a first use, you want to './${SCRIPT_NAME} -u'"
|
||||
echo " and then './${SCRIPT_NAME} -dsi'"
|
||||
echo "For a GitHub Actions-like Linux build locally, use './${SCRIPT_NAME} -g -istrlL'"
|
||||
echo "Use './${SCRIPT_NAME} -gF -istrlL' to rebuild the cached runner image first."
|
||||
echo "Set ORCA_CONTAINER_CLI, ORCA_DOCKER_IMAGE, ORCA_DOCKER_BASE_IMAGE, or ORCA_DOCKER_CMAKE_VERSION to override the container runtime, cached image tag, base image, or CMake version."
|
||||
}
|
||||
|
||||
SLIC3R_PRECOMPILED_HEADERS="ON"
|
||||
@@ -35,60 +40,83 @@ SLIC3R_PRECOMPILED_HEADERS="ON"
|
||||
unset name
|
||||
BUILD_DIR=build
|
||||
BUILD_CONFIG=Release
|
||||
while getopts ":1j:bcCdDehiprstulL" opt ; do
|
||||
FORWARDED_ARGS=()
|
||||
while getopts ":1j:bcCdDeFghiprstulL" opt ; do
|
||||
case ${opt} in
|
||||
1 )
|
||||
export CMAKE_BUILD_PARALLEL_LEVEL=1
|
||||
FORWARDED_ARGS+=("-1")
|
||||
;;
|
||||
j )
|
||||
export CMAKE_BUILD_PARALLEL_LEVEL=$OPTARG
|
||||
FORWARDED_ARGS+=("-j" "$OPTARG")
|
||||
;;
|
||||
b )
|
||||
BUILD_DIR=build-dbg
|
||||
BUILD_CONFIG=Debug
|
||||
FORWARDED_ARGS+=("-b")
|
||||
;;
|
||||
c )
|
||||
CLEAN_BUILD=1
|
||||
FORWARDED_ARGS+=("-c")
|
||||
;;
|
||||
C )
|
||||
COLORED_OUTPUT="-DCOLORED_OUTPUT=ON"
|
||||
FORWARDED_ARGS+=("-C")
|
||||
;;
|
||||
d )
|
||||
BUILD_DEPS="1"
|
||||
FORWARDED_ARGS+=("-d")
|
||||
;;
|
||||
D )
|
||||
DRY_RUN="1"
|
||||
FORWARDED_ARGS+=("-D")
|
||||
;;
|
||||
e )
|
||||
BUILD_DIR=build-dbginfo
|
||||
BUILD_CONFIG=RelWithDebInfo
|
||||
FORWARDED_ARGS+=("-e")
|
||||
;;
|
||||
F )
|
||||
CLEAN_DOCKER_IMAGE="1"
|
||||
;;
|
||||
g )
|
||||
USE_DOCKER="1"
|
||||
;;
|
||||
h ) usage
|
||||
exit 1
|
||||
;;
|
||||
i )
|
||||
BUILD_IMAGE="1"
|
||||
FORWARDED_ARGS+=("-i")
|
||||
;;
|
||||
p )
|
||||
SLIC3R_PRECOMPILED_HEADERS="OFF"
|
||||
FORWARDED_ARGS+=("-p")
|
||||
;;
|
||||
r )
|
||||
SKIP_RAM_CHECK="1"
|
||||
FORWARDED_ARGS+=("-r")
|
||||
;;
|
||||
s )
|
||||
BUILD_ORCA="1"
|
||||
FORWARDED_ARGS+=("-s")
|
||||
;;
|
||||
t )
|
||||
BUILD_TESTS="1"
|
||||
FORWARDED_ARGS+=("-t")
|
||||
;;
|
||||
u )
|
||||
export UPDATE_LIB="1"
|
||||
FORWARDED_ARGS+=("-u")
|
||||
;;
|
||||
l )
|
||||
USE_CLANG="1"
|
||||
FORWARDED_ARGS+=("-l")
|
||||
;;
|
||||
L )
|
||||
USE_LLD="1"
|
||||
FORWARDED_ARGS+=("-L")
|
||||
;;
|
||||
* )
|
||||
echo "Unknown argument '${opt}', aborting."
|
||||
@@ -102,6 +130,11 @@ if [ ${OPTIND} -eq 1 ] ; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -n "${CLEAN_DOCKER_IMAGE}" ]] && [[ -z "${USE_DOCKER}" ]] ; then
|
||||
echo "Error: -F requires -g."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
function check_available_memory_and_disk() {
|
||||
FREE_MEM_GB=$(free --gibi --total | grep 'Mem' | rev | cut --delimiter=" " --fields=1 | rev)
|
||||
MIN_MEM_GB=10
|
||||
@@ -139,6 +172,277 @@ function print_and_run() {
|
||||
fi
|
||||
}
|
||||
|
||||
function resolve_container_cli() {
|
||||
if [[ -n "${ORCA_CONTAINER_CLI}" ]] ; then
|
||||
if ! command -v "${ORCA_CONTAINER_CLI}" >/dev/null 2>&1 ; then
|
||||
echo "Error: container runtime '${ORCA_CONTAINER_CLI}' was not found." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "${ORCA_CONTAINER_CLI}"
|
||||
return
|
||||
fi
|
||||
|
||||
if command -v docker >/dev/null 2>&1 ; then
|
||||
echo "docker"
|
||||
return
|
||||
fi
|
||||
|
||||
if command -v podman >/dev/null 2>&1 ; then
|
||||
echo "podman"
|
||||
return
|
||||
fi
|
||||
|
||||
echo "Error: neither docker nor podman is available. Install one of them or set ORCA_CONTAINER_CLI." >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
function get_docker_runner_image() {
|
||||
local base_image
|
||||
local docker_cmake_version
|
||||
local recipe_hash
|
||||
local sanitized_base_image
|
||||
local sanitized_cmake_version
|
||||
|
||||
if [[ -n "${ORCA_DOCKER_IMAGE}" ]] ; then
|
||||
echo "${ORCA_DOCKER_IMAGE}"
|
||||
return
|
||||
fi
|
||||
|
||||
base_image="${ORCA_DOCKER_BASE_IMAGE:-ubuntu:24.04}"
|
||||
docker_cmake_version="${ORCA_DOCKER_CMAKE_VERSION-4.3.0}"
|
||||
recipe_hash=$(find "${SCRIPT_PATH}/build_linux.sh" "${SCRIPT_PATH}/scripts/linux.d" -type f -print0 | sort -z | xargs -0 cat | sha256sum | cut -c1-12)
|
||||
sanitized_base_image=$(echo "${base_image}" | tr '/:@' '---' | tr -cs 'A-Za-z0-9_.-' '-')
|
||||
sanitized_cmake_version=$(echo "${docker_cmake_version:-system}" | tr -cs 'A-Za-z0-9_.-' '-')
|
||||
echo "orcaslicer-linux-builder:${sanitized_base_image}-cmake-${sanitized_cmake_version}-${recipe_hash}"
|
||||
}
|
||||
|
||||
function docker_runner_dockerfile() {
|
||||
cat <<'EOF'
|
||||
ARG BASE_IMAGE=ubuntu:24.04
|
||||
FROM ${BASE_IMAGE}
|
||||
|
||||
ARG CMAKE_VERSION=4.3.0
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
SHELL ["/bin/bash", "-c"]
|
||||
|
||||
RUN apt-get update && apt-get install -y sudo ca-certificates curl tar
|
||||
|
||||
COPY build_linux.sh /tmp/orcaslicer/build_linux.sh
|
||||
COPY scripts/linux.d /tmp/orcaslicer/scripts/linux.d
|
||||
|
||||
WORKDIR /tmp/orcaslicer
|
||||
|
||||
RUN chmod +x ./build_linux.sh
|
||||
RUN ./build_linux.sh -ur
|
||||
RUN if [[ -n "${CMAKE_VERSION}" ]] ; then \
|
||||
case "$(uname -m)" in \
|
||||
x86_64|amd64) cmake_arch="x86_64" ;; \
|
||||
aarch64|arm64) cmake_arch="aarch64" ;; \
|
||||
*) cmake_arch="" ;; \
|
||||
esac ; \
|
||||
if [[ -n "${cmake_arch}" ]] ; then \
|
||||
cmake_root="/opt/cmake-${CMAKE_VERSION}-linux-${cmake_arch}" ; \
|
||||
if ! curl -fsSL "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${cmake_arch}.tar.gz" | tar -xz -C /opt ; then \
|
||||
echo "Warning: failed to install CMake ${CMAKE_VERSION}; falling back to the distro cmake package." ; \
|
||||
elif [[ -d "${cmake_root}" ]] ; then \
|
||||
ln -sf "${cmake_root}/bin/"* /usr/local/bin/ ; \
|
||||
fi ; \
|
||||
else \
|
||||
echo "Skipping GitHub Actions CMake install for unsupported architecture $(uname -m)." ; \
|
||||
fi ; \
|
||||
fi
|
||||
RUN rm -rf /var/lib/apt/lists/* /tmp/orcaslicer
|
||||
EOF
|
||||
}
|
||||
|
||||
function ensure_docker_runner_image() {
|
||||
local container_cli
|
||||
local base_image
|
||||
local runner_image
|
||||
local docker_cmake_version
|
||||
local image_exists="0"
|
||||
local force_rebuild="0"
|
||||
local -a build_cmd
|
||||
|
||||
container_cli="$1"
|
||||
runner_image="$2"
|
||||
base_image="${ORCA_DOCKER_BASE_IMAGE:-ubuntu:24.04}"
|
||||
docker_cmake_version="${ORCA_DOCKER_CMAKE_VERSION-4.3.0}"
|
||||
|
||||
if "${container_cli}" image inspect "${runner_image}" >/dev/null 2>&1 ; then
|
||||
image_exists="1"
|
||||
fi
|
||||
|
||||
if [[ -n "${CLEAN_DOCKER_IMAGE}" ]] ; then
|
||||
force_rebuild="1"
|
||||
if [[ "${image_exists}" == "1" ]] ; then
|
||||
echo "Removing cached container image ${runner_image} ..."
|
||||
if [[ -z "${DRY_RUN}" ]] ; then
|
||||
"${container_cli}" image rm -f "${runner_image}" >/dev/null
|
||||
else
|
||||
printf '%q ' "${container_cli}" image rm -f "${runner_image}"
|
||||
echo
|
||||
fi
|
||||
image_exists="0"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "${image_exists}" == "1" ]] ; then
|
||||
echo "Using cached container image ${runner_image}"
|
||||
return
|
||||
fi
|
||||
|
||||
build_cmd=(
|
||||
"${container_cli}" build --pull
|
||||
-t "${runner_image}"
|
||||
--build-arg "BASE_IMAGE=${base_image}"
|
||||
--build-arg "CMAKE_VERSION=${docker_cmake_version}"
|
||||
)
|
||||
if [[ "${force_rebuild}" == "1" ]] ; then
|
||||
build_cmd+=(--no-cache)
|
||||
fi
|
||||
build_cmd+=(-f - "${SCRIPT_PATH}")
|
||||
|
||||
printf '%q ' "${build_cmd[@]}"
|
||||
echo
|
||||
if [[ -n "${DRY_RUN}" ]] ; then
|
||||
return
|
||||
fi
|
||||
|
||||
docker_runner_dockerfile | "${build_cmd[@]}"
|
||||
}
|
||||
|
||||
function run_in_docker() {
|
||||
local container_cli
|
||||
local runner_image
|
||||
local container_workspace
|
||||
local host_uid
|
||||
local host_gid
|
||||
local host_user
|
||||
local -a build_args
|
||||
local -a container_env
|
||||
|
||||
container_cli=$(resolve_container_cli)
|
||||
runner_image=$(get_docker_runner_image)
|
||||
host_uid=$(id -u)
|
||||
host_gid=$(id -g)
|
||||
host_user="${USER:-orca}"
|
||||
container_workspace="/__w/OrcaSlicer/OrcaSlicer"
|
||||
build_args=()
|
||||
for item in "${FORWARDED_ARGS[@]}" ; do
|
||||
if [[ "${item}" == "-u" ]] || [[ "${item}" == "-D" ]] ; then
|
||||
continue
|
||||
fi
|
||||
|
||||
build_args+=("${item}")
|
||||
done
|
||||
|
||||
container_env=(
|
||||
-e "CI=true"
|
||||
-e "GITHUB_ACTIONS=true"
|
||||
-e "GITHUB_WORKSPACE=${container_workspace}"
|
||||
-e "GIT_CEILING_DIRECTORIES=${container_workspace}/deps/build"
|
||||
-e "RUNNER_OS=Linux"
|
||||
-e "RUNNER_TEMP=/tmp"
|
||||
-e "HOST_UID=${host_uid}"
|
||||
-e "HOST_GID=${host_gid}"
|
||||
-e "HOST_USER=${host_user}"
|
||||
)
|
||||
if [[ -n "${CMAKE_BUILD_PARALLEL_LEVEL}" ]] ; then
|
||||
container_env+=( -e "CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL}" )
|
||||
fi
|
||||
if [[ -n "${ORCA_UPDATER_SIG_KEY}" ]] ; then
|
||||
container_env+=( -e "ORCA_UPDATER_SIG_KEY=${ORCA_UPDATER_SIG_KEY}" )
|
||||
fi
|
||||
|
||||
ensure_docker_runner_image "${container_cli}" "${runner_image}"
|
||||
|
||||
printf '%q ' "${container_cli}" run --rm -i \
|
||||
-v "${SCRIPT_PATH}:${container_workspace}" \
|
||||
-w "${container_workspace}" \
|
||||
"${container_env[@]}" \
|
||||
"${runner_image}" \
|
||||
bash -s -- "${build_args[@]}"
|
||||
echo
|
||||
if [[ -n "${DRY_RUN}" ]] ; then
|
||||
return
|
||||
fi
|
||||
|
||||
"${container_cli}" run --rm -i \
|
||||
-v "${SCRIPT_PATH}:${container_workspace}" \
|
||||
-w "${container_workspace}" \
|
||||
"${container_env[@]}" \
|
||||
"${runner_image}" \
|
||||
bash -s -- "${build_args[@]}" <<'EOF'
|
||||
set -e
|
||||
|
||||
function create_builder_user() {
|
||||
if [[ "${HOST_UID}" == "0" ]] ; then
|
||||
HOST_USER=root
|
||||
return
|
||||
fi
|
||||
|
||||
if getent group "${HOST_GID}" >/dev/null 2>&1 ; then
|
||||
HOST_GROUP=$(getent group "${HOST_GID}" | cut -d: -f1)
|
||||
else
|
||||
HOST_GROUP="orca-builder"
|
||||
if getent group "${HOST_GROUP}" >/dev/null 2>&1 ; then
|
||||
HOST_GROUP="orca-builder-${HOST_GID}"
|
||||
fi
|
||||
groupadd -g "${HOST_GID}" "${HOST_GROUP}"
|
||||
fi
|
||||
|
||||
if getent passwd "${HOST_UID}" >/dev/null 2>&1 ; then
|
||||
HOST_USER=$(getent passwd "${HOST_UID}" | cut -d: -f1)
|
||||
usermod -g "${HOST_GROUP}" "${HOST_USER}"
|
||||
elif id -u "${HOST_USER}" >/dev/null 2>&1 ; then
|
||||
usermod -u "${HOST_UID}" -g "${HOST_GROUP}" "${HOST_USER}"
|
||||
else
|
||||
useradd -m -u "${HOST_UID}" -g "${HOST_GROUP}" -s /bin/bash "${HOST_USER}"
|
||||
fi
|
||||
|
||||
echo "${HOST_USER} ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/orcaslicer-builder
|
||||
chmod 0440 /etc/sudoers.d/orcaslicer-builder
|
||||
}
|
||||
|
||||
create_builder_user
|
||||
mkdir -p "${GITHUB_WORKSPACE}/deps/build/destdir"
|
||||
chown -R "${HOST_UID}:${HOST_GID}" "${GITHUB_WORKSPACE}/deps/build"
|
||||
if [[ -d "${GITHUB_WORKSPACE}/build" ]] ; then
|
||||
chown -R "${HOST_UID}:${HOST_GID}" "${GITHUB_WORKSPACE}/build"
|
||||
fi
|
||||
if [[ -d "${GITHUB_WORKSPACE}/build-dbg" ]] ; then
|
||||
chown -R "${HOST_UID}:${HOST_GID}" "${GITHUB_WORKSPACE}/build-dbg"
|
||||
fi
|
||||
if [[ -d "${GITHUB_WORKSPACE}/build-dbginfo" ]] ; then
|
||||
chown -R "${HOST_UID}:${HOST_GID}" "${GITHUB_WORKSPACE}/build-dbginfo"
|
||||
fi
|
||||
|
||||
sudo -H -u "${HOST_USER}" env \
|
||||
CMAKE_BUILD_PARALLEL_LEVEL="${CMAKE_BUILD_PARALLEL_LEVEL-}" \
|
||||
GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" \
|
||||
GIT_CEILING_DIRECTORIES="${GIT_CEILING_DIRECTORIES-}" \
|
||||
ORCA_UPDATER_SIG_KEY="${ORCA_UPDATER_SIG_KEY-}" \
|
||||
bash -c '
|
||||
set -e
|
||||
cd "${GITHUB_WORKSPACE}"
|
||||
if [[ "$#" -gt 0 ]] ; then
|
||||
./build_linux.sh "$@"
|
||||
else
|
||||
echo "No build steps were requested after container setup."
|
||||
fi
|
||||
' bash "$@"
|
||||
EOF
|
||||
}
|
||||
|
||||
if [[ -n "${USE_DOCKER}" ]] ; then
|
||||
run_in_docker
|
||||
popd > /dev/null # ${SCRIPT_PATH}
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# cmake 4.x compatibility workaround
|
||||
export CMAKE_POLICY_VERSION_MINIMUM=3.5
|
||||
|
||||
|
||||
1
deps/Boost/Boost.cmake
vendored
1
deps/Boost/Boost.cmake
vendored
@@ -18,6 +18,7 @@ orcaslicer_add_cmake_project(Boost
|
||||
-DBOOST_EXCLUDE_LIBRARIES:STRING=contract|fiber|numpy|stacktrace|wave|test
|
||||
-DBOOST_LOCALE_ENABLE_ICU:BOOL=OFF # do not link to libicu, breaks compatibility between distros
|
||||
-DBUILD_TESTING:BOOL=OFF
|
||||
-DBOOST_IOSTREAMS_ENABLE_BZIP2:BOOL=OFF # avoid libbz2 soname differences in AppImage builds
|
||||
-DBOOST_IOSTREAMS_ENABLE_ZSTD:BOOL=OFF
|
||||
"${_context_abi_line}"
|
||||
"${_context_arch_line}"
|
||||
|
||||
@@ -25,5 +25,6 @@
|
||||
],
|
||||
"retraction_minimum_travel": [
|
||||
"3"
|
||||
]
|
||||
],
|
||||
"printer_agent": "qidi"
|
||||
}
|
||||
52
scripts/appimage_lib_policy.sh
Executable file
52
scripts/appimage_lib_policy.sh
Executable file
@@ -0,0 +1,52 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Libraries that are safer to resolve from the host than bundle into the AppImage.
|
||||
# Keep this list focused on the glibc/runtime loader and host-specific graphics/audio stacks.
|
||||
appimage_is_host_library() {
|
||||
local lib_name
|
||||
lib_name="$(basename "$1")"
|
||||
|
||||
case "$lib_name" in
|
||||
linux-vdso.so.*|linux-gate.so.*|ld-linux*.so*|ld64.so*|ld-musl-*.so*|libc.so*|libpthread.so*|libm.so*|libdl.so*|librt.so*|libresolv.so*|libutil.so*|libanl.so*|libnsl.so*|libBrokenLocale.so*|libcrypt.so*|libnss_*.so*|\
|
||||
libGL.so*|libOpenGL.so*|libGLX*.so*|libGLU.so*|libEGL.so*|libGLES*.so*|libGLdispatch.so*|libdrm.so*|libdrm_*.so*|libgbm.so*|libwayland-*.so*|libxcb*.so*|libX11.so*|libX11-xcb.so*|libXau.so*|libXdmcp.so*|libXext.so*|libXdamage.so*|libXfixes.so*|libXcomposite.so*|libXrender.so*|libXrandr.so*|libXcursor.so*|libXi.so*|libXinerama.so*|libxshmfence.so*|libxkbcommon.so*|libxkbcommon-x11.so*|libSM.so*|libICE.so*|libudev.so*|libasound.so*|libpulse.so*|libpulsecommon*.so*|libjack.so*|libpipewire-*.so*|libvulkan.so*|libva.so*|libva-*.so*|\
|
||||
libgtk-*.so*|libgdk-*.so*|libpango*.so*|libatk*.so*|libatk-bridge-*.so*|libatspi.so*|libcairo*.so*|libgdk_pixbuf-*.so*|libgio-2.0.so*|libgmodule-2.0.so*|libgobject-2.0.so*|libglib-2.0.so*|\
|
||||
libgstreamer-1.0.so*|libgst*.so*|libsoup-*.so*|libwebkit2gtk-*.so*|libjavascriptcoregtk-*.so*|libsecret-1.so*|libmanette-0.2.so*|libenchant-2.so*|libhyphen.so*|libtasn1.so*|\
|
||||
libfontconfig.so*|libfreetype.so*|libharfbuzz*.so*|libfribidi.so*|libgraphite2.so*|libthai.so*|libdatrie.so*|libepoxy.so*|libpixman-1.so*|\
|
||||
libstdc++.so*|libgcc_s.so*|libatomic.so*|libdbus-1.so*|libuuid.so*|libffi.so*|libselinux.so*|libmount.so*|libblkid.so*|libpcre2-*.so*|libsystemd.so*|libcap.so*|libseccomp.so*|\
|
||||
libexpat.so*|libz.so*|liblzma.so*|libdeflate.so*|libzstd.so*|libpng*.so*|libjpeg.so*|libtiff.so*|libwebp*.so*|libwoff2*.so*|libjbig.so*|libLerc.so*|liblcms2.so*|libjxl*.so*|libhwy.so*|libsharpyuv.so*|\
|
||||
libxml2.so*|libxslt.so*|libsqlite3.so*|libicu*.so*|libpsl.so*|libnghttp2.so*|libbrotli*.so*|libidn2.so*|libunistring.so*|libgcrypt.so*|libgpg-error.so*|\
|
||||
libgssapi_krb5.so*|libkrb5.so*|libkrb5support.so*|libk5crypto.so*|libcom_err.so*|libkeyutils.so*|liborc-0.4.so*|libgudev-1.0.so*)
|
||||
return 0
|
||||
;;
|
||||
*)
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
appimage_is_elf_file() {
|
||||
file -b "$1" 2>/dev/null | grep -q '^ELF '
|
||||
}
|
||||
|
||||
appimage_list_direct_dependencies() {
|
||||
local target="$1"
|
||||
local line dep
|
||||
|
||||
while IFS= read -r line; do
|
||||
if [[ "$line" == *"=> not found"* ]]; then
|
||||
echo "MISSING:${line%% *}"
|
||||
continue
|
||||
fi
|
||||
|
||||
dep=""
|
||||
if [[ "$line" == *"=>"* ]]; then
|
||||
dep="$(printf '%s\n' "$line" | sed -n 's/.*=> \(\/[^ ]*\).*/\1/p')"
|
||||
elif [[ "$line" =~ ^[[:space:]]/ ]]; then
|
||||
dep="$(printf '%s\n' "$line" | awk '{print $1}')"
|
||||
fi
|
||||
|
||||
if [[ -n "$dep" ]]; then
|
||||
echo "$dep"
|
||||
fi
|
||||
done < <(ldd "$target" 2>/dev/null || true)
|
||||
}
|
||||
99
scripts/check_appimage_libs.sh
Executable file
99
scripts/check_appimage_libs.sh
Executable file
@@ -0,0 +1,99 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
|
||||
# shellcheck source=/dev/null
|
||||
source "${SCRIPT_DIR}/appimage_lib_policy.sh"
|
||||
|
||||
usage() {
|
||||
echo "Usage: $0 <appdir> [entrypoint]"
|
||||
}
|
||||
|
||||
if [[ $# -lt 1 || $# -gt 2 ]]; then
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
APPDIR="$1"
|
||||
ENTRYPOINT="${2:-}"
|
||||
|
||||
if [[ ! -d "$APPDIR" ]]; then
|
||||
echo "Error: AppDir does not exist: $APPDIR"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
APPDIR="$(cd -- "$APPDIR" && pwd)"
|
||||
|
||||
if [[ -n "$ENTRYPOINT" ]]; then
|
||||
if [[ ! -e "$ENTRYPOINT" ]]; then
|
||||
echo "Error: entrypoint does not exist: $ENTRYPOINT"
|
||||
exit 1
|
||||
fi
|
||||
ENTRYPOINT="$(cd -- "$(dirname -- "$ENTRYPOINT")" && pwd)/$(basename -- "$ENTRYPOINT")"
|
||||
fi
|
||||
|
||||
declare -a lib_paths=(
|
||||
"$APPDIR/lib/orca-runtime"
|
||||
"$APPDIR/lib"
|
||||
"$APPDIR/bin"
|
||||
)
|
||||
|
||||
for candidate in \
|
||||
"$APPDIR/lib/gstreamer-1.0" \
|
||||
"$APPDIR/lib/gio/modules" \
|
||||
"$APPDIR/lib/gdk-pixbuf-2.0/2.10.0/loaders"; do
|
||||
if [[ -d "$candidate" ]]; then
|
||||
lib_paths+=("$candidate")
|
||||
fi
|
||||
done
|
||||
|
||||
audit_ld_library_path="$(IFS=:; printf '%s' "${lib_paths[*]}")"
|
||||
|
||||
declare -a targets=()
|
||||
declare -A seen_unresolved=()
|
||||
declare -A seen_host=()
|
||||
|
||||
if [[ -n "$ENTRYPOINT" ]]; then
|
||||
targets+=("$ENTRYPOINT")
|
||||
fi
|
||||
|
||||
while IFS= read -r -d '' file; do
|
||||
if appimage_is_elf_file "$file"; then
|
||||
targets+=("$file")
|
||||
fi
|
||||
done < <(find "$APPDIR" -type f -print0)
|
||||
|
||||
for target in "${targets[@]}"; do
|
||||
while IFS= read -r dep; do
|
||||
if [[ "$dep" == MISSING:* ]]; then
|
||||
seen_unresolved["$target -> ${dep#MISSING:}"]=1
|
||||
continue
|
||||
fi
|
||||
|
||||
dep="$(readlink -f "$dep" 2>/dev/null || printf '%s' "$dep")"
|
||||
if [[ "$dep" == "$APPDIR"* ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
if appimage_is_host_library "$dep"; then
|
||||
continue
|
||||
fi
|
||||
|
||||
seen_host["$target -> $dep"]=1
|
||||
done < <(LD_LIBRARY_PATH="$audit_ld_library_path${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" appimage_list_direct_dependencies "$target")
|
||||
done
|
||||
|
||||
if (( ${#seen_unresolved[@]} > 0 )); then
|
||||
echo "AppImage dependency audit failed: unresolved runtime libraries detected"
|
||||
printf '%s\n' "${!seen_unresolved[@]}" | LC_ALL=C sort
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if (( ${#seen_host[@]} > 0 )); then
|
||||
echo "AppImage dependency audit failed: unexpected host libraries are still required"
|
||||
printf '%s\n' "${!seen_host[@]}" | LC_ALL=C sort
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "AppImage dependency audit passed: $APPDIR"
|
||||
@@ -2,9 +2,6 @@
|
||||
<component type="desktop">
|
||||
<id>com.orcaslicer.OrcaSlicer</id>
|
||||
<launchable type="desktop-id">com.orcaslicer.OrcaSlicer.desktop</launchable>
|
||||
<provides>
|
||||
<id>com.orcaslicer.OrcaSlicer.desktop</id>
|
||||
</provides>
|
||||
<name>OrcaSlicer</name>
|
||||
<summary>Get even more perfect prints!</summary>
|
||||
<developer id="com.orcaslicer">
|
||||
@@ -27,11 +24,11 @@
|
||||
</recommends>
|
||||
<screenshots>
|
||||
<screenshot type="default">
|
||||
<image>https://raw.githubusercontent.com/OrcaSlicer/OrcaSlicer/main/scripts/flatpak/images/1.png</image>
|
||||
<image>https://raw.githubusercontent.com/OrcaSlicer/OrcaSlicer/v2.3.2/scripts/flatpak/images/1.png</image>
|
||||
<caption>A model ready to be sliced on a buildplate.</caption>
|
||||
</screenshot>
|
||||
<screenshot>
|
||||
<image>https://raw.githubusercontent.com/OrcaSlicer/OrcaSlicer/main/scripts/flatpak/images/2.png</image>
|
||||
<image>https://raw.githubusercontent.com/OrcaSlicer/OrcaSlicer/v2.3.2/scripts/flatpak/images/2.png</image>
|
||||
<caption>A calibration test ready to be printed out.</caption>
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
@@ -42,17 +39,14 @@
|
||||
<p>Key features include advanced calibration tools, adaptive layer heights, tree supports,
|
||||
multi-material support, and an intuitive interface for both beginners and experts.
|
||||
OrcaSlicer also provides built-in network printing capabilities for compatible printers.</p>
|
||||
<p>Originally forked from Bambu Studio and PrusaSlicer, OrcaSlicer builds on a strong
|
||||
foundation with community-driven improvements and optimizations for print quality
|
||||
and reliability.</p>
|
||||
</description>
|
||||
<branding>
|
||||
<color type="primary" scheme_preference="light">#009688</color>
|
||||
<color type="primary" scheme_preference="dark">#00695C</color>
|
||||
</branding>
|
||||
<releases>
|
||||
<release version="2.3.2-rc" date="2025-03-01">
|
||||
<url type="details">https://github.com/OrcaSlicer/OrcaSlicer/releases/tag/v2.3.2-rc</url>
|
||||
<release version="2.3.2" date="2025-03-23">
|
||||
<url type="details">https://github.com/OrcaSlicer/OrcaSlicer/releases/tag/v2.3.2</url>
|
||||
<description>
|
||||
<p>See the release page for detailed changelog.</p>
|
||||
</description>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
#!/usr/bin/env bash
|
||||
APPIMAGETOOLURL="https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$(uname -m).AppImage"
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@ if [ -f /.dockerenv ] ; then # Only run if inside of a Docker Container
|
||||
sed '0,/AI\x02/{s|AI\x02|\x00\x00\x00|}' -i ../appimagetool.AppImage
|
||||
fi
|
||||
|
||||
sed -i -e 's#/usr#././#g' bin/@SLIC3R_APP_CMD@
|
||||
mv @SLIC3R_APP_CMD@ AppRun
|
||||
chmod +x AppRun
|
||||
|
||||
@@ -28,13 +27,29 @@ Categories=Utility;
|
||||
MimeType=model/stl;application/vnd.ms-3mfdocument;application/prs.wavefront-obj;application/x-amf;
|
||||
EOF
|
||||
|
||||
mkdir -p usr/share/metainfo
|
||||
cat <<EOF > usr/share/metainfo/@SLIC3R_APP_KEY@.appdata.xml
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component type="desktop-application">
|
||||
<id>@SLIC3R_APP_KEY@.desktop</id>
|
||||
<name>@SLIC3R_APP_KEY@</name>
|
||||
<summary>Open-source 3D slicer for FFF and SLA printers</summary>
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
<project_license>AGPL-3.0-or-later</project_license>
|
||||
<description>
|
||||
<p>OrcaSlicer prepares 3D models for printing, including printer profile management, preview tooling, and network-connected device workflows.</p>
|
||||
</description>
|
||||
<launchable type="desktop-id">@SLIC3R_APP_KEY@.desktop</launchable>
|
||||
</component>
|
||||
EOF
|
||||
|
||||
|
||||
export ARCH=$(uname -m)
|
||||
|
||||
if [ -f /.dockerenv ] ; then # Only run if inside of a Docker Container
|
||||
../appimagetool.AppImage --appimage-extract-and-run . $([ ! -z "${container}" ] && echo '--appimage-extract-and-run')
|
||||
../appimagetool.AppImage --appimage-extract-and-run . $([ -n "${container}" ] && echo '--appimage-extract-and-run')
|
||||
else
|
||||
../appimagetool.AppImage . $([ ! -z "${container}" ] && echo '--appimage-extract-and-run')
|
||||
../appimagetool.AppImage . $([ -n "${container}" ] && echo '--appimage-extract-and-run')
|
||||
fi
|
||||
|
||||
mv @SLIC3R_APP_KEY@-$(uname -m).AppImage ${APP_IMAGE}
|
||||
|
||||
@@ -3,10 +3,25 @@
|
||||
# Despite the script name, this doesn't necessarily create an "image";
|
||||
# it sets up a compatibility script wrapper for the binary and arranges some resources.
|
||||
|
||||
set -e
|
||||
|
||||
export ROOT=$(echo $ROOT | grep . || pwd)
|
||||
export NCORES=`nproc --all`
|
||||
export NCORES=$(nproc --all)
|
||||
CONFIG=Release
|
||||
|
||||
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
|
||||
REPO_ROOT="$(cd -- "${SCRIPT_DIR}/../.." && pwd)"
|
||||
POLICY_FILE="${REPO_ROOT}/scripts/appimage_lib_policy.sh"
|
||||
CHECK_SCRIPT="${REPO_ROOT}/scripts/check_appimage_libs.sh"
|
||||
|
||||
if [ ! -f "${POLICY_FILE}" ]; then
|
||||
echo "Error: missing AppImage helper ${POLICY_FILE}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# shellcheck source=/dev/null
|
||||
source "${POLICY_FILE}"
|
||||
|
||||
while getopts ":ihR:" opt; do
|
||||
case ${opt} in
|
||||
i )
|
||||
@@ -23,35 +38,324 @@ while getopts ":ihR:" opt; do
|
||||
esac
|
||||
done
|
||||
|
||||
echo -n "[9/9] Generating Linux app..."
|
||||
#{
|
||||
# create directory and copy into it
|
||||
if [ -d "package" ]; then
|
||||
rm -rf package
|
||||
fi
|
||||
mkdir -p package/bin
|
||||
copy_directory_if_present() {
|
||||
local src_dir="$1"
|
||||
local dst_dir="$2"
|
||||
|
||||
if [ -n "$src_dir" ] && [ -d "$src_dir" ]; then
|
||||
mkdir -p "$dst_dir"
|
||||
cp -a "$src_dir"/. "$dst_dir"/
|
||||
fi
|
||||
}
|
||||
|
||||
find_pkg_config_dir() {
|
||||
local variable="$1"
|
||||
shift
|
||||
|
||||
local module
|
||||
for module in "$@"; do
|
||||
if pkg-config --exists "$module" 2>/dev/null; then
|
||||
pkg-config --variable="$variable" "$module" 2>/dev/null || true
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
find_first_existing_file() {
|
||||
local path
|
||||
for path in "$@"; do
|
||||
if [ -f "$path" ]; then
|
||||
printf '%s\n' "$path"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
copy_shared_object_to_dir() {
|
||||
local src="$1"
|
||||
local dst_dir="$2"
|
||||
local src_real dst_name soname
|
||||
|
||||
src_real="$(readlink -f "$src")"
|
||||
dst_name="$(basename "$src_real")"
|
||||
mkdir -p "$dst_dir"
|
||||
cp -fL "$src_real" "$dst_dir/$dst_name"
|
||||
|
||||
if [ -L "$src" ]; then
|
||||
ln -snf "$dst_name" "$dst_dir/$(basename "$src")"
|
||||
fi
|
||||
|
||||
soname="$(objdump -p "$src_real" 2>/dev/null | awk '$1 == "SONAME" { print $2; exit }')"
|
||||
if [ -n "$soname" ] && [ "$soname" != "$dst_name" ]; then
|
||||
ln -snf "$dst_name" "$dst_dir/$soname"
|
||||
fi
|
||||
}
|
||||
|
||||
bundle_dependency_closure() {
|
||||
local dst_dir="$1"
|
||||
shift
|
||||
|
||||
local -a queue=("$@")
|
||||
local target dep dep_real copied_path
|
||||
declare -A seen=()
|
||||
|
||||
while [ ${#queue[@]} -gt 0 ]; do
|
||||
target="${queue[0]}"
|
||||
queue=("${queue[@]:1}")
|
||||
|
||||
if [ ! -e "$target" ] || ! appimage_is_elf_file "$target"; then
|
||||
continue
|
||||
fi
|
||||
|
||||
while IFS= read -r dep; do
|
||||
if [[ "$dep" == MISSING:* ]]; then
|
||||
echo "Error: missing runtime dependency ${dep#MISSING:} while bundling $target"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dep_real="$(readlink -f "$dep" 2>/dev/null || printf '%s' "$dep")"
|
||||
if appimage_is_host_library "$dep_real"; then
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ -n "${seen[$dep_real]}" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
seen[$dep_real]=1
|
||||
copy_shared_object_to_dir "$dep" "$dst_dir"
|
||||
copied_path="$dst_dir/$(basename "$dep_real")"
|
||||
if [ -e "$copied_path" ]; then
|
||||
queue+=("$copied_path")
|
||||
fi
|
||||
done < <(appimage_list_direct_dependencies "$target")
|
||||
done
|
||||
}
|
||||
|
||||
echo -n "[9/9] Generating Linux app..."
|
||||
# {
|
||||
if [ -d "package" ]; then
|
||||
rm -rf package
|
||||
fi
|
||||
|
||||
APPDIR="package"
|
||||
BIN_DIR="$APPDIR/bin"
|
||||
LIB_DIR="$APPDIR/lib"
|
||||
PRIVATE_LIB_DIR="$LIB_DIR/orca-runtime"
|
||||
SHARE_DIR="$APPDIR/share"
|
||||
LIBEXEC_DIR="$APPDIR/libexec"
|
||||
BUNDLE_DESKTOP_STACK="${ORCA_BUNDLE_DESKTOP_STACK:-0}"
|
||||
GST_PLUGIN_DIR="$LIB_DIR/gstreamer-1.0"
|
||||
GIO_MODULE_DIR="$LIB_DIR/gio/modules"
|
||||
GDK_PIXBUF_DIR="$LIB_DIR/gdk-pixbuf-2.0/2.10.0/loaders"
|
||||
|
||||
mkdir -p "$BIN_DIR" "$LIB_DIR" "$PRIVATE_LIB_DIR" "$SHARE_DIR" "$LIBEXEC_DIR"
|
||||
if [ "$BUNDLE_DESKTOP_STACK" = "1" ]; then
|
||||
mkdir -p "$GST_PLUGIN_DIR" "$GIO_MODULE_DIR" "$GDK_PIXBUF_DIR"
|
||||
fi
|
||||
|
||||
cp -Rf ../resources "$APPDIR/resources"
|
||||
|
||||
# Copy Resources
|
||||
cp -Rf ../resources package/resources
|
||||
|
||||
# Find and hard link the @SLIC3R_APP_CMD@ binary from Multi-Config build
|
||||
ORIGINAL_BINARY_LOCATION=""
|
||||
if [ -f "src/${CONFIG}/@SLIC3R_APP_CMD@" ]; then
|
||||
ORIGINAL_BINARY_LOCATION="$(realpath "src/${CONFIG}/@SLIC3R_APP_CMD@")"
|
||||
ORIGINAL_BINARY_LOCATION="$(realpath "src/${CONFIG}/@SLIC3R_APP_CMD@")"
|
||||
elif [ -f "src/@SLIC3R_APP_CMD@" ]; then
|
||||
# Fallback for single-config builds
|
||||
ORIGINAL_BINARY_LOCATION="$(realpath "src/@SLIC3R_APP_CMD@")"
|
||||
else
|
||||
echo "Error: @SLIC3R_APP_CMD@ binary not found in any configuration directory"
|
||||
exit 1
|
||||
fi
|
||||
cp -fl "${ORIGINAL_BINARY_LOCATION}" package/bin/@SLIC3R_APP_CMD@
|
||||
cp -fl "${ORIGINAL_BINARY_LOCATION}" "$BIN_DIR/@SLIC3R_APP_CMD@"
|
||||
|
||||
if [ "$BUNDLE_DESKTOP_STACK" = "1" ]; then
|
||||
GSTREAMER_PLUGIN_SOURCE_DIR="$(find_pkg_config_dir pluginsdir gstreamer-1.0 || true)"
|
||||
if [ -z "$GSTREAMER_PLUGIN_SOURCE_DIR" ]; then
|
||||
GSTREAMER_PLUGIN_SOURCE_DIR="$(find /usr/lib /usr/lib64 -maxdepth 4 -type d -name gstreamer-1.0 2>/dev/null | head -n1)"
|
||||
fi
|
||||
copy_directory_if_present "$GSTREAMER_PLUGIN_SOURCE_DIR" "$GST_PLUGIN_DIR"
|
||||
|
||||
GIO_MODULE_SOURCE_DIR="$(find_pkg_config_dir giomoduledir gio-2.0 || true)"
|
||||
if [ -z "$GIO_MODULE_SOURCE_DIR" ]; then
|
||||
GIO_MODULE_SOURCE_DIR="$(find /usr/lib /usr/lib64 -maxdepth 5 -type d -path '*/gio/modules' 2>/dev/null | head -n1)"
|
||||
fi
|
||||
copy_directory_if_present "$GIO_MODULE_SOURCE_DIR" "$GIO_MODULE_DIR"
|
||||
|
||||
GDK_PIXBUF_SOURCE_DIR="$(find_pkg_config_dir gdk_pixbuf_moduledir gdk-pixbuf-2.0 || true)"
|
||||
if [ -z "$GDK_PIXBUF_SOURCE_DIR" ]; then
|
||||
GDK_PIXBUF_SOURCE_DIR="$(find /usr/lib /usr/lib64 -maxdepth 6 -type d -path '*/gdk-pixbuf-2.0/*/loaders' 2>/dev/null | head -n1)"
|
||||
fi
|
||||
copy_directory_if_present "$GDK_PIXBUF_SOURCE_DIR" "$GDK_PIXBUF_DIR"
|
||||
|
||||
GLIB_SCHEMAS_SOURCE_DIR="$(find_pkg_config_dir schemasdir gio-2.0 || true)"
|
||||
if [ -z "$GLIB_SCHEMAS_SOURCE_DIR" ]; then
|
||||
GLIB_SCHEMAS_SOURCE_DIR="/usr/share/glib-2.0/schemas"
|
||||
fi
|
||||
copy_directory_if_present "$GLIB_SCHEMAS_SOURCE_DIR" "$SHARE_DIR/glib-2.0/schemas"
|
||||
if [ -d "$SHARE_DIR/glib-2.0/schemas" ] && command -v glib-compile-schemas >/dev/null 2>&1; then
|
||||
glib-compile-schemas "$SHARE_DIR/glib-2.0/schemas"
|
||||
fi
|
||||
|
||||
# Distros disagree on where helper executables live: pkg-config may point to libexec,
|
||||
# Debian/Ubuntu often ship the scanner under a multiarch libdir, and RPM distros may use lib64.
|
||||
GST_PLUGIN_SCANNER_SOURCE="$(find_first_existing_file \
|
||||
"$(find_pkg_config_dir pluginscannerdir gstreamer-1.0 || true)/gst-plugin-scanner" \
|
||||
/usr/libexec/gstreamer-1.0/gst-plugin-scanner \
|
||||
/usr/lib/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner \
|
||||
/usr/lib/*/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner \
|
||||
/usr/lib64/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner)" || true
|
||||
if [ -n "$GST_PLUGIN_SCANNER_SOURCE" ]; then
|
||||
mkdir -p "$LIBEXEC_DIR/gstreamer-1.0"
|
||||
cp -fL "$GST_PLUGIN_SCANNER_SOURCE" "$LIBEXEC_DIR/gstreamer-1.0/gst-plugin-scanner"
|
||||
fi
|
||||
|
||||
# Prefer the canonical pkg-config-reported helper path, but keep PATH-based fallbacks
|
||||
# for distros exposing gdk-pixbuf-query-loaders or gdk-pixbuf-query-loaders-64 directly.
|
||||
GDK_PIXBUF_QUERY_LOADERS_SOURCE="$(find_first_existing_file \
|
||||
"$(pkg-config --variable=gdk_pixbuf_query_loaders gdk-pixbuf-2.0 2>/dev/null || true)" \
|
||||
"$(command -v gdk-pixbuf-query-loaders 2>/dev/null || true)" \
|
||||
"$(command -v gdk-pixbuf-query-loaders-64 2>/dev/null || true)")" || true
|
||||
if [ -n "$GDK_PIXBUF_QUERY_LOADERS_SOURCE" ]; then
|
||||
cp -fL "$GDK_PIXBUF_QUERY_LOADERS_SOURCE" "$LIBEXEC_DIR/gdk-pixbuf-query-loaders"
|
||||
fi
|
||||
fi
|
||||
|
||||
# WebKitGTK helper binaries are resolved from distro-specific absolute paths
|
||||
# baked into libwebkit2gtk. Bundling Ubuntu's WebKitGTK inside an AppImage
|
||||
# built with -g makes those helper paths unusable on Fedora and vice versa,
|
||||
# so rely on the host WebKitGTK runtime instead of copying the helper stack.
|
||||
|
||||
mapfile -d '' BUNDLE_TARGETS < <(find "$BIN_DIR" "$LIB_DIR" "$LIBEXEC_DIR" -type f -print0 2>/dev/null)
|
||||
bundle_dependency_closure "$PRIVATE_LIB_DIR" "${BUNDLE_TARGETS[@]}"
|
||||
|
||||
cat << EOF >"$LIBEXEC_DIR/@SLIC3R_APP_CMD@-env"
|
||||
#!/bin/sh
|
||||
set -e
|
||||
SELF_DIR=\$(CDPATH= cd -- "\$(dirname -- "\$0")" && pwd)
|
||||
APPDIR="\${APPDIR:-\$(CDPATH= cd -- "\$SELF_DIR/.." && pwd)}"
|
||||
USE_BUNDLED_WEBKITGTK_STACK=0
|
||||
if [ -e "\$APPDIR/lib/libwebkit2gtk-4.1.so.0" ] || [ -e "\$APPDIR/lib/libwebkit2gtk-4.0.so.0" ]; then
|
||||
USE_BUNDLED_WEBKITGTK_STACK=1
|
||||
fi
|
||||
|
||||
export APPDIR
|
||||
PRIVATE_LIB_DIR="\$APPDIR/lib/orca-runtime"
|
||||
if [ -d "\$PRIVATE_LIB_DIR" ]; then
|
||||
export LD_LIBRARY_PATH="\$PRIVATE_LIB_DIR:\$APPDIR/bin\${LD_LIBRARY_PATH:+:\$LD_LIBRARY_PATH}"
|
||||
else
|
||||
export LD_LIBRARY_PATH="\$APPDIR/bin\${LD_LIBRARY_PATH:+:\$LD_LIBRARY_PATH}"
|
||||
fi
|
||||
|
||||
has_host_runtime_library() {
|
||||
local lib_name path
|
||||
|
||||
if command -v ldconfig >/dev/null 2>&1; then
|
||||
if ldconfig -p 2>/dev/null | grep -Fq " \$lib_name"; then
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
|
||||
for path in \
|
||||
/lib /lib64 /usr/lib /usr/lib64 \
|
||||
/usr/lib/* /usr/lib64/* /lib/* /lib64/*; do
|
||||
if [ -e "\$path/\$lib_name" ]; then
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
target_missing_runtime_library() {
|
||||
local target_bin="\$1"
|
||||
local lib_name="\$2"
|
||||
|
||||
if [ -z "\$target_bin" ] || [ ! -e "\$target_bin" ]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
if command -v ldd >/dev/null 2>&1; then
|
||||
if ldd "\$target_bin" 2>/dev/null | grep -Fq "\$lib_name => not found"; then
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
TARGET_BIN="\$1"
|
||||
|
||||
if target_missing_runtime_library "\$TARGET_BIN" "libOpenGL.so.0" || ! has_host_runtime_library "libOpenGL.so.0"; then
|
||||
echo "Error: missing host OpenGL runtime library libOpenGL.so.0." >&2
|
||||
echo "On Ubuntu/Pop!_OS/Debian, install: libopengl0 and libglu1-mesa" >&2
|
||||
echo "On Arch/CachyOS, install: libglvnd" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "\$USE_BUNDLED_WEBKITGTK_STACK" = "1" ]; then
|
||||
export LD_LIBRARY_PATH="\$APPDIR/lib\${LD_LIBRARY_PATH:+:\$LD_LIBRARY_PATH}"
|
||||
export GST_PLUGIN_SYSTEM_PATH=""
|
||||
export GST_PLUGIN_PATH="\$APPDIR/lib/gstreamer-1.0\${GST_PLUGIN_PATH:+:\$GST_PLUGIN_PATH}"
|
||||
export GIO_EXTRA_MODULES="\$APPDIR/lib/gio/modules\${GIO_EXTRA_MODULES:+:\$GIO_EXTRA_MODULES}"
|
||||
export XDG_DATA_DIRS="\$APPDIR/share\${XDG_DATA_DIRS:+:\$XDG_DATA_DIRS}"
|
||||
|
||||
if [ -d "\$APPDIR/share/glib-2.0/schemas" ]; then
|
||||
export GSETTINGS_SCHEMA_DIR="\$APPDIR/share/glib-2.0/schemas"
|
||||
fi
|
||||
|
||||
if [ -x "\$APPDIR/libexec/gstreamer-1.0/gst-plugin-scanner" ]; then
|
||||
export GST_PLUGIN_SCANNER="\$APPDIR/libexec/gstreamer-1.0/gst-plugin-scanner"
|
||||
fi
|
||||
|
||||
if [ -d "\$APPDIR/lib/gdk-pixbuf-2.0/2.10.0/loaders" ]; then
|
||||
export GDK_PIXBUF_MODULEDIR="\$APPDIR/lib/gdk-pixbuf-2.0/2.10.0/loaders"
|
||||
if [ -x "\$APPDIR/libexec/gdk-pixbuf-query-loaders" ]; then
|
||||
PIXBUF_CACHE_DIR="\${XDG_CACHE_HOME:-\$HOME/.cache}/@SLIC3R_APP_KEY@"
|
||||
PIXBUF_CACHE_FILE="\$PIXBUF_CACHE_DIR/gdk-pixbuf-loaders.cache"
|
||||
mkdir -p "\$PIXBUF_CACHE_DIR"
|
||||
if [ ! -s "\$PIXBUF_CACHE_FILE" ] || find "\$APPDIR/lib/gdk-pixbuf-2.0/2.10.0/loaders" -type f -newer "\$PIXBUF_CACHE_FILE" | grep -q .; then
|
||||
"\$APPDIR/libexec/gdk-pixbuf-query-loaders" "\$APPDIR/lib/gdk-pixbuf-2.0/2.10.0/loaders"/*.so > "\$PIXBUF_CACHE_FILE" 2>/dev/null || true
|
||||
fi
|
||||
if [ -s "\$PIXBUF_CACHE_FILE" ]; then
|
||||
export GDK_PIXBUF_MODULE_FILE="\$PIXBUF_CACHE_FILE"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -d "\$APPDIR/lib/webkit2gtk-4.1" ]; then
|
||||
export WEBKIT_EXEC_PATH="\$APPDIR/lib/webkit2gtk-4.1"
|
||||
elif [ -d "\$APPDIR/lib/webkit2gtk-4.0" ]; then
|
||||
export WEBKIT_EXEC_PATH="\$APPDIR/lib/webkit2gtk-4.0"
|
||||
fi
|
||||
|
||||
if [ -d "\$APPDIR/lib/webkit2gtk-4.1/injected-bundle" ]; then
|
||||
export WEBKIT_INJECTED_BUNDLE_PATH="\$APPDIR/lib/webkit2gtk-4.1/injected-bundle"
|
||||
elif [ -d "\$APPDIR/lib/webkit2gtk-4.0/injected-bundle" ]; then
|
||||
export WEBKIT_INJECTED_BUNDLE_PATH="\$APPDIR/lib/webkit2gtk-4.0/injected-bundle"
|
||||
fi
|
||||
else
|
||||
if target_missing_runtime_library "\$TARGET_BIN" "libwebkit2gtk-4.1.so.0" || \
|
||||
target_missing_runtime_library "\$TARGET_BIN" "libjavascriptcoregtk-4.1.so.0" || \
|
||||
! has_host_runtime_library "libwebkit2gtk-4.1.so.0" || \
|
||||
! has_host_runtime_library "libjavascriptcoregtk-4.1.so.0"; then
|
||||
echo "Error: missing host WebKitGTK 4.1 runtime libraries." >&2
|
||||
echo "Install the distro package providing libwebkit2gtk-4.1.so.0 and libjavascriptcoregtk-4.1.so.0." >&2
|
||||
echo "On Arch/CachyOS, install: webkit2gtk-4.1" >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
exec "\$@"
|
||||
EOF
|
||||
chmod ug+x "$LIBEXEC_DIR/@SLIC3R_APP_CMD@-env"
|
||||
|
||||
# create bin
|
||||
cat << EOF >@SLIC3R_APP_CMD@
|
||||
#!/bin/bash
|
||||
DIR=\$(readlink -f "\$0" | xargs dirname)
|
||||
export LD_LIBRARY_PATH="\$DIR/bin:\$LD_LIBRARY_PATH"
|
||||
DIR=\$(dirname "\$(readlink -f "\$0")")
|
||||
export APPDIR="\${APPDIR:-\$DIR}"
|
||||
|
||||
# FIXME: OrcaSlicer segfault workarounds
|
||||
# 1) OrcaSlicer will segfault on systems where locale info is not as expected (i.e. Holo-ISO arch-based distro)
|
||||
@@ -76,38 +380,33 @@ if [ "\$XDG_SESSION_TYPE" = "wayland" ] && [ "\$ZINK_DISABLE_OVERRIDE" != "1" ];
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
exec "\$DIR/bin/@SLIC3R_APP_CMD@" "\$@"
|
||||
exec "\$DIR/libexec/@SLIC3R_APP_CMD@-env" "\$DIR/bin/@SLIC3R_APP_CMD@" "\$@"
|
||||
EOF
|
||||
|
||||
chmod ug+x @SLIC3R_APP_CMD@
|
||||
cp -fl @SLIC3R_APP_CMD@ package/@SLIC3R_APP_CMD@
|
||||
# Nothing uses this tar? Remove if nobody has complained and it's been a while since this comment added.
|
||||
# Original commit was https://github.com/OrcaSlicer/OrcaSlicer/commit/f5a4862da52fc68f77b5201ddf330a9800d83228
|
||||
# and it doesn't appear to have been used there either.
|
||||
#pushd package > /dev/null
|
||||
#tar -cvf ../@SLIC3R_APP_KEY@.tar . &>/dev/null
|
||||
#popd > /dev/null
|
||||
#} &> $ROOT/Build.log # Capture all command output
|
||||
cp -fl @SLIC3R_APP_CMD@ "$APPDIR/@SLIC3R_APP_CMD@"
|
||||
|
||||
if [ -x "${CHECK_SCRIPT}" ] && [ -z "${ORCA_SKIP_APPIMAGE_AUDIT}" ]; then
|
||||
"${CHECK_SCRIPT}" "$APPDIR" "$BIN_DIR/@SLIC3R_APP_CMD@"
|
||||
fi
|
||||
# } &> $ROOT/Build.log # Capture all command output
|
||||
echo "done"
|
||||
|
||||
if [[ -n "$BUILD_IMAGE" ]]
|
||||
then
|
||||
echo -n "Creating Appimage for distribution..."
|
||||
#{
|
||||
# AppImage script modifies files in place, so make a copy and clean up after.
|
||||
# {
|
||||
rm -rf package_appimage
|
||||
cp -Rf package package_appimage
|
||||
pushd package_appimage > /dev/null
|
||||
chmod +x ../build_appimage.sh
|
||||
if ../build_appimage.sh; then
|
||||
# Clean up on success.
|
||||
popd > /dev/null
|
||||
mv package_appimage/"@SLIC3R_APP_KEY@_Linux_V@SoftFever_VERSION@.AppImage" "@SLIC3R_APP_KEY@_Linux_V@SoftFever_VERSION@.AppImage"
|
||||
rm -fR package_appimage
|
||||
popd > /dev/null
|
||||
mv package_appimage/"@SLIC3R_APP_KEY@_Linux_V@SoftFever_VERSION@.AppImage" "@SLIC3R_APP_KEY@_Linux_V@SoftFever_VERSION@.AppImage"
|
||||
rm -fR package_appimage
|
||||
else
|
||||
# Leave files on failure so you can debug.
|
||||
popd > /dev/null
|
||||
popd > /dev/null
|
||||
fi
|
||||
#} &> $ROOT/Build.log # Capture all command output
|
||||
# } &> $ROOT/Build.log # Capture all command output
|
||||
echo "done"
|
||||
fi
|
||||
|
||||
@@ -7,7 +7,7 @@ set(SLIC3R_APP_KEY "OrcaSlicer")
|
||||
if(NOT DEFINED BBL_INTERNAL_TESTING)
|
||||
set(BBL_INTERNAL_TESTING "0")
|
||||
endif()
|
||||
set(SoftFever_VERSION "2.3.2-dev")
|
||||
set(SoftFever_VERSION "2.3.2")
|
||||
string(REGEX MATCH "^([0-9]+)\\.([0-9]+)\\.([0-9]+)"
|
||||
SoftFever_VERSION_MATCH ${SoftFever_VERSION})
|
||||
set(ORCA_VERSION_MAJOR ${CMAKE_MATCH_1})
|
||||
|
||||
Reference in New Issue
Block a user