-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM archlinux:base-devel | ||
|
||
# makepkg cannot (and should not) be run as root: | ||
RUN useradd -m build && \ | ||
pacman -Syu --noconfirm && \ | ||
pacman -Sy --noconfirm git && \ | ||
# Allow build to run stuff as root (to install dependencies): | ||
echo "build ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/build | ||
|
||
# Continue execution (and CMD) as build: | ||
USER build | ||
WORKDIR /home/build | ||
|
||
# Auto-fetch GPG keys (for checking signatures): | ||
RUN mkdir .gnupg && \ | ||
touch .gnupg/gpg.conf && \ | ||
echo "keyserver-options auto-key-retrieve" > .gnupg/gpg.conf && \ | ||
git clone https://aur.archlinux.org/paru-bin.git && \ | ||
cd paru-bin && \ | ||
makepkg --noconfirm --syncdeps --rmdeps --install --clean | ||
|
||
COPY run.sh /run.sh | ||
|
||
# Build the package | ||
WORKDIR /pkg | ||
CMD ["/bin/bash", "/run.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Make a copy so we never alter the original | ||
cp -r /pkg /tmp/pkg | ||
cd /tmp/pkg | ||
|
||
# Sync database | ||
if [ -n "$SYNC_DATABASE" ]; then | ||
paru -S --refresh | ||
fi | ||
|
||
# Do the actual building. Paru will fetch all dependencies for us (including | ||
# AUR dependencies) and then build the package. | ||
paru -U --noconfirm | ||
|
||
# Store the built package(s). Ensure permissions match the original PKGBUILD. | ||
if [ -n "$EXPORT_PKG" ]; then | ||
sudo chown "$(stat -c '%u:%g' /pkg/PKGBUILD)" ./*pkg.tar* | ||
sudo mv ./*pkg.tar* /pkg | ||
fi | ||
# Export .SRCINFO for built package | ||
if [ -n "$EXPORT_SRC" ]; then | ||
makepkg --printsrcinfo > .SRCINFO | ||
sudo chown "$(stat -c '%u:%g' /pkg/PKGBUILD)" ./.SRCINFO | ||
sudo mv ./.SRCINFO /pkg | ||
fi |