rework of Linux build scripts (#4850)

* rework of Linux build scripts

* change to ninja build system
* distribution specific logic broken out
* n/9 progress entries make no sense, removing
* {}'ing all variables
* sorting help output
* sorting package lists
* project doesn't use submodules, removing logic

Signed-off-by: Jamin W. Collins <jamin.collins@gmail.com>

* drop gtk-2

Signed-off-by: Jamin W. Collins <jamin.collins@gmail.com>

* further refinements of BuildLinux.sh

Signed-off-by: Jamin W. Collins <jamin.collins@gmail.com>

---------

Signed-off-by: Jamin W. Collins <jamin.collins@gmail.com>
This commit is contained in:
Jamin Collins
2024-04-11 08:11:31 -06:00
committed by GitHub
parent ec8d91e14f
commit 654af8e0e4
5 changed files with 228 additions and 157 deletions

3
linux.d/README.md Normal file
View File

@@ -0,0 +1,3 @@
Files in this directory are named for the **exact** output of `awk -F= '/^ID=/ {print $2}' /etc/os-release` for their respective distribution.
When `BuildLinux.sh` is executed, the respective file for the distribution will be sourced so the distribution specific instructions/logic are used.

44
linux.d/arch Normal file
View File

@@ -0,0 +1,44 @@
# these are the Arch Linux specific build functions
FOUND_GTK3=$(pacman -Q gtk3)
# Addtional Dev packages for OrcaSlicer
export REQUIRED_DEV_PACKAGES=(
cmake
curl
dbus
eglexternalplatform
extra-cmake-modules
file
gettext
git
glew
gstreamer
gstreamermm
gtk3
libmspack
libsecret
mesa
ninja
openssl
texinfo
wayland-protocols
webkit2gtk
wget
)
if [[ -n "$UPDATE_LIB" ]]
then
echo -n -e "Updating linux ...\n"
NEEDED_PKGS=""
for PKG in ${REQUIRED_DEV_PACKAGES[@]}; do
pacman -Q ${PKG} > /dev/null || NEEDED_PKGS+=" ${PKG}"
done
if [ -n "${NEEDED_PKGS}" ]; then
sudo pacman -Syy --noconfirm ${NEEDED_PKGS}
fi
echo -e "done\n"
exit 0
fi
FOUND_GTK3_DEV=${FOUND_GTK3}

48
linux.d/fedora Normal file
View File

@@ -0,0 +1,48 @@
FOUND_GTK3=$(rpm -qa | grep -P '^gtk3' || true)
REQUIRED_DEV_PACKAGES=(
autoconf
automake
cmake
dbus-devel
eglexternalplatform-devel
extra-cmake-modules
file
gcc
gcc-c++
gettext
git
gstreamer1-devel
gstreamermm-devel
gtk3-devel
libmspack-devel
libsecret-devel
libtool
m4
mesa-libGLU-devel
mesa-libOSMesa-devel
ninja-build
openssl-devel
perl-FindBin
texinfo
wayland-protocols-devel
webkit2gtk4.0-devel
wget
libcurl-devel
)
if [[ -n "$UPDATE_LIB" ]]
then
NEEDED_PKGS=""
for PKG in ${REQUIRED_DEV_PACKAGES[@]}; do
rpm -q ${PKG} > /dev/null || NEEDED_PKGS+=" ${PKG}"
done
if [ -n "${NEEDED_PKGS}" ]; then
sudo dnf install -y ${NEEDED_PKGS}
fi
echo -e "done\n"
exit 0
fi
FOUND_GTK3_DEV=$(rpm -qa | grep -P '^gtk3-devel' || true)

51
linux.d/ubuntu Normal file
View File

@@ -0,0 +1,51 @@
FOUND_GTK3=$(dpkg -l libgtk* | grep gtk-3)
REQUIRED_DEV_PACKAGES=(
autoconf
build-essential
cmake
eglexternalplatform-dev
extra-cmake-modules
file
gettext
git
libcurl4-openssl-dev
libdbus-1-dev
libglew-dev
libgstreamerd-3-dev
libgtk-3-dev
libmspack-dev
libosmesa6-dev
libsecret-1-dev
libssl-dev
libtool
libudev-dev
libwebkit2gtk-4.0-dev
ninja-build
texinfo
wget
)
if [[ -n "$UPDATE_LIB" ]]
then
# for ubuntu 22+ and 23+:
ubu_major_version="$(grep VERSION_ID /etc/os-release | cut -d "=" -f 2 | cut -d "." -f 1 | tr -d /\"/)"
if [ $ubu_major_version == "22" ] || [ $ubu_major_version == "23" ]
then
REQUIRED_DEV_PACKAGES+=(curl libfuse-dev libssl-dev libcurl4-openssl-dev m4)
fi
if [[ -n "$BUILD_DEBUG" ]]
then
REQUIRED_DEV_PACKAGES+=(libssl-dev libcurl4-openssl-dev)
fi
# TODO: optimize this by checking which, if any, packages are already installed
# install them all at once
sudo apt update
sudo apt install -y ${REQUIRED_DEV_PACKAGES[@]}
echo -e "done\n"
exit 0
fi
FOUND_GTK3_DEV=$(dpkg -l libgtk* | grep gtk-3-dev || echo '')