Skip to content

Commit

Permalink
test linux and macos build
Browse files Browse the repository at this point in the history
  • Loading branch information
supermerill committed Aug 1, 2024
1 parent 8e67a34 commit efc778a
Show file tree
Hide file tree
Showing 23 changed files with 241 additions and 181 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ccpp_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: build deps & slicer
run: ./BuildMacOS.sh -i
run: ./BuildMacOS.sh -dsi
- name: Upload artifact
uses: actions/[email protected]
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ccpp_mac_arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: build deps & slicer
run: ./BuildMacOS.sh -ia
run: ./BuildMacOS.sh -adsi
- name: Upload artifact
uses: actions/[email protected]
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ccpp_mac_arm_debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
with:
ref: 'debug_macos'
- name: build deps & slicer
run: ./BuildMacOS.sh -bia
run: ./BuildMacOS.sh -badsi
- name: ls build
working-directory: ./build
run: ls
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ccpp_mac_arm_rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
with:
ref: 'rc'
- name: build deps & slicer
run: ./BuildMacOS.sh -ia
run: ./BuildMacOS.sh -adsi
- name: Upload artifact
uses: actions/[email protected]
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ccpp_mac_debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
with:
ref: 'debug_macos'
- name: build deps & slicer
run: ./BuildMacOS.sh -bi
run: ./BuildMacOS.sh -bdsi
- name: tar the pack
working-directory: ./build
run: ls
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ccpp_mac_rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
with:
ref: 'rc'
- name: build deps & slicer
run: ./BuildMacOS.sh -i
run: ./BuildMacOS.sh -dsi
- name: Upload artifact
uses: actions/[email protected]
with:
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/ccpp_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,8 @@ jobs:
run: sudo apt update
- name: install gtk2 glew
run: sudo apt install libgtk2.0-dev libglew-dev libudev-dev libdbus-1-dev gettext
- name: build deps & slicer
run: ./BuildLinux.sh -dgs
- name: make .pot
working-directory: ./build
run: make gettext_make_pot
- name: build tar & appimage
working-directory: ./build
run: src/BuildLinuxImage.sh -i
- name: build deps & slicer, tar & appimage
run: ./BuildLinux.sh -dgsi
- name: Upload artifact
uses: actions/[email protected]
with:
Expand Down
13 changes: 2 additions & 11 deletions .github/workflows/ccpp_ubuntu_debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ jobs:
uses: jwlawson/[email protected]
with:
cmake-version: '3.16.x'
- name: update submodule profiles
working-directory: ./resources/profiles
run: git submodule update --init
- name: change date in version
run: sed -i "s/+UNKNOWN/_$(date '+%F')/" version.inc
- name: update clock
Expand All @@ -29,14 +26,8 @@ jobs:
run: sudo apt update
- name: install gtk2 glew
run: sudo apt install libgtk2.0-dev libglew-dev libudev-dev libdbus-1-dev libssl-dev libcurl4-openssl-dev gettext
- name: build deps & slicer
run: ./BuildLinux.sh -bdgs
- name: make .pot
working-directory: ./build
run: make gettext_make_pot
- name: build tar & appimage
working-directory: ./build
run: src/BuildLinuxImage.sh -i
- name: build deps & slicer, tar & appimage
run: ./BuildLinux.sh -bdgsi
- name: Upload artifact
uses: actions/[email protected]
with:
Expand Down
13 changes: 2 additions & 11 deletions .github/workflows/ccpp_ubuntu_gtk3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ jobs:
uses: jwlawson/[email protected]
with:
cmake-version: '3.16.x'
- name: update submodule profiles
working-directory: ./resources/profiles
run: git submodule update --init
- name: change date in version
run: sed -i "s/+UNKNOWN/_$(date '+%F')/" version.inc
- name: update clock
Expand All @@ -30,14 +27,8 @@ jobs:
run: sudo apt update
- name: install gtk3 glew
run: sudo apt install libgtk-3-dev libglew-dev libudev-dev libdbus-1-dev gettext
- name: build deps & slicer
run: ./BuildLinux.sh -ds
- name: make .pot
working-directory: ./build
run: make gettext_make_pot
- name: build tar & appimage
working-directory: ./build
run: src/BuildLinuxImage.sh -i
- name: build deps & slicer, tar & appimage
run: ./BuildLinux.sh -dsi
- name: Upload artifact
uses: actions/[email protected]
with:
Expand Down
13 changes: 2 additions & 11 deletions .github/workflows/ccpp_ubuntu_gtk3_debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ jobs:
uses: jwlawson/[email protected]
with:
cmake-version: '3.16.x'
- name: update submodule profiles
working-directory: ./resources/profiles
run: git submodule update --init
- name: change date in version
run: sed -i "s/+UNKNOWN/_$(date '+%F')/" version.inc
- name: update clock
Expand All @@ -29,14 +26,8 @@ jobs:
run: sudo apt update
- name: install gtk3 glew
run: sudo apt install libgtk-3-dev libglew-dev libudev-dev libdbus-1-dev libssl-dev libcurl4-openssl-dev gettext
- name: build deps & slicer
run: ./BuildLinux.sh -bds
- name: make .pot
working-directory: ./build
run: make gettext_make_pot
- name: build tar & appimage
working-directory: ./build
run: src/BuildLinuxImage.sh -i
- name: build deps & slicer, tar & appimage
run: ./BuildLinux.sh -bdsi
- name: Upload artifact
uses: actions/[email protected]
with:
Expand Down
13 changes: 2 additions & 11 deletions .github/workflows/ccpp_ubuntu_gtk3_rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ jobs:
uses: jwlawson/[email protected]
with:
cmake-version: '3.16.x'
- name: update submodule profiles
working-directory: ./resources/profiles
run: git submodule update --init
- name: change date in version
run: sed -i "s/+UNKNOWN/_$(date '+%F')/" version.inc
- name: update clock
Expand All @@ -31,14 +28,8 @@ jobs:
run: sudo apt update
- name: install gtk3 glew
run: sudo apt install libgtk-3-dev libglew-dev libudev-dev libdbus-1-dev gettext
- name: build deps & slicer
run: ./BuildLinux.sh -ds
- name: make .pot
working-directory: ./build
run: make gettext_make_pot
- name: build tar & appimage
working-directory: ./build
run: src/BuildLinuxImage.sh -i
- name: build deps & slicer, tar & appimage
run: ./BuildLinux.sh -dsi
- name: Upload artifact
uses: actions/[email protected]
with:
Expand Down
13 changes: 2 additions & 11 deletions .github/workflows/ccpp_ubuntu_rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ jobs:
uses: jwlawson/[email protected]
with:
cmake-version: '3.16.x'
- name: update submodule profiles
working-directory: ./resources/profiles
run: git submodule update --init
- name: change date in version
run: sed -i "s/+UNKNOWN//" version.inc
- name: update clock
Expand All @@ -29,14 +26,8 @@ jobs:
run: sudo apt update
- name: install gtk2 glew
run: sudo apt install libgtk2.0-dev libglew-dev libudev-dev libdbus-1-dev gettext
- name: build deps & slicer
run: ./BuildLinux.sh -dgs
- name: make .pot
working-directory: ./build
run: make gettext_make_pot
- name: build tar & appimage
working-directory: ./build
run: src/BuildLinuxImage.sh -i
- name: build deps & slicer, tar & appimage
run: ./BuildLinux.sh -dgsi
- name: Upload artifact
uses: actions/[email protected]
with:
Expand Down
76 changes: 60 additions & 16 deletions BuildLinux.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/bash

