Skip to content

Commit

Permalink
Add script for building packages
Browse files Browse the repository at this point in the history
  • Loading branch information
fwcd committed Aug 8, 2023
1 parent 0a3ca38 commit 707e40f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.DS_Store
build
28 changes: 28 additions & 0 deletions build-packages
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

set -e
cd "$(dirname "$0")"

if [ "$(uname -s)" != Linux ]; then
echo "$0 must run on Linux!"
exit 1
fi

echo "==> Setting up build directory"
builddir="$PWD/build"
mkdir -p "$builddir"

echo "==> Building the packages"
# TODO: Other architectures (e.g. aarch64) with QEMU
git submodule foreach "PKGDEST='$builddir' makepkg -s --noconfirm"

echo "==> Set up a package database"
repo-add "$builddir/fwcd.db.tar.gz" "$builddir"/*.pkg.tar.zst

echo "==> Replacing symlinks"
(
cd "$builddir"
for file in *.db *.files; do
cp --remove-destination "$(readlink "$file")" "$file"
done
)

0 comments on commit 707e40f

Please sign in to comment.