summaryrefslogtreecommitdiff
path: root/src/stage1
diff options
context:
space:
mode:
authorAndreas Grapentin <andreas@grapentin.org>2018-02-16 13:36:08 +0100
committerAndreas Grapentin <andreas@grapentin.org>2018-02-16 13:36:08 +0100
commitad7ce599c87d7162e870342252893a7280570219 (patch)
tree9b7a6c720ab699f485f3ec61a48a5be534728feb /src/stage1
parentf9ff0c754ec4a03286af636086c1867aa0db3e63 (diff)
now at libnl
Diffstat (limited to 'src/stage1')
-rw-r--r--src/stage1/build_from_deptree.sh2
-rw-r--r--src/stage1/create_chroot.sh18
-rw-r--r--src/stage1/create_makepkg.sh8
-rw-r--r--src/stage1/create_package_tree.sh8
-rw-r--r--src/stage1/patches/expat.patch11
-rw-r--r--src/stage1/patches/json-c.patch11
-rw-r--r--src/stage1/patches/libtasn1.patch13
-rw-r--r--src/stage1/patches/libunistring.patch11
-rw-r--r--src/stage1/patches/p11-kit.patch16
9 files changed, 81 insertions, 17 deletions
diff --git a/src/stage1/build_from_deptree.sh b/src/stage1/build_from_deptree.sh
index ca1444c..f7e727c 100644
--- a/src/stage1/build_from_deptree.sh
+++ b/src/stage1/build_from_deptree.sh
@@ -67,9 +67,7 @@ while [ -s "$_deptree" ]; do
# substitute common variables
sed -i "s#@TARGET@#$_target#g" PKGBUILD
- sed -i "s#@ARCH@#$_arch#g" PKGBUILD
sed -i "s#@LINUX_ARCH@#$_linux_arch#g" PKGBUILD
- sed -i "s#@CHROOTDIR@#$_chrootdir#g" PKGBUILD
# enable the target arch explicitly
sed -i "s/arch=([^)]*/& $_arch/" PKGBUILD
diff --git a/src/stage1/create_chroot.sh b/src/stage1/create_chroot.sh
index af49ecf..f6b9fa9 100644
--- a/src/stage1/create_chroot.sh
+++ b/src/stage1/create_chroot.sh
@@ -23,7 +23,7 @@ set -euo pipefail
msg "preparing a skeleton $_arch chroot"
# create required directories
-rm -rf "$_chrootdir"
+[ -n "${CONTINUE:-}" ] || rm -rf "$_chrootdir"
mkdir -pv "$_chrootdir"/etc/pacman.d/{gnupg,hooks} \
"$_chrootdir"/var/{lib/pacman,cache/pacman/pkg,log} \
"$_chrootdir"/packages/$_arch \
@@ -45,11 +45,13 @@ SigLevel = Never
Server = file://$_chrootdir/packages/\$arch
EOF
-# create an empty local package directory
-tar -czf "$_chrootdir"/packages/$_arch/repo.db.tar.gz -T /dev/null
-tar -czf "$_chrootdir"/packages/$_arch/repo.files.tar.gz -T /dev/null
-ln -s repo.db.tar.gz "$_chrootdir"/packages/$_arch/repo.db
-ln -s repo.files.tar.gz "$_chrootdir"/packages/$_arch/repo.files
+if [ ! -h "$_chrootdir"/packages/$_arch/repo.db ]; then
+ # create an empty local package directory
+ tar -czf "$_chrootdir"/packages/$_arch/repo.db.tar.gz -T /dev/null
+ tar -czf "$_chrootdir"/packages/$_arch/repo.files.tar.gz -T /dev/null
+ ln -s repo.db.tar.gz "$_chrootdir"/packages/$_arch/repo.db
+ ln -s repo.files.tar.gz "$_chrootdir"/packages/$_arch/repo.files
-# test and initialize ALPM library
-pacman --config "$_chrootdir"/etc/pacman.conf -r "$_chrootdir" -Syyu
+ # test and initialize ALPM library
+ pacman --config "$_chrootdir"/etc/pacman.conf -r "$_chrootdir" -Syyu
+fi
diff --git a/src/stage1/create_makepkg.sh b/src/stage1/create_makepkg.sh
index f616d78..c9a92ad 100644
--- a/src/stage1/create_makepkg.sh
+++ b/src/stage1/create_makepkg.sh
@@ -58,10 +58,10 @@ VCSCLIENTS=('bzr::bzr'
'svn::subversion')
CARCH="$_arch"
CHOST="$_target"
-CPPFLAGS="-D_FORTIFY_SOURCE=2"
-CFLAGS="-O2 -pipe -fstack-protector-strong -fno-plt"
-CXXFLAGS="-O2 -pipe -fstack-protector-strong -fno-plt"
-LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"
+CPPFLAGS="--sysroot=$_chrootdir -D_FORTIFY_SOURCE=2"
+CFLAGS="--sysroot=$_chrootdir -O2 -pipe -fstack-protector-strong -fno-plt"
+CXXFLAGS="--sysroot=$_chrootdir -O2 -pipe -fstack-protector-strong -fno-plt"
+LDFLAGS="--sysroot=$_chrootdir -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"
DEBUG_CFLAGS="-g -fvar-tracking-assignments"
DEBUG_CXXFLAGS="-g -fvar-tracking-assignments"
BUILDENV=(!distcc color !ccache check !sign)
diff --git a/src/stage1/create_package_tree.sh b/src/stage1/create_package_tree.sh
index 7e77356..7676c70 100644
--- a/src/stage1/create_package_tree.sh
+++ b/src/stage1/create_package_tree.sh
@@ -27,7 +27,8 @@ if [ ! -f "$_deptree" ]; then
# remove a couple things from base we don't need
_frontier=($(pacman -Sg $_groups | awk '{print $2}' \
- | grep -v lvm2))
+ | grep -v lvm2 \
+ | grep -v mdadm))
while [ ${#_frontier[@]} -gt 0 ]; do
# pop pkg from frontier
@@ -53,6 +54,7 @@ if [ ! -f "$_deptree" ]; then
# add some additional build-order dependencies by hand
_tree[libutil-linux]="${_tree[libutil-linux]}pam libcap-ng ncurses "
+ _tree[gcc-libs]="${_tree[gcc-libs]}libmpfr "
# log package dependency tree
truncate -s0 "$_deptree".FULL
@@ -61,6 +63,6 @@ if [ ! -f "$_deptree" ]; then
done
fi
-cp "$_deptree"{.FULL,}
+[ -n "${CONTINUE:-}" ] || cp "$_deptree"{.FULL,}
-echo "total pkges: $(cat "$_deptree" | wc -l)"
+echo "total pkges: $(cat "$_deptree".FULL | wc -l)"
diff --git a/src/stage1/patches/expat.patch b/src/stage1/patches/expat.patch
new file mode 100644
index 0000000..f1977b7
--- /dev/null
+++ b/src/stage1/patches/expat.patch
@@ -0,0 +1,11 @@
+--- a/PKGBUILD 2018-02-16 13:14:29.306245879 +0100
++++ b/PKGBUILD 2018-02-16 13:16:11.093974920 +0100
+@@ -16,7 +16,7 @@ sha256sums=('d9dc32efba7e74f788fcc4f212a
+
+ build() {
+ cd $pkgname-$pkgver
+- ./configure --prefix=/usr --disable-static
++ ./configure --host=@TARGET@ --prefix=/usr --disable-static
+ make
+ }
+
diff --git a/src/stage1/patches/json-c.patch b/src/stage1/patches/json-c.patch
new file mode 100644
index 0000000..81b57a4
--- /dev/null
+++ b/src/stage1/patches/json-c.patch
@@ -0,0 +1,11 @@
+--- a/PKGBUILD 2018-02-16 08:12:27.566594016 +0100
++++ b/PKGBUILD 2018-02-16 08:12:14.006475850 +0100
+@@ -17,7 +17,7 @@ sha256sums=('26e642456caab38aa9459279b97
+ build() {
+ cd $pkgname-$pkgname-$pkgver-20171207
+ CFLAGS="$CFLAGS -Wno-error"
+- ./configure --prefix=/usr --disable-static
++ ./configure --host=@TARGET@ --prefix=/usr --disable-static
+ make
+ }
+
diff --git a/src/stage1/patches/libtasn1.patch b/src/stage1/patches/libtasn1.patch
new file mode 100644
index 0000000..e205469
--- /dev/null
+++ b/src/stage1/patches/libtasn1.patch
@@ -0,0 +1,13 @@
+--- a/PKGBUILD 2018-02-16 08:07:12.100498831 +0100
++++ b/PKGBUILD 2018-02-16 08:10:02.378659844 +0100
+@@ -18,7 +18,9 @@ validpgpkeys=('1F42418905D8206AA754CCDC2
+
+ build() {
+ cd ${pkgname}-${pkgver}
+- ./configure --prefix=/usr \
++ curl "https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD" \
++ > build-aux/config.sub
++ ./configure --host=@TARGET@ --prefix=/usr \
+ --with-packager=Archlinux \
+ --with-packager-bug-reports="http://bugs.archlinux.org/" \
+ --with-packager-version=${pkgver}-${pkgrel}
diff --git a/src/stage1/patches/libunistring.patch b/src/stage1/patches/libunistring.patch
new file mode 100644
index 0000000..3659bb1
--- /dev/null
+++ b/src/stage1/patches/libunistring.patch
@@ -0,0 +1,11 @@
+--- a/PKGBUILD 2018-02-16 11:37:31.786754109 +0100
++++ b/PKGBUILD 2018-02-16 11:41:06.218762153 +0100
+@@ -20,7 +20,7 @@ md5sums=('03c60d4f7a77e00a8b31220c0ec226
+
+ build() {
+ cd $pkgname-$pkgver
+- ./configure --prefix=/usr
++ ./configure --host=@TARGET@ --prefix=/usr
+ make
+ }
+
diff --git a/src/stage1/patches/p11-kit.patch b/src/stage1/patches/p11-kit.patch
new file mode 100644
index 0000000..ef79728
--- /dev/null
+++ b/src/stage1/patches/p11-kit.patch
@@ -0,0 +1,16 @@
+--- a/PKGBUILD 2018-02-16 08:16:53.522238284 +0100
++++ b/PKGBUILD 2018-02-16 11:06:10.196130006 +0100
+@@ -37,11 +37,11 @@ prepare() {
+ build() {
+ cd $pkgname
+
+- ./configure --prefix=/usr \
++ ./configure --host=@TARGET@ --prefix=/usr \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --libexecdir=/usr/lib \
+- --enable-doc \
++ --disable-doc \
+ --with-module-path=/usr/lib/pkcs11 \
+ --with-trust-paths=/etc/ca-certificates/trust-source:/usr/share/ca-certificates/trust-source
+ make