From 655acd3a233b60c5618d0239e9a716865c0b595a Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Thu, 1 Feb 2018 18:34:42 +0100 Subject: building more utilities --- README | 56 +++--------------------------------------- build_stage1.sh | 5 +++- packages-i486-stage1/curl | 5 ++-- packages-i486-stage1/diffutils | 6 +++++ packages-i486-stage1/ed | 5 ++++ packages-i486-stage1/file | 5 ++++ packages-i486-stage1/findutils | 2 ++ packages-i486-stage1/grep | 2 ++ packages-i486-stage1/kbd | 5 ++++ packages-i486-stage1/patch | 2 ++ packages-i486-stage1/procps-ng | 14 +++++++++++ packages-i486-stage1/sed | 5 ++++ packages-i486-stage1/shadow | 12 +++++++++ packages-i486-stage1/texinfo | 5 ++++ 14 files changed, 73 insertions(+), 56 deletions(-) create mode 100644 packages-i486-stage1/diffutils create mode 100644 packages-i486-stage1/ed create mode 100644 packages-i486-stage1/file create mode 100644 packages-i486-stage1/findutils create mode 100644 packages-i486-stage1/grep create mode 100644 packages-i486-stage1/kbd create mode 100644 packages-i486-stage1/patch create mode 100644 packages-i486-stage1/procps-ng create mode 100644 packages-i486-stage1/sed create mode 100644 packages-i486-stage1/shadow create mode 100644 packages-i486-stage1/texinfo diff --git a/README b/README index ed7a4bd..1908dc8 100644 --- a/README +++ b/README @@ -164,18 +164,16 @@ su cross ./create_ca-certificates-utils_shim.sh # basic packages PACKAGES=" \ - ca-certificates-utils \ archlinux-keyring archlinux32-keyring pacman-mirrorlist pacman \ -sed fakeroot texinfo grep findutils file diffutils ed patch \ + fakeroot \ make mpfr gawk libmpc binutils gcc \ -kbd linux procps-ng shadow uinit \ + linux uinit \ glibc \ net-tools libmnl elfutils libnfnetlink iptables iproute2 \ libedit openssh \ sysfsutils libidn nettle iputils" # libunwind -# file (libmagic) for ... # mpfr for gawk, gcc # libnfnetlink for iptables # libmnl, libelf, iptables for iproute2 @@ -230,10 +228,6 @@ sed -i 's@pacman.conf.i686@pacman.conf.i486@' pacman/PKGBUILD # some more architecture patching sed -i 's@i686@i486@g' pacman/PKGBUILD -# sed -sed -i 's@./configure@./configure --host=i486-unknown-linux-gnu --build=x86_64-pc-linux-gnu@g' sed/PKGBUILD -# gettext: take the one from the host -sed -i 's@makedepends\(.*\)@#makedepends\1@g' sed/PKGBUILD # fakeroot sed -i 's@./configure@./configure --host=i486-unknown-linux-gnu --build=x86_64-pc-linux-gnu@g' fakeroot/PKGBUILD @@ -244,29 +238,11 @@ sed -i 's@\(po4a\)@#\1@g' fakeroot/PKGBUILD #/tmp/alpm_va2bmk/.INSTALL: line 2: usr/bin/ldconfig: No such file or directory #error: command failed to execute correctly -# texinfo -sed -i 's@./configure@./configure --host=i486-unknown-linux-gnu --build=x86_64-pc-linux-gnu@g' texinfo/PKGBUILD -# grep -sed -i 's@./configure@./configure --host=i486-unknown-linux-gnu --build=x86_64-pc-linux-gnu@g' grep/PKGBUILD -# findutils -sed -i 's@./configure@./configure --host=i486-unknown-linux-gnu --build=x86_64-pc-linux-gnu@g' findutils/PKGBUILD -# file -sed -i 's@./configure@./configure --host=i486-unknown-linux-gnu --build=x86_64-pc-linux-gnu@g' file/PKGBUILD -# diffutils -sed -i 's@./configure@./configure --host=i486-unknown-linux-gnu --build=x86_64-pc-linux-gnu@g' diffutils/PKGBUILD -# http://lists.busybox.net/pipermail/buildroot/2017-September/203435.html -sed -i '/.\/configure/ i \ echo "gl_cv_func_getopt_gnu=yes" > config.cache' diffutils/PKGBUILD -sed -i 's@./configure@./configure --cache-file=config.cache@g' diffutils/PKGBUILD -# ed -sed -i 's@./configure@./configure CC=i486-unknown-linux-gnu-gcc@g' ed/PKGBUILD - -# patch -sed -i 's@./configure@./configure --host=i486-unknown-linux-gnu --build=x86_64-pc-linux-gnu@g' patch/PKGBUILD # make sed -i 's@./configure@./configure --host=i486-unknown-linux-gnu --build=x86_64-pc-linux-gnu@g' make/PKGBUILD @@ -335,34 +311,8 @@ sed -i 's@--enable-threads=posix@--disable-threads@' gcc/PKGBUILD # disable all languages but C and C++ use gcc-cross-PKGBUILD -# kbd -sed -i 's@./configure@./configure --host=i486-unknown-linux-gnu --build=x86_64-pc-linux-gnu@g' kbd/PKGBUILD -# no unit testing (using C 'check') -sed -i 's@makedepends\(.*\)@#makedepends\1@g' kbd/PKGBUILD - -# procps-ng -sed -i 's@./configure@./configure --host=i486-unknown-linux-gnu --build=x86_64-pc-linux-gnu@g' procps-ng/PKGBUILD -# no systemd for now -sed -i "/makedepends=/s/'systemd'//" procps-ng/PKGBUILD -sed -i "/depends=/s/'libsystemd'//" procps-ng/PKGBUILD -sed -i 's@--with-systemd@--without-systemd@' procps-ng/PKGBUILD -# do not use the stub rpl_malloc/rpl_realloc functions (they don't cross-compile -# and we know that glibc fixed those problems long time ago) -sed -i '2!N; /prepare()/ a \ sed -i "s/AC_FUNC_MALLOC/dnl AC_FUNC_MALLOC/" configure.ac \ - sed -i "s/AC_FUNC_REALLOC/dnl AC_FUNC_RELLOC/" configure.ac \ - autoconf -' PKGBUILD -# shadow -sed -i 's@./configure@./configure --host=i486-unknown-linux-gnu --build=x86_64-pc-linux-gnu@g' shadow/PKGBUILD -# remove docu and git dependencies -sed -i 's@makedepends\(.*\)@#makedepends\1@g' shadow/PKGBUILD -# needs xml2po -sed -i 's@--enable-man@--disable-man@g' shadow/PKGBUILD -sed -i '/find/,/-delete/{s/\(.*\)/#\1/g}' shadow/PKGBUILD -sed -i '/rmdir/,/man8/{s/\(.*\)/#\1/g}' shadow/PKGBUILD -sed -i 's/^#}/}/' shadow/PKGBUILD -sed -i '2!N; /prepare()/ a \ sed -i "/SUBDIRS/s/man//g" Makefile.am' shadow/PKGBUILD + # uinit sed -i 's/make /make CC=i486-unknown-linux-gnu-gcc /g' uinit/PKGBUILD diff --git a/build_stage1.sh b/build_stage1.sh index 84bac62..7e62520 100755 --- a/build_stage1.sh +++ b/build_stage1.sh @@ -12,7 +12,10 @@ ncurses readline bash joe attr acl gmp gdbm db perl openssl zlib pambase cracklib libtirpc pam libcap coreutils util-linux e2fsprogs -expat bzip2 lz4 xz pcre less gzip tar libarchive curl" +expat bzip2 lz4 xz pcre less gzip tar libarchive curl + +sed texinfo grep findutils file diffutils ed patch +kbd procps-ng shadow" for p in $PACKAGES; do "$SCRIPT_DIR/build_stage1_package.sh" "$p" diff --git a/packages-i486-stage1/curl b/packages-i486-stage1/curl index 1c444d8..88b092f 100644 --- a/packages-i486-stage1/curl +++ b/packages-i486-stage1/curl @@ -17,9 +17,10 @@ sed -i '/--prefix=\/usr/ a \ --without-nghttp2 \\' PKGBUILD sed -i '/--prefix=\/usr/ a \ --without-gssapi \\' PKGBUILD # no ca-certificates, needs tons of tools to build (like p11-kit), so we -# create a fake one with certificates from the host +# create a fake one with certificates from the host (the ca crts from +# ca-certificates-utils should be enough actually) # TODO: is this LE/BE-safe? -# sed -i "/depends=/s/'ca-certificates'//" PKGBUILD +sed -i "/depends=/s/'ca-certificates'//" PKGBUILD # zsh, perl is used to create a completion file for curl and zsh sed -i '/--prefix=\/usr/ a \ --without-zsh-functions-dir \\' PKGBUILD diff --git a/packages-i486-stage1/diffutils b/packages-i486-stage1/diffutils new file mode 100644 index 0000000..57fb376 --- /dev/null +++ b/packages-i486-stage1/diffutils @@ -0,0 +1,6 @@ +# prepare configure for cross-compilation +sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@" PKGBUILD + +# http://lists.busybox.net/pipermail/buildroot/2017-September/203435.html +sed -i '/.\/configure/ i \ echo "gl_cv_func_getopt_gnu=yes" > config.cache' PKGBUILD +sed -i 's@./configure@./configure --cache-file=config.cache@g' PKGBUILD diff --git a/packages-i486-stage1/ed b/packages-i486-stage1/ed new file mode 100644 index 0000000..cdcaa7b --- /dev/null +++ b/packages-i486-stage1/ed @@ -0,0 +1,5 @@ +# ed is needed for patch +SYSROOT_INSTALL=1 + +# prepare configure for cross-compilation +sed -i "s@./configure@./configure CC=$TARGET_ARCH-gcc@" PKGBUILD diff --git a/packages-i486-stage1/file b/packages-i486-stage1/file new file mode 100644 index 0000000..31c2965 --- /dev/null +++ b/packages-i486-stage1/file @@ -0,0 +1,5 @@ +# libmagic is needed for ? (TODO) +SYSROOT_INSTALL=1 + +# prepare configure for cross-compilation +sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@" PKGBUILD diff --git a/packages-i486-stage1/findutils b/packages-i486-stage1/findutils new file mode 100644 index 0000000..8ed7de8 --- /dev/null +++ b/packages-i486-stage1/findutils @@ -0,0 +1,2 @@ +# prepare configure for cross-compilation +sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@g" PKGBUILD diff --git a/packages-i486-stage1/grep b/packages-i486-stage1/grep new file mode 100644 index 0000000..8ed7de8 --- /dev/null +++ b/packages-i486-stage1/grep @@ -0,0 +1,2 @@ +# prepare configure for cross-compilation +sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@g" PKGBUILD diff --git a/packages-i486-stage1/kbd b/packages-i486-stage1/kbd new file mode 100644 index 0000000..2e3bcfb --- /dev/null +++ b/packages-i486-stage1/kbd @@ -0,0 +1,5 @@ +# prepare configure for cross-compilation +sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@" PKGBUILD + +# no unit testing (using C 'check') +sed -i 's@makedepends\(.*\)@#makedepends\1@g' PKGBUILD diff --git a/packages-i486-stage1/patch b/packages-i486-stage1/patch new file mode 100644 index 0000000..1995b5a --- /dev/null +++ b/packages-i486-stage1/patch @@ -0,0 +1,2 @@ +# prepare configure for cross-compilation +sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@" PKGBUILD diff --git a/packages-i486-stage1/procps-ng b/packages-i486-stage1/procps-ng new file mode 100644 index 0000000..26d5bff --- /dev/null +++ b/packages-i486-stage1/procps-ng @@ -0,0 +1,14 @@ +# prepare configure for cross-compilation +sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@" PKGBUILD + +# no systemd for now +sed -i "/makedepends=/s/'systemd'//" PKGBUILD +sed -i "/depends=/s/'libsystemd'//" PKGBUILD +sed -i 's@--with-systemd@--without-systemd@' PKGBUILD + +# do not use the stub rpl_malloc/rpl_realloc functions (they don't cross-compile +# and we know that glibc fixed those problems long time ago) +sed -i '2!N; /prepare()/ a \ sed -i "s/AC_FUNC_MALLOC/dnl AC_FUNC_MALLOC/" configure.ac \ + sed -i "s/AC_FUNC_REALLOC/dnl AC_FUNC_RELLOC/" configure.ac \ + autoconf +' PKGBUILD diff --git a/packages-i486-stage1/sed b/packages-i486-stage1/sed new file mode 100644 index 0000000..e0c5138 --- /dev/null +++ b/packages-i486-stage1/sed @@ -0,0 +1,5 @@ +# prepare configure for cross-compilation +sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@g" PKGBUILD + +# gettext: take the one from the host +sed -i 's@makedepends\(.*\)@#makedepends\1@g' PKGBUILD diff --git a/packages-i486-stage1/shadow b/packages-i486-stage1/shadow new file mode 100644 index 0000000..7c71673 --- /dev/null +++ b/packages-i486-stage1/shadow @@ -0,0 +1,12 @@ +# prepare configure for cross-compilation +sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@" PKGBUILD + +# remove docu and git dependencies +sed -i 's@makedepends\(.*\)@#makedepends\1@g' PKGBUILD + +# building man pages needs xml2po, disable it +sed -i 's@--enable-man@--disable-man@g' PKGBUILD +sed -i '/find/,/-delete/{s/\(.*\)/#\1/g}' PKGBUILD +sed -i '/rmdir/,/man8/{s/\(.*\)/#\1/g}' PKGBUILD +sed -i 's/^#}/}/' PKGBUILD +sed -i '2!N; /prepare()/ a \ sed -i "/SUBDIRS/s/man//g" Makefile.am' PKGBUILD diff --git a/packages-i486-stage1/texinfo b/packages-i486-stage1/texinfo new file mode 100644 index 0000000..8d6ff65 --- /dev/null +++ b/packages-i486-stage1/texinfo @@ -0,0 +1,5 @@ +# texinfo is needed to build grep and other tools +SYSROOT_INSTALL=1 + +# prepare configure for cross-compilation +sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@g" PKGBUILD -- cgit v1.2.3-54-g00ecf