mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-25 01:40:57 +00:00
Refactor folder (#10475)
Move many third-party components' source codes from the src folder to a new folder called deps_src. The goal is to make the code structure clearer and easier to navigate.
This commit is contained in:
+87
@@ -0,0 +1,87 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
export ROOT=$(echo $ROOT | grep . || pwd)
|
||||
export NCORES=`nproc --all`
|
||||
|
||||
while getopts ":ih" opt; do
|
||||
case ${opt} in
|
||||
i )
|
||||
export BUILD_IMAGE="1"
|
||||
;;
|
||||
h ) echo "Usage: ./build_linux_image.sh [-i]"
|
||||
echo " -i: Generate Appimage (optional)"
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
echo -n "[9/9] Generating Linux app..."
|
||||
#{
|
||||
# create directory and copy into it
|
||||
if [ -d "package" ]
|
||||
then
|
||||
rm -rf package/*
|
||||
rm -rf package/.* 2&>/dev/null
|
||||
else
|
||||
mkdir package
|
||||
fi
|
||||
mkdir package/bin
|
||||
|
||||
# copy Resources
|
||||
cp -Rf ../resources package/resources
|
||||
cp -f src/@SLIC3R_APP_CMD@ package/bin/@SLIC3R_APP_CMD@
|
||||
# remove unneeded po from resources
|
||||
## find package/resources/localization -name "*.po" -type f -delete ## FIXME: DD - do we need this?
|
||||
|
||||
# create bin
|
||||
cat << EOF >@SLIC3R_APP_CMD@
|
||||
#!/bin/bash
|
||||
DIR=\$(readlink -f "\$0" | xargs dirname)
|
||||
export LD_LIBRARY_PATH="\$DIR/bin:\$LD_LIBRARY_PATH"
|
||||
|
||||
# FIXME: OrcaSlicer segfault workarounds
|
||||
# 1) OrcaSlicer will segfault on systems where locale info is not as expected (i.e. Holo-ISO arch-based distro)
|
||||
export LC_ALL=C
|
||||
|
||||
if [ "\$XDG_SESSION_TYPE" = "wayland" ] && [ "\$ZINK_DISABLE_OVERRIDE" != "1" ]; then
|
||||
if command -v glxinfo >/dev/null 2>&1; then
|
||||
RENDERER=\$(glxinfo | grep "OpenGL renderer string:" | sed 's/.*: //')
|
||||
if echo "\$RENDERER" | grep -qi "NVIDIA"; then
|
||||
if command -v nvidia-smi >/dev/null 2>&1; then
|
||||
DRIVER_VERSION=\$(nvidia-smi --query-gpu=driver_version --format=csv,noheader | head -n1)
|
||||
DRIVER_MAJOR=\$(echo "\$DRIVER_VERSION" | cut -d. -f1)
|
||||
[ "\$DRIVER_MAJOR" -gt 555 ] && ZINK_FORCE_OVERRIDE=1
|
||||
fi
|
||||
if [ "\$ZINK_FORCE_OVERRIDE" = "1" ]; then
|
||||
export __GLX_VENDOR_LIBRARY_NAME=mesa
|
||||
export __EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/50_mesa.json
|
||||
export MESA_LOADER_DRIVER_OVERRIDE=zink
|
||||
export GALLIUM_DRIVER=zink
|
||||
export WEBKIT_DISABLE_DMABUF_RENDERER=1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
exec "\$DIR/bin/@SLIC3R_APP_CMD@" "\$@"
|
||||
EOF
|
||||
|
||||
chmod ug+x @SLIC3R_APP_CMD@
|
||||
cp -f @SLIC3R_APP_CMD@ package/@SLIC3R_APP_CMD@
|
||||
pushd package > /dev/null
|
||||
tar -cvf ../@SLIC3R_APP_KEY@.tar . &>/dev/null
|
||||
popd > /dev/null
|
||||
#} &> $ROOT/Build.log # Capture all command output
|
||||
echo "done"
|
||||
|
||||
if [[ -n "$BUILD_IMAGE" ]]
|
||||
then
|
||||
echo -n "Creating Appimage for distribution..."
|
||||
#{
|
||||
pushd package > /dev/null
|
||||
chmod +x ../build_appimage.sh
|
||||
../build_appimage.sh
|
||||
popd > /dev/null
|
||||
mv package/"@SLIC3R_APP_KEY@_Linux_V@SoftFever_VERSION@.AppImage" "@SLIC3R_APP_KEY@_Linux_V@SoftFever_VERSION@.AppImage"
|
||||
#} &> $ROOT/Build.log # Capture all command output
|
||||
echo "done"
|
||||
fi
|
||||
Reference in New Issue
Block a user