Skip to content

Commit

Permalink
Add build script
Browse files Browse the repository at this point in the history
  • Loading branch information
Disasm committed May 23, 2021
1 parent 5661e9a commit a195294
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/work
46 changes: 46 additions & 0 deletions build_all
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash

DIR=$(dirname $(readlink -f $0))

if [ ! -f /.dockerenv ]; then
docker run --rm -ti -v "$DIR:/work" archlinux:base-devel /work/build_all
exit $?
fi

# At this point we're inside a docker container running as root
cd "$DIR"

if [ $(id -u) == 0 ]; then
rm -rf work
mkdir work
chmod 777 work

pacman -Sy
echo "MAKEFLAGS=\"-j$(nproc)\"" >> /etc/makepkg.conf

useradd -m build
echo 'build ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/build
su build /work/build_all
exit $?
fi

# At this point we're running as the `build` user

set -e

cd work
cp -r ../packages/* ./

cd glib2-static
makepkg -src --noconfirm --skippgpcheck --nocheck --install
cd ..

cd pcre-static
makepkg -src --noconfirm --skippgpcheck --nocheck --install
cd ..

cd qemu-user-static
makepkg -src --noconfirm --skippgpcheck --nocheck --install

tar xf qemu-user-static-*.pkg.*
cp usr/bin/qemu-riscv64-static ../../

0 comments on commit a195294

Please sign in to comment.