Skip to content

Commit

Permalink
Merge branch 'SoftFever:main' into feature/smooth_outline
Browse files Browse the repository at this point in the history
  • Loading branch information
philyeahz authored Feb 23, 2025
2 parents e4ca3ac + 906923c commit 2dd40e3
Show file tree
Hide file tree
Showing 271 changed files with 18,877 additions and 8,244 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/check_profiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Run extra JSON check
run: |
python3 ./scripts/orca_extra_profile_check.py
# download
- name: Download
working-directory: ${{ github.workspace }}
Expand All @@ -44,4 +48,4 @@ jobs:
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ Join our Discord community here:<br>

<h3>🚨🚨🚨Important Security Alert🚨🚨🚨</h3>

The only official platforms for OrcaSlicer are **our GitHub project page**, <a href="https://www.orcaslicer.com/">**orcaslicer.com**</a>, and the <a href="https://discord.gg/P4VE9UY9gJ">**official Discord channel**</a>.

Please be aware that "**orcaslicer.net**", "**orcaslicer.co**" or "**orca-slicer.com**" are NOT an official website for OrcaSlicer and may be potentially malicious. These sites appear to use AI-generated content, lacking genuine context and seems to exist solely to profit from advertisements. Worse, it may redirect download links to harmful sources. For your safety, avoid downloading OrcaSlicer from this site as the links may be compromised.

If you see the above sites in your searches, report them as spam or unsafe to the search engine. This small action will assist everyone.

The only official platforms for OrcaSlicer are our GitHub project page and the <a href="https://discord.gg/P4VE9UY9gJ">official Discord channel</a> .

We deeply value our OrcaSlicer community and appreciate all the social groups that support us. However, it is crucial to address the risk posed by any group that falsely claims to be official or misleads its members. If you encounter such a group or are part of one, please assist by encouraging the group owner to add a clear disclaimer or by alerting its members.


Expand Down
77 changes: 72 additions & 5 deletions build_release_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -e
set -o pipefail

while getopts ":dpa:snt:xbc:h" opt; do
while getopts ":dpa:snt:xbc:hu" opt; do
case "${opt}" in
d )
export BUILD_TARGET="deps"
Expand Down Expand Up @@ -37,6 +37,9 @@ while getopts ":dpa:snt:xbc:h" opt; do
1 )
export CMAKE_BUILD_PARALLEL_LEVEL=1
;;
u )
export BUILD_UNIVERSAL="1"
;;
h ) echo "Usage: ./build_release_macos.sh [-d]"
echo " -d: Build deps only"
echo " -a: Set ARCHITECTURE (arm64 or x86_64)"
Expand All @@ -46,6 +49,7 @@ while getopts ":dpa:snt:xbc:h" opt; do
echo " -x: Use Ninja CMake generator, default is Xcode"
echo " -b: Build without reconfiguring CMake"
echo " -c: Set CMake build configuration, default is Release"
echo " -u: Build universal binary (both arm64 and x86_64)"
echo " -1: Use single job for building"
exit 0
;;
Expand All @@ -57,10 +61,18 @@ done
# Set defaults

if [ -z "$ARCH" ]; then
ARCH="$(uname -m)"
if [ "1." == "$BUILD_UNIVERSAL". ]; then
ARCH="universal"
else
ARCH="$(uname -m)"
fi
export ARCH
fi

if [ "1." == "$BUILD_UNIVERSAL". ]; then
echo "Universal build enabled - will create a combined arm64/x86_64 binary"
fi

if [ -z "$BUILD_CONFIG" ]; then
export BUILD_CONFIG="Release"
fi
Expand Down Expand Up @@ -205,16 +217,71 @@ function build_slicer() {
# zip -FSr OrcaSlicer${ver}_Mac_${ARCH}.zip OrcaSlicer.app
}

function build_universal() {
echo "Building universal binary..."
# Save current ARCH
ORIGINAL_ARCH="$ARCH"

# Build x86_64
ARCH="x86_64"
PROJECT_BUILD_DIR="$PROJECT_DIR/build_$ARCH"
DEPS_BUILD_DIR="$DEPS_DIR/build_$ARCH"
DEPS="$DEPS_BUILD_DIR/OrcaSlicer_dep_$ARCH"
build_deps
build_slicer

# Build arm64
ARCH="arm64"
PROJECT_BUILD_DIR="$PROJECT_DIR/build_$ARCH"
DEPS_BUILD_DIR="$DEPS_DIR/build_$ARCH"
DEPS="$DEPS_BUILD_DIR/OrcaSlicer_dep_$ARCH"
build_deps
build_slicer

# Restore original ARCH
ARCH="$ORIGINAL_ARCH"
PROJECT_BUILD_DIR="$PROJECT_DIR/build_$ARCH"
DEPS_BUILD_DIR="$DEPS_DIR/build_$ARCH"
DEPS="$DEPS_BUILD_DIR/OrcaSlicer_dep_$ARCH"

# Create universal binary
echo "Creating universal binary..."
PROJECT_BUILD_DIR="$PROJECT_DIR/build_Universal"
mkdir -p "$PROJECT_BUILD_DIR/OrcaSlicer"
UNIVERSAL_APP="$PROJECT_BUILD_DIR/OrcaSlicer/Universal_OrcaSlicer.app"
rm -rf "$UNIVERSAL_APP"
cp -R "$PROJECT_DIR/build_x86_64/OrcaSlicer/OrcaSlicer.app" "$UNIVERSAL_APP"

# Get the binary path inside the .app bundle
BINARY_PATH="Contents/MacOS/OrcaSlicer"

# Create universal binary using lipo
lipo -create \
"$PROJECT_DIR/build_x86_64/OrcaSlicer/OrcaSlicer.app/$BINARY_PATH" \
"$PROJECT_DIR/build_arm64/OrcaSlicer/OrcaSlicer.app/$BINARY_PATH" \
-output "$UNIVERSAL_APP/$BINARY_PATH"

echo "Universal binary created at $UNIVERSAL_APP"
}

