Skip to content

Commit 277220b

Browse files
Updates to packaging script and GH workflow
Still a WIP locally using `nektos/act`, pushing these changes in the meantime.
1 parent d8e36f0 commit 277220b

2 files changed

Lines changed: 64 additions & 14 deletions

File tree

.github/workflows/package.yml

Lines changed: 61 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -82,27 +82,75 @@ jobs:
8282
export DEBIAN_FRONTEND=noninteractive
8383
ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime
8484
apt-get update
85-
apt-get install -y curl wget git dpkg-dev fakeroot tzdata zip unzip desktop-file-utils rpm libfuse2 file build-essential binutils
85+
apt-get install -y curl wget git dpkg-dev fakeroot tzdata \
86+
zip unzip desktop-file-utils rpm libfuse2 \
87+
file build-essential binutils
8688
8789
# Detect Ubuntu Codename
88-
UBUNTU_CODENAME=$(lsb_release -cs)
89-
90-
# If it's not a supported Ubuntu release, the build script
91-
# should report failure to create Arch package while not
92-
# affecting other packages.
90+
UBUNTU_CODENAME=$(. /etc/os-release && echo "$VERSION_CODENAME")
9391
9492
if [ "$UBUNTU_CODENAME" = "noble" ]; then
9593
echo "Detected Ubuntu 24.04 (Noble). Installing official package..."
96-
sudo apt-get install -y pacman-package-manager
94+
apt-get install -y pacman-package-manager
9795
elif [ "$UBUNTU_CODENAME" = "focal" ]; then
98-
echo "Detected Ubuntu 20.04 (Focal). Installing community port..."
99-
# Use the version compiled for glibc 2.31 (Ubuntu 20.04 standard)
100-
wget https://github.com/ThePoorPilot/pacman-utils/releases/download/6.0.1-2_2.31-0/pacman-utils_6.0.1-2_amd64.deb
101-
sudo dpkg -i pacman-utils_6.0.1-2_amd64.deb
102-
sudo apt-get install -f -y
103-
fi
96+
echo "Detected Ubuntu 20.04 (Focal). Building Arch Linux packaging tools..."
97+
#
98+
# Install pacman, makepkg, and Arch packaging utilities on Ubuntu Linux
99+
#
100+
# Written 2024-06-27 by Ronald Joe Record <ronaldrecord@gmail.com>
101+
102+
apt-get install -y pkg-config meson gcc libtool libgpgme-dev \
103+
libarchive-dev ninja-build libcurl4-openssl-dev \
104+
libssl-dev curl gettext python3 python3-setuptools \
105+
dash gawk ca-certificates fakechroot \
106+
libarchive-tools
107+
108+
# Need a more recent version of Meson
109+
mkdir -p /usr/local/meson
110+
git clone https://github.com/mesonbuild/meson.git /usr/local/meson
111+
CWD=$(pwd)
112+
cd /usr/local/meson
113+
git fetch --tags
114+
git checkout 1.4.2
115+
cd $CWD
116+
117+
[ -f /usr/bin/meson ] && {
118+
mver=$(/usr/bin/meson --version)
119+
mv /usr/bin/meson /usr/bin/meson-${mver}
120+
}
121+
122+
if [ -f /usr/local/meson/meson.py ]; then
123+
ln -s /usr/local/meson/meson.py /usr/bin/meson
124+
else
125+
echo "ERROR: cannot locate /usr/local/meson/meson.py"
126+
exit 1
127+
fi
104128
129+
rm -rf pacman
130+
git clone https://gitlab.archlinux.org/pacman/pacman.git
131+
CWD=$(pwd)
132+
cd pacman
133+
meson setup -Ddoc=disabled build
134+
ninja -C build
135+
136+
[ -d build ] || {
137+
echo "Directory pacman/build does not exist. Exiting."
138+
exit 1
139+
}
140+
cd build
141+
142+
grep mirror scripts/libmakepkg/source/git.sh > /dev/null && {
143+
cat scripts/libmakepkg/source/git.sh | sed -e "s/---mirror//" > /tmp/git$$
144+
cp /tmp/git$$ scripts/libmakepkg/source/git.sh
145+
rm -f /tmp/git$$
146+
}
147+
148+
meson install --no-rebuild --quiet
149+
150+
cd $CWD
151+
fi
105152
- name: Download build
153+
if : env.ACT == ''
106154
uses: actions/download-artifact@v8
107155
with:
108156
name: sourcegit.${{ matrix.runtime }}

build/scripts/package.linux.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ build_arch_package() {
109109
cp -r resources/_common/applications resources/aur/usr/share
110110
cp -r resources/_common/icons resources/aur/usr/share
111111

112-
cd "resources/aur/" && makepkg
112+
cd "resources/aur/" || exit 1
113+
114+
makepkg
113115

114116
cd ../../ # return to previous path
115117

0 commit comments

Comments
 (0)