export ROOT=`pwd`
export NCORES=`nproc --all`
export NCORES=`nproc`
FOUND_GTK2=$(dpkg -l libgtk* | grep gtk2)
FOUND_GTK3=$(dpkg -l libgtk* | grep gtk-3)

unset name
while getopts ":dsiuhgb" opt; do
while getopts ":hwdrigbsyu" opt; do
case ${opt} in
u )
UPDATE_LIB="1"
Expand All @@ -20,18 +20,31 @@ while getopts ":dsiuhgb" opt; do
s )
BUILD_SLIC3R="1"
;;
t)
BUILD_TESTS="1"
;;
b )
BUILD_DEBUG="1"
;;
g )
FOUND_GTK3=""
;;
h ) echo "Usage: ./BuildLinux.sh [-i][-u][-d][-s][-b][-g]"
w )
BUILD_WIPE="1"
;;
r )
BUILD_CLEANDEPEND="1"
;;
h ) echo "Usage: ./BuildLinux.sh [-h][-w][-d][-r][-i][-g][-b][-s][-t][-u]"
echo " -h: this message"
echo " -w: wipe build directories before building"
echo " -d: build deps (optional)"
echo " -r: clean dependencies building files (reduce disk usage)"
echo " -i: Generate appimage (optional)"
echo " -g: force gtk2 build"
echo " -b: build in debug mode"
echo " -d: build deps (optional)"
echo " -s: build slic3r (optional)"
echo " -b: build with debug symbols"
echo " -s: build Slic3r/SuperSlicer"
echo " -t: build tests (in combination with -s)"
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'"
Expand All @@ -42,12 +55,16 @@ done