case "${BUILD_TARGET}" in
all)
build_deps
build_slicer
if [ "1." == "$BUILD_UNIVERSAL". ]; then
build_universal
else
build_deps
build_slicer
fi
;;
deps)
build_deps
;;
slicer)
build_slicer
if [ "1." == "$BUILD_UNIVERSAL". ]; then
build_universal
else
build_slicer
fi
;;
*)
echo "Unknown target: $BUILD_TARGET. Available targets: deps, slicer, all."
Expand Down
14 changes: 14 additions & 0 deletions deps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,20 @@ if(NOT FREETYPE_FOUND)
set(FREETYPE_PKG "dep_FREETYPE")
endif()

execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --is-inside-work-tree
RESULT_VARIABLE REV_PARSE_RESULT
OUTPUT_VARIABLE REV_PARSE_OUTPUT
OUTPUT_STRIP_TRAILING_WHITESPACE
)

# Will output "true" and have a 0 return code if within a git repo
if((REV_PARSE_RESULT EQUAL 0) AND (REV_PARSE_OUTPUT STREQUAL "true"))
set(IN_GIT_REPO TRUE)
# Find relative path from root to source used for adjusting patch command
file(RELATIVE_PATH BINARY_DIR_REL ${CMAKE_SOURCE_DIR}/.. ${CMAKE_BINARY_DIR})
endif ()

include(OCCT/OCCT.cmake)
include(OpenCV/OpenCV.cmake)

Expand Down
8 changes: 4 additions & 4 deletions deps/OCCT/OCCT.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ else()
set(library_build_type "Static")
endif()


# get relative path of CMAKE_BINARY_DIR against root source directory
file(RELATIVE_PATH BINARY_DIR_REL ${CMAKE_SOURCE_DIR}/.. ${CMAKE_BINARY_DIR})
if (IN_GIT_REPO)
set(OCCT_DIRECTORY_FLAG --directory ${BINARY_DIR_REL}/dep_OCCT-prefix/src/dep_OCCT)
endif ()

orcaslicer_add_cmake_project(OCCT
URL https://github.com/Open-Cascade-SAS/OCCT/archive/refs/tags/V7_6_0.zip
URL_HASH SHA256=28334f0e98f1b1629799783e9b4d21e05349d89e695809d7e6dfa45ea43e1dbc
#PATCH_COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-OCCT-fix.patch
PATCH_COMMAND git apply --directory ${BINARY_DIR_REL}/dep_OCCT-prefix/src/dep_OCCT --verbose --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-OCCT-fix.patch
PATCH_COMMAND git apply ${OCCT_DIRECTORY_FLAG} --verbose --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-OCCT-fix.patch
#DEPENDS dep_Boost
DEPENDS ${FREETYPE_PKG}
CMAKE_ARGS
Expand Down
6 changes: 5 additions & 1 deletion deps/OpenCV/OpenCV.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ else ()
set(_use_IPP "-DWITH_IPP=OFF")
endif ()

if (IN_GIT_REPO)
set(OpenCV_DIRECTORY_FLAG --directory ${BINARY_DIR_REL}/dep_OpenCV-prefix/src/dep_OpenCV)
endif ()

orcaslicer_add_cmake_project(OpenCV
URL https://github.com/opencv/opencv/archive/refs/tags/4.6.0.tar.gz
URL_HASH SHA256=1ec1cba65f9f20fe5a41fda1586e01c70ea0c9a6d7b67c9e13edf0cfe2239277
PATCH_COMMAND git apply --directory ${BINARY_DIR_REL}/dep_OpenCV-prefix/src/dep_OpenCV --verbose --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-vs2022.patch
PATCH_COMMAND git apply ${OpenCV_DIRECTORY_FLAG} --verbose --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-vs2022.patch
CMAKE_ARGS
-DBUILD_SHARED_LIBS=0
-DBUILD_PERE_TESTS=OFF
Expand Down
Loading

0 comments on commit 2dd40e3

Please sign in to comment.