Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsupermerill <anonymous@anon.org>2021-08-07 18:45:17 +0300
committerremi durand <remi-j.durand@thalesgroup.com>2021-08-07 18:56:33 +0300
commitf88f224452cee36acfb472622966bb0e77739457 (patch)
tree28457c9ba01d7053737b64f7b88c035c2aa800bc
parentaa1abc251a8894a302c101943b4ff620227a0b46 (diff)
Refine & fix BuildLinux script for fresh ubuntu 20.04
now you have to use an optino to compile, more info on -h
-rwxr-xr-xBuildLinux.sh165
-rw-r--r--src/platform/unix/BuildLinuxImage.sh.in23
2 files changed, 113 insertions, 75 deletions
diff --git a/BuildLinux.sh b/BuildLinux.sh
index 41d7b0114..0107695d9 100755
--- a/BuildLinux.sh
+++ b/BuildLinux.sh
@@ -3,14 +3,28 @@
export ROOT=`pwd`
export NCORES=`nproc --all`
-while getopts ":ih" opt; do
+
+while getopts ":dsiuh" opt; do
case ${opt} in
+ u )
+ UPDATE_LIB="1"
+ ;;
i )
- export BUILD_IMAGE="1"
+ BUILD_IMAGE="1"
+ ;;
+ d )
+ BUILD_DEPS="1"
;;
- h ) echo "Usage: ./BuildLinux.sh [-i][-u]"
+ s )
+ BUILD_SLIC3R="1"
+ ;;
+ h ) echo "Usage: ./BuildLinux.sh [-i][-u][-d][-s]"
echo " -i: Generate appimage (optional)"
+ echo " -d: build deps (optional)"
+ echo " -s: build slic3r (optional)"
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
@@ -22,33 +36,40 @@ then
mkdir build
fi
-
-if [[ -n "$BUILD_IMAGE" ]]
+if [[ -n "$UPDATE_LIB" ]]
then
echo -n "Updating linux ..."
- {
- hwclock -s
- apt update
- apt install libgtk2.0-dev libglew-dev libudev-dev libdbus-1-dev
- } > $ROOT/build/Build.log # Capture all command output
+ hwclock -s
+ apt update
+ apt install libgtk2.0-dev libglew-dev libudev-dev libdbus-1-dev cmake git
echo "done"
exit 0
fi
-echo -n "[1/9] Updating submodules..."
+FOUND_GTK2=$(dpkg -l libgtk* | grep gtk2.0-dev)
+echo "FOUND_GTK2=$FOUND_GTK2)"
+if [[ -z "$FOUND_GTK2" ]]
+then
+ echo "Error, you must install the dependencies before."
+ echo "Use option -u with sudo"
+ exit 0
+fi
+
+echo "[1/9] Updating submodules..."
{
# update submodule profiles
pushd resources/profiles
git submodule update --init
popd
-} > $ROOT/build/Build.log # Capture all command output
+}
+# > $ROOT/build/Build.log # Capture all command output
-echo -n "[2/9] Changing date in version..."
+echo "[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
+ sed -i "s/+UNKNOWN/_$(date '+%F')/" version.inc
+}
+# &> $ROOT/build/Build.log # Capture all command output
echo "done"
# mkdir in deps
@@ -57,66 +78,76 @@ then
mkdir deps/build
fi
-echo -n "[3/9] Configuring dependencies..."
-{
- # cmake deps
- pushd deps/build
- cmake .. -DCMAKE_OSX_DEPLOYMENT_TARGET="10.13"
-} &> $ROOT/build/Build.log # Capture all command output
-echo "done"
-
-echo -n "[4/9] Building dependencies..."
-{
- # make deps
- make -j$NCORES
-} &> $ROOT/build/Build.log # Capture all command output
-echo "done"
-
-echo -n "[5/9] Renaming wxscintilla library..."
-{
- # rename wxscintilla
- pushd destdir/usr/local/lib
- cp libwxscintilla-3.1.a libwx_gtk2u_scintilla-3.1.a
- popd
-} &> $ROOT/build/Build.log # Capture all command output
-echo "done"
-
-echo -n "[6/9] Cleaning dependencies..."
-{
- # clean deps
- rm -rf dep_*
- popd
-} &> $ROOT/build/Build.log # Capture all command output
-echo "done"
-
-echo -n "[7/9] Configuring Slic3r..."
-{
- # cmake
- pushd build
- cmake .. -DCMAKE_PREFIX_PATH="$PWD/../deps/build/destdir/usr/local" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.13" -DSLIC3R_STATIC=1
-} &> $ROOT/build/Build.log # Capture all command output
-echo "done"
-
-echo -n "[8/9] Building Slic3r..."
-{
- # make Slic3r
- make -j$NCORES Slic3r
+if [[ -n "$BUILD_DEPS" ]]
+then
+ echo "[3/9] Configuring dependencies..."
+
+ # cmake deps
+ pushd deps/build
+ cmake ..
+
+ # &> $ROOT/build/Build.log # Capture all command output
+ echo "done"
+
+ echo "[4/9] Building dependencies..."
+
+ # make deps
+ make -j$NCORES
+
+ # &> $ROOT/build/Build.log # Capture all command output
+ echo "done"
+
+ echo "[5/9] Renaming wxscintilla library..."
+
+ # rename wxscintilla
+ pushd destdir/usr/local/lib
+ cp libwxscintilla-3.1.a libwx_gtk2u_scintilla-3.1.a
+ popd
+ # &> $ROOT/build/Build.log # Capture all command output
+ echo "done"
+
+ echo "[6/9] Cleaning dependencies..."
+
+ # clean deps
+ rm -rf dep_*
+ popd
+ # &> $ROOT/build/Build.log # Capture all command output
+ echo "done"
+fi
- # make .mo
- make gettext_po_to_mo
-} &> $ROOT/build/Build.log # Capture all command output
-echo "done"
+if [[ -n "$BUILD_SLIC3R" ]]
+then
+ echo "[7/9] Configuring Slic3r..."
+
+ # cmake
+ pushd build
+ cmake .. -DCMAKE_PREFIX_PATH="$PWD/../deps/build/destdir/usr/local" -DSLIC3R_STATIC=1
+ # &> $ROOT/build/Build.log # Capture all command output
+ echo "done"
+
+ echo "[8/9] Building Slic3r..."
+
+ # make Slic3r
+ make -j$NCORES Slic3r
+
+ # make .mo
+ make gettext_po_to_mo
+
+ popd
+ # &> $ROOT/build/Build.log # Capture all command output
+ echo "done"
+fi
# Give proper permissions to script
chmod 755 $ROOT/build/src/BuildLinuxImage.sh
-echo -n "[9/9] Generating Linux app..."
-{
+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
-} &> $ROOT/build/Build.log # Capture all command output
+# &> $ROOT/build/Build.log # Capture all command output
echo "done"
diff --git a/src/platform/unix/BuildLinuxImage.sh.in b/src/platform/unix/BuildLinuxImage.sh.in
index 24d306612..168e8c7a0 100644
--- a/src/platform/unix/BuildLinuxImage.sh.in
+++ b/src/platform/unix/BuildLinuxImage.sh.in
@@ -16,14 +16,15 @@ while getopts ":ih" opt; do
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
mkdir package/bin
# copy Resources
@@ -32,17 +33,23 @@ echo -n "[9/9] Generating Linux app..."
# create bin
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 u+x @SLIC3R_APP_CMD@
- tar -cvf ../@SLIC3R_APP_KEY@.tar .
-} &> $ROOT/Build.log # Capture all command output
+ 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 -n "Creating Appimage for distribution..."
-{
+#{
+ pushd package
chmod +x ../build_appimage.sh
../build_appimage.sh
-} &> $ROOT/Build.log # Capture all command output
+ popd
+ mv package/"@SLIC3R_APP_KEY@_ubu64.AppImage" "@SLIC3R_APP_KEY@_ubu64.AppImage"
+#} &> $ROOT/Build.log # Capture all command output
echo "done"
fi