if [ $OPTIND -eq 1 ]
then
echo "Usage: ./BuildLinux.sh [-i][-u][-d][-s][-b][-g]"
echo "Usage: ./BuildLinux.sh [-h][-w][-d][-r][-i][-g][-b][-s][-t][-u]"
echo " -h: this message"
echo " -w: wipe build directories before building"
echo " -d: build deps (optional)"
echo " -r: clean dependencies building files (reduce disk usage)"
echo " -i: Generate appimage (optional)"
echo " -g: force gtk2 build"
echo " -b: build in debug mode"
echo " -d: build deps (optional)"
echo " -s: build slic3r (optional)"
echo " -b: build with debug symbols"
echo " -s: build Slic3r/SuperSlicer"
echo " -t: build tests (in combination with -s)"
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'"
Expand Down Expand Up @@ -135,6 +152,17 @@ fi

if [[ -n "$BUILD_DEPS" ]]
then
if [[ -n $BUILD_WIPE ]]
then
echo -e "\n wiping deps/build directory ...\n"
rm -fr deps/build
echo -e " ... done\n"
fi
# mkdir in deps
if [ ! -d "deps/build" ]
then
mkdir deps/build
fi
echo "[3/9] Configuring dependencies..."
BUILD_ARGS=""
if [[ -n "$FOUND_GTK3_DEV" ]]
Expand Down Expand Up @@ -167,20 +195,28 @@ then
pushd destdir/usr/local/lib
if [[ -z "$FOUND_GTK3_DEV" ]]
then
cp libwxscintilla-3.1.a libwx_gtk2u_scintilla-3.1.a
cp libwxscintilla-3.2.a libwx_gtk2u_scintilla-3.2.a
else
cp libwxscintilla-3.1.a libwx_gtk3u_scintilla-3.1.a
cp libwxscintilla-3.2.a libwx_gtk3u_scintilla-3.2.a
fi
popd
echo "done"

# clean deps
echo "[6/9] Cleaning dependencies..."
rm -rf dep_*
popd
echo "done"
fi

# clean deps
if [[ -n "$BUILD_CLEANDEPEND" ]]
then
echo -e "[6/9] Cleaning dependencies...\n"
pushd deps/build
pwd
rm -fr dep_*
popd > /dev/null
echo -e "\n ... done\n"
fi

if [[ -n "$BUILD_SLIC3R" ]]
then
echo "[7/9] Configuring Slic3r..."
Expand All @@ -193,6 +229,12 @@ then
then
BUILD_ARGS="${BUILD_ARGS} -DCMAKE_BUILD_TYPE=Debug"
fi
if [[ -n "$BUILD_TESTS" ]]
then
BUILD_ARGS="${BUILD_ARGS} -DCMAKE_BUILD_TESTS=1"
else
BUILD_ARGS="${BUILD_ARGS} -DCMAKE_BUILD_TESTS=0"
fi

# cmake
pushd build
Expand All @@ -211,7 +253,9 @@ then

# make OCCTWrapper.so
make OCCTWrapper


# update the pot
make gettext_make_pot
popd
echo "done"
fi
Expand Down
Loading

0 comments on commit efc778a

Please sign in to comment.