-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
55 lines (43 loc) · 1.07 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
ARCH=i386
if [ -n "$1" ]; then ARCH=$1; fi
MAKEPKG="makepkg --config `pwd`/makepkg-$ARCH.conf"
PACMAN="sudo pacman --config pacman-local.conf"
PACKAGES=(
core/filesystem
core/pirix
core/newlib
core/gmp
core/mpfr
core/mpc
core/ncurses
core/zlib
core/freetype2
core/libpng
extra/lua
extra/ttf-dejavu
)
ROOT=/tmp/pirix-root
sudo rm -rf $ROOT
mkdir -p $ROOT/var/lib/pacman
export PATH=$ROOT/usr/bin/:$PATH
export LIBRARY_PATH=$ROOT/usr/lib/
export CPATH=$ROOT/usr/include/
export CFLAGS=-I$CPATH
export LDFLAGS=-L$LIBRARY_PATH
for PACKAGE in ${PACKAGES[@]}; do
REPO=$(echo $PACKAGE | cut -f1 -d "/")
NAME=$(echo $PACKAGE | cut -f2 -d "/")
pushd $PACKAGE > /dev/null
echo makepkg $PACKAGE
$MAKEPKG -A
popd > /dev/null
DEST=/tmp/pirix-repo/$ARCH/$REPO
FILE=$(ls $PACKAGE/ | grep -E "($ARCH|any).pkg" | head -n 1)
mkdir -p $DEST
cp $PACKAGE/$FILE $DEST
repo-add $DEST/$REPO.db.tar.gz $DEST/$FILE &> /dev/null
echo install $PACKAGE
$PACMAN -Sy
(yes | $PACMAN -S $NAME)
done