summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Grapentin <andreas@grapentin.org>2018-02-14 19:27:02 +0100
committerAndreas Grapentin <andreas@grapentin.org>2018-02-14 19:27:02 +0100
commitbd745d79dd6e0845fcc5d3582b29bf31919329b8 (patch)
treeba9417293467988fcef7a505872615441fc28c5b
parent7d0766a45e16139d2c88523731287c21d370ad69 (diff)
now at libidn
-rw-r--r--src/stage1/build_from_deptree.sh11
-rw-r--r--src/stage1/ca-certificates-utils-shim.sh6
-rw-r--r--src/stage1/create_chroot.sh3
-rw-r--r--src/stage1/gcc-libs-shim.sh6
-rw-r--r--src/stage1/glibc-shim.sh6
-rw-r--r--src/stage1/patches/glibc.patch91
6 files changed, 106 insertions, 17 deletions
diff --git a/src/stage1/build_from_deptree.sh b/src/stage1/build_from_deptree.sh
index 75ea28c..25bf8d0 100644
--- a/src/stage1/build_from_deptree.sh
+++ b/src/stage1/build_from_deptree.sh
@@ -60,13 +60,16 @@ while [ -s "$_deptree" ]; do
fi
done
+ # [ "x$_pkgname" == "xglibc" ] && die "stopping."
+
[ -f "$_srcdir"/stage1/patches/$_pkgname.patch ] || die "missing package patch"
patch -Np1 -i "$_srcdir"/stage1/patches/$_pkgname.patch
# substitute common variables
- sed -i "s/@TARGET@/$_target/" PKGBUILD
- sed -i "s/@ARCH@/$_arch/" PKGBUILD
- sed -i "s/@LINUX_ARCH@/$_linux_arch/" PKGBUILD
+ sed -i "s#@TARGET@#$_target#" PKGBUILD
+ sed -i "s#@ARCH@#$_arch#" PKGBUILD
+ sed -i "s#@LINUX_ARCH@#$_linux_arch#" PKGBUILD
+ sed -i "s#@CHROOTDIR@#$_chrootdir#" PKGBUILD
# enable the target arch explicitly
sed -i "s/arch=([^)]*/& $_arch/" PKGBUILD
@@ -90,7 +93,7 @@ while [ -s "$_deptree" ]; do
rm -rf "$_chrootdir"/var/cache/pacman/pkg/*
rm -rf "$_chrootdir"/packages/$_arch/repo.{db,files}*
repo-add -q -R "$_chrootdir"/packages/$_arch/{repo.db.tar.gz,*.pkg.tar.xz}
- pacman --noscriptlet --noconfirm --force -dd --config "$_chrootdir"/etc/pacman.conf \
+ (yes || true) | pacman --noscriptlet --config "$_chrootdir"/etc/pacman.conf \
-r "$_chrootdir" -Syy $_pkgname
# remove pkg from deptree
diff --git a/src/stage1/ca-certificates-utils-shim.sh b/src/stage1/ca-certificates-utils-shim.sh
index 047d5ec..dc2ddae 100644
--- a/src/stage1/ca-certificates-utils-shim.sh
+++ b/src/stage1/ca-certificates-utils-shim.sh
@@ -48,8 +48,8 @@ url = http://pkgs.fedoraproject.org/cgit/rpms/ca-certificates.git
builddate = $(date '+%s')
size = $(( $(du -sk --apparent-size "$_pkgdir" | cut -d' ' -f1) * 1024 ))
arch = $_arch
-provides = ${_pkgname%-*}
-conflicts = ${_pkgname%-*}
+provide = ${_pkgname%-*}
+conflict = ${_pkgname%-*}
EOF
# package
@@ -71,6 +71,6 @@ cp -alv "$_makepkgdir"/$_pkgname-$_pkgver-$_arch.pkg.tar.xz "$_chrootdir"/packag
rm -rf "$_chrootdir"/var/cache/pacman/pkg/*
rm -rf "$_chrootdir"/packages/$_arch/repo.{db,files}*
repo-add -q -R "$_chrootdir"/packages/$_arch/{repo.db.tar.gz,*.pkg.tar.xz}
-pacman --noscriptlet --noconfirm --force -d --config "$_chrootdir"/etc/pacman.conf \
+pacman --noscriptlet --noconfirm --config "$_chrootdir"/etc/pacman.conf \
-r "$_chrootdir" -Syy $_pkgname
diff --git a/src/stage1/create_chroot.sh b/src/stage1/create_chroot.sh
index e8cc776..af49ecf 100644
--- a/src/stage1/create_chroot.sh
+++ b/src/stage1/create_chroot.sh
@@ -26,7 +26,8 @@ msg "preparing a skeleton $_arch chroot"
rm -rf "$_chrootdir"
mkdir -pv "$_chrootdir"/etc/pacman.d/{gnupg,hooks} \
"$_chrootdir"/var/{lib/pacman,cache/pacman/pkg,log} \
- "$_chrootdir"/packages/$_arch
+ "$_chrootdir"/packages/$_arch \
+ | sed "s#$_chrootdir#\$_chrootdir#"
# create pacman.conf
cat > "$_chrootdir"/etc/pacman.conf << EOF
diff --git a/src/stage1/gcc-libs-shim.sh b/src/stage1/gcc-libs-shim.sh
index ce59e0c..3d1de3a 100644
--- a/src/stage1/gcc-libs-shim.sh
+++ b/src/stage1/gcc-libs-shim.sh
@@ -48,8 +48,8 @@ url = https://github.com/riscv/riscv-gnu-toolchain
builddate = $(date '+%s')
size = $(( $(du -sk --apparent-size "$_pkgdir" | cut -d' ' -f1) * 1024 ))
arch = $_arch
-provides = ${_pkgname%-*}
-conflicts = ${_pkgname%-*}
+provide = ${_pkgname%-*}
+conflict = ${_pkgname%-*}
EOF
# package
@@ -71,5 +71,5 @@ cp -alv "$_makepkgdir"/$_pkgname-$_pkgver-$_arch.pkg.tar.xz "$_chrootdir"/packag
rm -rf "$_chrootdir"/var/cache/pacman/pkg/*
rm -rf "$_chrootdir"/packages/$_arch/repo.{db,files}*
repo-add -q -R "$_chrootdir"/packages/$_arch/{repo.db.tar.gz,*.pkg.tar.xz}
-pacman --noscriptlet --noconfirm --force -dd --config "$_chrootdir"/etc/pacman.conf \
+pacman --noscriptlet --noconfirm --config "$_chrootdir"/etc/pacman.conf \
-r "$_chrootdir" -Syy $_pkgname
diff --git a/src/stage1/glibc-shim.sh b/src/stage1/glibc-shim.sh
index 41192d6..561086a 100644
--- a/src/stage1/glibc-shim.sh
+++ b/src/stage1/glibc-shim.sh
@@ -57,8 +57,8 @@ url = https://github.com/riscv/riscv-gnu-toolchain
builddate = $(date '+%s')
size = $(( $(du -sk --apparent-size "$_pkgdir" | cut -d' ' -f1) * 1024 ))
arch = $_arch
-provides = ${_pkgname%-*}
-conflicts = ${_pkgname%-*}
+provide = ${_pkgname%-*}
+conflict = ${_pkgname%-*}
EOF
# package
@@ -80,5 +80,5 @@ cp -alv "$_makepkgdir"/$_pkgname-$_pkgver-$_arch.pkg.tar.xz "$_chrootdir"/packag
rm -rf "$_chrootdir"/var/cache/pacman/pkg/*
rm -rf "$_chrootdir"/packages/$_arch/repo.{db,files}*
repo-add -q -R "$_chrootdir"/packages/$_arch/{repo.db.tar.gz,*.pkg.tar.xz}
-pacman --noscriptlet --noconfirm --force -dd --config "$_chrootdir"/etc/pacman.conf \
+pacman --noscriptlet --noconfirm --config "$_chrootdir"/etc/pacman.conf \
-r "$_chrootdir" -Syy $_pkgname
diff --git a/src/stage1/patches/glibc.patch b/src/stage1/patches/glibc.patch
index 4239645..3005e9c 100644
--- a/src/stage1/patches/glibc.patch
+++ b/src/stage1/patches/glibc.patch
@@ -1,5 +1,5 @@
---- a/PKGBUILD 2018-02-14 10:59:52.990457019 +0100
-+++ b/PKGBUILD 2018-02-14 11:13:29.113515472 +0100
+--- a/PKGBUILD 2018-02-14 14:48:10.984568398 +0100
++++ b/PKGBUILD 2018-02-14 14:48:49.988404621 +0100
@@ -6,16 +6,16 @@
# NOTE: valgrind requires rebuilt with each major glibc version
@@ -37,7 +37,13 @@
local i; for i in ${source[@]}; do
case ${i%::*} in
-@@ -49,7 +56,7 @@ build() {
+@@ -44,12 +51,12 @@ prepare() {
+ build() {
+ local _configure_flags=(
+ --prefix=/usr
+- --with-headers=/usr/include
++ --with-headers=/usr/@TARGET@/include
+ --with-bugurl=https://bugs.archlinux.org/
--enable-add-ons
--enable-bind-now
--enable-lock-elision
@@ -95,3 +101,82 @@
}
check() {
+@@ -143,7 +119,7 @@ package_glibc() {
+ make -C glibc-build install_root="$pkgdir" install
+ rm -f "$pkgdir"/etc/ld.so.{cache,conf}
+
+- cd glibc
++ cd riscv-gnu-toolchain/riscv-glibc
+
+ install -dm755 "$pkgdir"/usr/lib/{locale,systemd/system,tmpfiles.d}
+ install -m644 nscd/nscd.conf "$pkgdir/etc/nscd.conf"
+@@ -158,7 +134,7 @@ package_glibc() {
+ # create /etc/locale.gen
+ install -m644 "$srcdir/locale.gen.txt" "$pkgdir/etc/locale.gen"
+ sed -e '1,3d' -e 's|/| |g' -e 's|\\| |g' -e 's|^|#|g' \
+- "$srcdir/glibc/localedata/SUPPORTED" >> "$pkgdir/etc/locale.gen"
++ "$srcdir/riscv-gnu-toolchain/riscv-glibc/localedata/SUPPORTED" >> "$pkgdir/etc/locale.gen"
+
+ # Do not strip the following files for improved debugging support
+ # ("improved" as in not breaking gdb and valgrind...):
+@@ -169,56 +145,20 @@ package_glibc() {
+
+ if check_option 'debug' n; then
+ cd "$pkgdir"
+- strip $STRIP_BINARIES usr/bin/{gencat,getconf,getent,iconv,iconvconfig} \
++ @TARGET@-strip $STRIP_BINARIES usr/bin/{gencat,getconf,getent,iconv,iconvconfig} \
+ usr/bin/{ldconfig,locale,localedef,nscd,makedb} \
+ usr/bin/{pcprofiledump,pldd,rpcgen,sln,sprof} \
+ usr/lib/getconf/*
+
+- strip $STRIP_STATIC usr/lib/lib{anl,BrokenLocale,c{,_nonshared},crypt}.a \
++ @TARGET@-strip $STRIP_STATIC usr/lib/lib{anl,BrokenLocale,c{,_nonshared},crypt}.a \
+ usr/lib/lib{dl,g,ieee,mcheck,nsl,pthread{,_nonshared}}.a \
+ usr/lib/lib{resolv,rpcsvc,rt,util}.a \
+- usr/lib/lib{m-${pkgver},mvec{,_nonshared}}.a
++ usr/lib/lib{m-${pkgver},mvec{,_nonshared}}.a || true
+
+- strip $STRIP_SHARED usr/lib/lib{anl,BrokenLocale,cidn,crypt}-${pkgver}.so \
++ @TARGET@-strip $STRIP_SHARED usr/lib/lib{anl,BrokenLocale,cidn,crypt}-${pkgver}.so \
+ usr/lib/libnss_{compat,db,dns,files,hesiod,nis,nisplus}-*.so \
+ usr/lib/lib{dl,m,nsl,resolv,rt,util}-${pkgver}.so \
+ usr/lib/lib{memusage,pcprofile,SegFault}.so \
+ usr/lib/{audit,gconv}/*.so usr/lib/libmvec-*.so || true
+ fi
+ }
+-
+-package_lib32-glibc() {
+- pkgdesc='GNU C Library (32-bit)'
+- depends=("glibc=$pkgver")
+-
+- cd lib32-glibc-build
+-
+- make install_root="$pkgdir" install
+- rm -rf "$pkgdir"/{etc,sbin,usr/{bin,sbin,share},var}
+-
+- # We need to keep 32 bit specific header files
+- find "$pkgdir/usr/include" -type f -not -name '*-32.h' -delete
+-
+- # Dynamic linker
+- install -d "$pkgdir/usr/lib"
+- ln -s ../lib32/ld-linux.so.2 "$pkgdir/usr/lib/"
+-
+- # Add lib32 paths to the default library search path
+- install -Dm644 "$srcdir/lib32-glibc.conf" "$pkgdir/etc/ld.so.conf.d/lib32-glibc.conf"
+-
+- # Symlink /usr/lib32/locale to /usr/lib/locale
+- ln -s ../lib/locale "$pkgdir/usr/lib32/locale"
+-
+- if check_option 'debug' n; then
+- cd $pkgdir
+- strip $STRIP_BINARIES usr/lib32/getconf/*
+- strip $STRIP_STATIC usr/lib32/lib{anl,BrokenLocale,c{,_nonshared},crypt}.a \
+- usr/lib32/lib{dl,g,ieee,mcheck,nsl,pthread{,_nonshared}}.a \
+- usr/lib32/lib{resolv,rpcsvc,rt,util,m}.a
+- strip $STRIP_SHARED usr/lib32/lib{anl,BrokenLocale,cidn,crypt}-${pkgver}.so \
+- usr/lib32/libnss_{compat,db,dns,files,hesiod,nis,nisplus}-*.so \
+- usr/lib32/lib{dl,m,nsl,resolv,rt,util}-${pkgver}.so \
+- usr/lib32/lib{memusage,pcprofile,SegFault}.so \
+- usr/lib32/{audit,gconv}/*.so || true
+- fi
+-}