summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Grapentin <andreas@grapentin.org>2018-02-18 16:46:24 +0100
committerAndreas Grapentin <andreas@grapentin.org>2018-02-18 16:46:24 +0100
commit7aac654555e28d4fb7a7d594e6b35d6ca9997432 (patch)
tree62094e80f7c9168f371184d53a1ee699a858ecc4
parente70893e187aef6e1f678d0bf73b6a8d656356757 (diff)
now at readline
-rwxr-xr-xsrc/stage1.sh2
-rw-r--r--src/stage1/build_from_deptree.sh3
-rw-r--r--src/stage1/create_package_tree.sh22
-rw-r--r--src/stage1/patches/binutils.patch19
-rw-r--r--src/stage1/patches/gmp.patch20
-rw-r--r--src/stage1/patches/libcap.patch48
-rw-r--r--src/stage1/patches/libmnl.patch11
-rw-r--r--src/stage1/patches/libmpc.patch11
-rw-r--r--src/stage1/patches/libnftnl.patch11
-rw-r--r--src/stage1/patches/lz4.patch20
-rw-r--r--src/stage1/patches/mpfr.patch11
-rw-r--r--src/stage1/patches/ncurses.patch17
-rw-r--r--src/stage1/patches/sed.patch11
-rw-r--r--src/stage1/patches/sysfsutils.patch13
14 files changed, 211 insertions, 8 deletions
diff --git a/src/stage1.sh b/src/stage1.sh
index 8267937..bf7db01 100755
--- a/src/stage1.sh
+++ b/src/stage1.sh
@@ -34,7 +34,7 @@ export _deptree="$_builddir"/DEPTREE
. src/stage1/create_package_tree.sh
# create temporary shim packages
-if diff -q "$_deptree"{,.FULL}; then
+if diff -q "$_deptree"{,.FULL} >/dev/null; then
for s in gcc-libs glibc ca-certificates-utils; do
. src/stage1/$s-shim.sh
done
diff --git a/src/stage1/build_from_deptree.sh b/src/stage1/build_from_deptree.sh
index fe748ab..827d1d1 100644
--- a/src/stage1/build_from_deptree.sh
+++ b/src/stage1/build_from_deptree.sh
@@ -23,7 +23,7 @@ set -euo pipefail
# keep building packages until the deptree is empty
while [ -s "$_deptree" ]; do
# grab one without unfulfilled dependencies
- _pkgname=$(grep '\[ \]' "$_deptree" | head -n1 | awk '{print $1}')
+ _pkgname=$(grep '\[ *\]' "$_deptree" | head -n1 | awk '{print $1}') || true
[ -n "$_pkgname" ] || die "could not resolve cyclic dependencies. exiting."
_pkgarch=$(pacman -Si $_pkgname | grep '^Architecture' | awk '{print $3}')
@@ -63,6 +63,7 @@ while [ -s "$_deptree" ]; do
# [ "x$_pkgname" == "xlibffi" ] && die "stopping."
[ -f "$_srcdir"/stage1/patches/$_pkgname.patch ] || die "missing package patch"
+ cp PKGBUILD{,.old}
patch -Np1 -i "$_srcdir"/stage1/patches/$_pkgname.patch
# substitute common variables
diff --git a/src/stage1/create_package_tree.sh b/src/stage1/create_package_tree.sh
index 98aef9c..d854380 100644
--- a/src/stage1/create_package_tree.sh
+++ b/src/stage1/create_package_tree.sh
@@ -52,20 +52,30 @@ if [ ! -f "$_deptree" ]; then
done
done
- # 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 "
- _tree[libpsl]="${_tree[libpsl]}publicsuffix-list "
+ # we need mpc, mpfr and gmp to build gcc-libs
+ _tree[gcc-libs]="${_tree[gcc-libs]} libmpc mpfr gmp"
+ # gmp and ncurses can build with gcc-libs-shim
+ _tree[gmp]="${_tree[gmp]/gcc-libs}"
+ _tree[ncurses]="${_tree[ncurses]/gcc-libs}"
+ # we need publicsuffix-list to build libpsl
+ _tree[libpsl]="${_tree[libpsl]} publicsuffix-list"
_tree[publicsuffix-list]=""
+ # we need pam to build libcap
+ _tree[libcap]="${_tree[libcap]} pam"
+ # add util-linux dependencies to libutil-linux
+ _tree[libutil-linux]="${_tree[util-linux]/libutil-linux}"
# TODO: these packages currently don't build
- _tree[libatomic_ops]="${_tree[libatomic_ops]}cantbuild "
+ _tree[libatomic_ops]="${_tree[libatomic_ops]} FIXME"
- # log package dependency tree
+ # write package dependency tree
truncate -s0 "$_deptree".FULL
for i in "${!_tree[@]}"; do
echo "${i} : [${_tree[$i]} ]" >> "$_deptree".FULL
done
+ # we need filesystem to be early, for directories and symlinks
+ sed -i "/^filesystem/d; 1ifilesystem : [${_tree[filesystem]} ]" "$_deptree".FULL
+ cp "$_deptree"{.FULL,}
fi
[ -n "${CONTINUE:-}" ] || cp "$_deptree"{.FULL,}
diff --git a/src/stage1/patches/binutils.patch b/src/stage1/patches/binutils.patch
new file mode 100644
index 0000000..6e3656d
--- /dev/null
+++ b/src/stage1/patches/binutils.patch
@@ -0,0 +1,19 @@
+--- a/PKGBUILD 2018-02-16 20:47:44.703423484 +0100
++++ b/PKGBUILD 2018-02-16 21:57:10.312308048 +0100
+@@ -43,6 +43,7 @@ build() {
+ cd binutils-build
+
+ "$srcdir/binutils-$pkgver/configure" \
++ --host=@TARGET@ \
+ --prefix=/usr \
+ --with-lib-path=/usr/lib:/usr/local/lib \
+ --with-bugurl=https://bugs.archlinux.org/ \
+@@ -56,7 +57,7 @@ build() {
+ --with-pic \
+ --disable-werror \
+ --disable-gdb \
+- --with-system-zlib
++ --with-system-zlib=@SYSROOT@/usr/lib/libz.so
+
+ make configure-host
+ make tooldir=/usr
diff --git a/src/stage1/patches/gmp.patch b/src/stage1/patches/gmp.patch
new file mode 100644
index 0000000..20505d7
--- /dev/null
+++ b/src/stage1/patches/gmp.patch
@@ -0,0 +1,20 @@
+--- a/PKGBUILD 2018-02-16 22:14:13.093407960 +0100
++++ b/PKGBUILD 2018-02-16 22:16:58.398542161 +0100
+@@ -8,7 +8,7 @@ pkgrel=1
+ pkgdesc="A free library for arbitrary precision arithmetic"
+ arch=('x86_64')
+ url="http://gmplib.org/"
+-depends=('gcc-libs' 'sh')
++depends=()
+ license=('LGPL3' 'GPL')
+ source=(https://gmplib.org/download/gmp/gmp-${pkgver}.tar.xz{,.sig})
+ md5sums=('f58fa8001d60c4c77595fbbb62b63c1d'
+@@ -18,7 +18,7 @@ validpgpkeys=('343C2FF0FBEE5EC2EDBEF399F
+ build() {
+ cd "${pkgname}-${pkgver}"
+
+- ./configure --build=${CHOST} \
++ ./configure --host=@TARGET@ --build=${CHOST} \
+ --prefix=/usr \
+ --enable-cxx \
+ --enable-fat
diff --git a/src/stage1/patches/libcap.patch b/src/stage1/patches/libcap.patch
new file mode 100644
index 0000000..43b8681
--- /dev/null
+++ b/src/stage1/patches/libcap.patch
@@ -0,0 +1,48 @@
+--- a/PKGBUILD 2018-02-16 19:41:56.996792407 +0100
++++ b/PKGBUILD 2018-02-16 20:17:25.900329276 +0100
+@@ -13,21 +13,26 @@ license=('GPL2')
+ depends=('glibc' 'attr')
+ makedepends=('linux-api-headers')
+ validpgpkeys=('38A644698C69787344E954CE29EE848AE2CCF3F4') # Andrew G. Morgan <morgan@kernel.org>
+-source=(https://kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-$pkgver.tar.{xz,sign})
+-md5sums=('6666b839e5d46c2ad33fc8aa2ceb5f77' 'SKIP')
++source=(https://kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-$pkgver.tar.{xz,sign}
++ libcap-2.25-gperf.patch)
++md5sums=('6666b839e5d46c2ad33fc8aa2ceb5f77' 'SKIP'
++ '03198e18adb059f9d666d2069ff9e9a7')
+
+ prepare() {
+ cd $pkgname-$pkgver
++ patch -Np1 -i "$srcdir"/libcap-2.25-gperf.patch
+ sed -i "/SBINDIR/s#sbin#bin#" Make.Rules
+ }
+
+ build() {
+- make -C $pkgname-$pkgver KERNEL_HEADERS=/usr/include
++ make -C $pkgname-$pkgver KERNEL_HEADERS=@SYSROOT@/usr/include \
++ CC=@TARGET@-gcc AR=@TARGET@-ar RANLIB=@TARGET@-ranlib
+ }
+
+ package() {
+ cd $pkgname-$pkgver
+- make prefix=/usr lib=/lib DESTDIR="$pkgdir" RAISE_SETFCAP=no install
++ make prefix=/usr lib=/lib DESTDIR="$pkgdir" RAISE_SETFCAP=no install \
++ CC=@TARGET@-gcc AR=@TARGET@-ar RANLIB=@TARGET@-ranlib
+
+ install -Dm644 pam_cap/capability.conf \
+ "$pkgdir"/usr/share/doc/$pkgname/capability.conf.example
+--- /dev/null 2018-01-19 16:58:13.730539592 +0100
++++ b/libcap-2.25-gperf.patch 2018-02-16 20:15:03.278753235 +0100
+@@ -0,0 +1,12 @@
++diff -uNr libcap-2.25.ORIG/libcap/Makefile libcap-2.25/libcap/Makefile
++--- libcap-2.25.ORIG/libcap/Makefile 2017-02-01 09:58:34.966642226 +0000
+++++ libcap-2.25/libcap/Makefile 2017-02-01 10:01:49.943651936 +0000
++@@ -44,7 +44,7 @@
++ ./_makenames > cap_names.h
++
++ $(GPERF_OUTPUT): cap_names.list.h
++- perl -e 'print "struct __cap_token_s { const char *name; int index; };\n%{\nconst struct __cap_token_s *__cap_lookup_name(const char *, unsigned int);\n%}\n%%\n"; while ($$l = <>) { $$l =~ s/[\{\"]//g; $$l =~ s/\}.*// ; print $$l; }' < $< | gperf --ignore-case --language=ANSI-C --readonly --null-strings --global-table --hash-function-name=__cap_hash_name --lookup-function-name="__cap_lookup_name" -c -t -m20 $(INDENT) > $@
+++ perl -e 'print "struct __cap_token_s { const char *name; int index; };\n%%\n"; while ($$l = <>) { $$l =~ s/[\{\"]//g; $$l =~ s/\}.*// ; print $$l; }' < $< | gperf --ignore-case --language=ANSI-C --includes --readonly --null-strings --global-table --hash-function-name=__cap_hash_name --lookup-function-name="__cap_lookup_name" -c -t -m20 $(INDENT) > $@
++
++ cap_names.list.h: Makefile $(KERNEL_HEADERS)/linux/capability.h
++ @echo "=> making $@ from $(KERNEL_HEADERS)/linux/capability.h"
diff --git a/src/stage1/patches/libmnl.patch b/src/stage1/patches/libmnl.patch
new file mode 100644
index 0000000..748bbe1
--- /dev/null
+++ b/src/stage1/patches/libmnl.patch
@@ -0,0 +1,11 @@
+--- a/PKGBUILD 2018-02-16 20:20:49.969249889 +0100
++++ b/PKGBUILD 2018-02-16 20:21:37.159770964 +0100
+@@ -18,7 +18,7 @@ sha1sums=('2db40dea612e88c62fd321906be40
+
+ build() {
+ cd $pkgname-$pkgver
+- ./configure --prefix=/usr
++ ./configure --host=@TARGET@ --prefix=/usr
+ }
+
+ package() {
diff --git a/src/stage1/patches/libmpc.patch b/src/stage1/patches/libmpc.patch
new file mode 100644
index 0000000..818ed7f
--- /dev/null
+++ b/src/stage1/patches/libmpc.patch
@@ -0,0 +1,11 @@
+--- a/PKGBUILD 2018-02-16 22:24:05.046526236 +0100
++++ b/PKGBUILD 2018-02-16 22:24:59.660455083 +0100
+@@ -16,7 +16,7 @@ validpgpkeys=('AD17A21EF8AED8F1CC02DBD9F
+
+ build() {
+ cd "${srcdir}/mpc-${pkgver}"
+- ./configure --prefix=/usr
++ ./configure --host=@TARGET@ --prefix=/usr
+ make
+ }
+
diff --git a/src/stage1/patches/libnftnl.patch b/src/stage1/patches/libnftnl.patch
new file mode 100644
index 0000000..25dfbc4
--- /dev/null
+++ b/src/stage1/patches/libnftnl.patch
@@ -0,0 +1,11 @@
+--- a/PKGBUILD 2018-02-16 20:23:32.691046477 +0100
++++ b/PKGBUILD 2018-02-16 20:23:49.301229841 +0100
+@@ -17,7 +17,7 @@ sha1sums=('90b70f52a26f88ab1106671e797fa
+
+ build() {
+ cd $pkgname-$pkgver
+- ./configure --prefix=/usr
++ ./configure --host=@TARGET@ --prefix=/usr
+ make
+ }
+
diff --git a/src/stage1/patches/lz4.patch b/src/stage1/patches/lz4.patch
new file mode 100644
index 0000000..8c53c2f
--- /dev/null
+++ b/src/stage1/patches/lz4.patch
@@ -0,0 +1,20 @@
+--- a/PKGBUILD 2018-02-16 19:31:06.236301056 +0100
++++ b/PKGBUILD 2018-02-16 19:33:55.671497100 +0100
+@@ -19,7 +19,9 @@ build() {
+ # do not use the main makefile, it calls sub make with -e
+ # exported CLFAGS by makepkg break the version. see FS#50071
+ cd $pkgname
++ CC=@TARGET@-gcc RANLIB=@TARGET@-ranlib AR=@TARGET@-ar \
+ make -C lib PREFIX=/usr
++ CC=@TARGET@-gcc RANLIB=@TARGET@-ranlib AR=@TARGET@-ar \
+ make -C programs PREFIX=/usr lz4 lz4c
+ }
+
+@@ -34,6 +36,7 @@ check() {
+ package() {
+ cd $pkgname
+ # mandir is broken since 1.8.0
++ CC=@TARGET@-gcc RANLIB=@TARGET@-ranlib AR=@TARGET@-ar \
+ make install PREFIX=/usr MANDIR=/usr/share/man/man1 DESTDIR="$pkgdir"
+ }
+
diff --git a/src/stage1/patches/mpfr.patch b/src/stage1/patches/mpfr.patch
new file mode 100644
index 0000000..7d5ec26
--- /dev/null
+++ b/src/stage1/patches/mpfr.patch
@@ -0,0 +1,11 @@
+--- a/PKGBUILD 2018-02-16 22:19:17.763394308 +0100
++++ b/PKGBUILD 2018-02-16 22:22:04.251875869 +0100
+@@ -17,7 +17,7 @@ sha256sums=('67874a60826303ee2fb6affc6dc
+
+ build() {
+ cd $pkgname-$pkgver
+- ./configure --prefix=/usr --enable-thread-safe --enable-shared
++ ./configure --host=@TARGET@ --prefix=/usr --enable-thread-safe --enable-shared
+ make
+ }
+
diff --git a/src/stage1/patches/ncurses.patch b/src/stage1/patches/ncurses.patch
new file mode 100644
index 0000000..b2ae535
--- /dev/null
+++ b/src/stage1/patches/ncurses.patch
@@ -0,0 +1,17 @@
+--- a/PKGBUILD 2018-02-17 22:05:37.429554808 +0100
++++ b/PKGBUILD 2018-02-18 16:38:45.088908642 +0100
+@@ -21,10 +21,12 @@ validpgpkeys=('C52048C0C0748FEE227D47A27
+ build() {
+ cd $pkgname-$pkgver
+
+- ./configure --prefix=/usr --mandir=/usr/share/man \
++ sed -i 's#extern "C" void exit#//&#' c++/etip.h.in
++ ./configure --host=@TARGET@ --prefix=/usr --mandir=/usr/share/man \
+ --with-pkg-config-libdir=/usr/lib/pkgconfig \
+ --with-shared --with-normal --without-debug --without-ada \
+- --enable-widec --enable-pc-files --with-cxx-binding --with-cxx-shared
++ --enable-widec --enable-pc-files --with-cxx-binding --with-cxx-shared \
++ --disable-stripping CPPFLAGS="-I/usr/@TARGET@/usr/include $CPPFLAGS"
+ make
+ }
+
diff --git a/src/stage1/patches/sed.patch b/src/stage1/patches/sed.patch
new file mode 100644
index 0000000..fa8987f
--- /dev/null
+++ b/src/stage1/patches/sed.patch
@@ -0,0 +1,11 @@
+--- a/PKGBUILD 2018-02-16 19:24:53.845544998 +0100
++++ b/PKGBUILD 2018-02-16 19:26:00.706278719 +0100
+@@ -20,7 +20,7 @@ md5sums=('e0c583d4c380059abd818cd540fe69
+
+ build() {
+ cd $pkgname-$pkgver
+- ./configure --prefix=/usr
++ ./configure --host=@TARGET@ --prefix=/usr
+ make
+ }
+
diff --git a/src/stage1/patches/sysfsutils.patch b/src/stage1/patches/sysfsutils.patch
new file mode 100644
index 0000000..ab5158a
--- /dev/null
+++ b/src/stage1/patches/sysfsutils.patch
@@ -0,0 +1,13 @@
+--- a/PKGBUILD 2018-02-16 19:27:56.577550736 +0100
++++ b/PKGBUILD 2018-02-16 19:29:47.035430721 +0100
+@@ -15,7 +15,9 @@ md5sums=('14e7dcd0436d2f49aa403f67e1ef7d
+
+ build() {
+ cd "$pkgname-$pkgver"
+- ./configure --prefix=/usr --mandir=/usr/share/man
++ curl "https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD" \
++ > config.sub
++ ./configure --host=@TARGET@ --prefix=/usr --mandir=/usr/share/man
+ make
+ }
+