Skip to content

Commit

Permalink
Add Package Selection Options
Browse files Browse the repository at this point in the history
Add the ability to add Package Management and select it via the GitHub Actions script.

Update linux-script.sh - Fix Syntax Error
  • Loading branch information
odysseywestra committed Feb 18, 2024
1 parent dd6fe2d commit 38d7441
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/script-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ jobs:
linux:
name: Linux
runs-on: ubuntu-22.04
env:
PKG_MANAGER: apt-get
USE_SUDO: true
steps:
- name: "Checkout Repository"
uses: actions/checkout@v4
Expand Down
33 changes: 25 additions & 8 deletions scripts/linux-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,34 @@ lognote() {
# Need to make the script for package management flexible so that it can be used
# on other systems. Need to make running sudo optional as well.

PKG_MANAGER="apt-get"
UPDATE_CMD="sudo $PKG_MANAGER update"
UPGRADE_CMD="sudo $PKG_MANAGER upgrade"
INSTALL_CMD="sudo $PKG_MANAGER install -y"
REMOVE_CMD="sudo $PKG_MANAGER remove -y"

# Set a package dependency list incase other OS's are used.

DEP_LIST="g++ gettext intltool gir1.2-gtk-3.0 libgtk-3-dev libjson-c-dev \
If [ $USE_SUDO == "true" ]; then
APPEND_SUDO="sudo"
else
APPEND_SUDO=""
fi

if [ $PKG_MANAGER == "apt-get" ]; then
UPDATE_CMD="$APPEND_SUDO apt-get update"
UPGRADE_CMD="$APPEND_SUDO apt-get upgrade"
INSTALL_CMD="$APPEND_SUDO apt-get install -y"
REMOVE_CMD="$APPEND_SUDO apt-get remove -y"
DEP_LIST="g++ gettext intltool gir1.2-gtk-3.0 libgtk-3-dev libjson-c-dev \
liblcms2-dev libpng-dev python3-dev python-gi-dev python3-gi-cairo \
python3-nose python3-numpy python3-setuptools swig git"
elif [ $PKG_MANAGER == "pacman"]; then
UPDATE_CMD="$APPEND_SUDO pacman -Sy"
UPGRADE_CMD="$APPEND_SUDO pacman -Su"
INSTALL_CMD="$APPEND_SUDO pacman -S --noconfirm"
REMOVE_CMD="$APPEND_SUDO pacman -R --noconfirm"
DEP_LIST="base-devel git mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake \
mingw-w64-x86_64-gtk3 mingw-w64-x86_64-json-glib mingw-w64-x86_64-lcms2 \
mingw-w64-x86_64-python3 mingw-w64-x86_64-python3-numpy mingw-w64-x86_64-python3-gobject \
mingw-w64-x86_64-python3-cairo mingw-w64-x86_64-python3-setuptools mingw-w64-x86_64-swig"
else
logerror "No package manager found."
exit 1
fi



Expand Down

0 comments on commit 38d7441

Please sign in to comment.