From 862f382f61eecef00f06922b0450b13d97b71be0 Mon Sep 17 00:00:00 2001 From: Leonid Plyushch Date: Sun, 21 Jul 2019 17:01:19 +0300 Subject: [PATCH] abuild: update to 3.4.0 --- packages/abuild/abuild-fetch.c.patch | 10 +- packages/abuild/abuild.in.patch | 191 +++++++++++--------------- packages/abuild/build.sh | 7 +- packages/abuild/functions.sh.in.patch | 7 +- 4 files changed, 90 insertions(+), 125 deletions(-) diff --git a/packages/abuild/abuild-fetch.c.patch b/packages/abuild/abuild-fetch.c.patch index f09906398..6508fd1b6 100644 --- a/packages/abuild/abuild-fetch.c.patch +++ b/packages/abuild/abuild-fetch.c.patch @@ -1,10 +1,10 @@ -diff -uNr abuild-3.2.0/abuild-fetch.c abuild-3.2.0.mod/abuild-fetch.c ---- abuild-3.2.0/abuild-fetch.c 2018-06-22 10:24:10.000000000 +0300 -+++ abuild-3.2.0.mod/abuild-fetch.c 2018-11-18 13:46:36.361440934 +0200 -@@ -163,7 +163,7 @@ +diff -uNr abuild-3.4.0/abuild-fetch.c abuild-3.4.0.mod/abuild-fetch.c +--- abuild-3.4.0/abuild-fetch.c 2019-06-14 15:13:23.000000000 +0300 ++++ abuild-3.4.0.mod/abuild-fetch.c 2019-07-21 16:45:34.475241394 +0300 +@@ -189,7 +189,7 @@ int main(int argc, char *argv[]) { - int opt, r=0, i; + int opt; - char *destdir = "/var/cache/distfiles"; + char *destdir = "@TERMUX_PREFIX@/var/cache/distfiles"; diff --git a/packages/abuild/abuild.in.patch b/packages/abuild/abuild.in.patch index d29d717c9..ad161bfdd 100644 --- a/packages/abuild/abuild.in.patch +++ b/packages/abuild/abuild.in.patch @@ -1,5 +1,6 @@ ---- abuild-3.2.0/abuild.in 2018-06-22 10:24:10.000000000 +0300 -+++ abuild-3.2.0.mod/abuild.in 2018-11-19 22:01:34.476022065 +0200 +diff -uNr abuild-3.4.0/abuild.in abuild-3.4.0.mod/abuild.in +--- abuild-3.4.0/abuild.in 2019-06-14 15:13:23.000000000 +0300 ++++ abuild-3.4.0.mod/abuild.in 2019-07-21 16:56:56.898285307 +0300 @@ -1,4 +1,4 @@ -#!/bin/ash -e +#!/bin/bash -e @@ -18,7 +19,7 @@ apk_opt_wait="--wait 30" -@@ -427,7 +423,7 @@ +@@ -438,7 +434,7 @@ initdcheck || return 1 mkdir -p "$srcdir" local gunzip=$(command -v pigz || echo gunzip) @@ -27,7 +28,7 @@ for u in $source; do local s if is_remote "$u"; then -@@ -455,7 +451,7 @@ +@@ -466,7 +462,7 @@ *.tar.xz) msg "Unpacking $s..." local threads_opt @@ -36,7 +37,7 @@ threads_opt="--threads=0" fi unxz $threads_opt -c "$s" | tar -C "$srcdir" -x || return 1;; -@@ -544,26 +540,6 @@ +@@ -554,26 +550,6 @@ return 0 } @@ -63,7 +64,7 @@ # helper to update config.sub to a recent version update_config_sub() { find . -name config.sub | (local changed=false; while read f; do -@@ -671,10 +647,10 @@ +@@ -687,10 +663,10 @@ find "$dir" -name '*.la' -type f -delete fi @@ -77,9 +78,9 @@ return 1 fi # look for /etc/init.d and /etc/conf.d -@@ -682,22 +658,15 @@ - && ! is_openrc_pkg "$name"; then - warning "Found OpenRC directory (/etc/conf.d or /etc/init.d) but name doesn't end with -openrc" +@@ -704,22 +680,15 @@ + warning "Found static archive on ${i##*$dir/} but name doesn't end with -static" + done fi - # look for /usr/share/doc - if [ -e "$dir"/usr/share/doc ] \ @@ -106,7 +107,7 @@ fi fi # check directory permissions -@@ -758,9 +727,9 @@ +@@ -780,9 +749,9 @@ && postcheck "$pkgbasedir/$subpkgname" "$subpkgname" ) || return 1 done postcheck "$pkgdir" "$pkgname" || return 1 @@ -119,7 +120,7 @@ warning2 "Maybe add \$pkgname-lang to subpackages?" fi } -@@ -770,7 +739,7 @@ +@@ -792,7 +761,7 @@ install_if="$pkgname=$pkgver-r$pkgrel lang" local dir @@ -128,7 +129,7 @@ mkdir -p "$subpkgdir"/${dir%/*} mv "$pkgdir"/"$dir" "$subpkgdir"/"$dir" || return 1 done -@@ -789,7 +758,7 @@ +@@ -811,7 +780,7 @@ install_if="$pkgname=$pkgver-r$pkgrel lang-$lang" local dir @@ -137,7 +138,7 @@ mkdir -p "$subpkgdir"/$dir mv "$pkgdir"/$dir/$lang* \ "$subpkgdir"/$dir/ \ -@@ -844,7 +813,7 @@ +@@ -866,7 +835,7 @@ check_license() { local ret=0 @@ -146,7 +147,7 @@ local exclude="AND OR WITH" if options_has "!spdx" || ! [ -f "$license_list" ]; then return 0 -@@ -917,10 +886,7 @@ +@@ -939,10 +908,7 @@ local builddate=$(date -u "+%s") # Fix package size on several filesystems @@ -158,16 +159,16 @@ local size=$(du -sk | awk '{print $1 * 1024}') -@@ -933,7 +899,7 @@ +@@ -955,7 +921,7 @@ - echo "# Generated by $(basename $0) $program_version" >"$pkginfo" + echo "# Generated by $(basename "$abuild_path") $program_version" >"$pkginfo" if [ -n "$FAKEROOTKEY" ]; then - echo "# using $($FAKEROOT -v)" >> "$pkginfo" + echo "# using $(fakeroot -v)" >> "$pkginfo" fi echo "# $(date -u)" >> "$pkginfo" cat >> "$pkginfo" <<-EOF -@@ -953,9 +919,9 @@ +@@ -975,9 +941,9 @@ for i in $install $triggers; do local s=${i%=*} [ "$name" != "${s%.*}" ] && continue @@ -180,7 +181,7 @@ break fi done -@@ -1025,8 +991,8 @@ +@@ -1049,8 +1015,8 @@ scanelf --quiet --recursive --rpath "$dir" \ | sed -e 's/[[:space:]].*//' -e 's/:/\n/' | sort -u \ >"$controldir"/.rpaths @@ -191,7 +192,7 @@ fi if grep '^/home/' "$controldir"/.rpaths; then error "Has /home/... in rpath" -@@ -1052,12 +1018,12 @@ +@@ -1076,12 +1042,12 @@ local dir="${subpkgdir:-$pkgdir}" options_has "!tracedeps" && return 0 cd "$dir" || return 1 @@ -204,9 +205,9 @@ - local v=$(PKG_CONFIG_PATH="$dir"/usr/lib/pkgconfig PKG_CONFIG_MAXIMUM_TRAVERSE_DEPTH=1 pkg-config \ + local v=$(PKG_CONFIG_PATH="$dir"/@TERMUX_PREFIX@/lib/pkgconfig PKG_CONFIG_MAXIMUM_TRAVERSE_DEPTH=1 pkg-config \ --modversion ${f%.pc}) - echo "${f%.pc}=${v:-0}" >> "$controldir"/.provides-pc + echo "$pcprefix${f%.pc}=${v:-0}" >> "$controldir"/.provides-pc done -@@ -1147,12 +1113,19 @@ +@@ -1176,12 +1142,19 @@ return 1 } @@ -228,7 +229,7 @@ shift done return 0 -@@ -1185,20 +1158,12 @@ +@@ -1219,20 +1192,12 @@ esac msg "Tracing dependencies..." @@ -251,7 +252,7 @@ [ -f "$dir"/.needs-so ] && for i in $(cat "$dir"/.needs-so); do # first check if its provided by same apkbuild grep -q -w "^$sonameprefix$i" "$dir"/.provides-so 2>/dev/null && continue -@@ -1215,7 +1180,7 @@ +@@ -1249,7 +1214,7 @@ # find all packages that holds the so files if [ -f "$dir"/.rpaths ]; then @@ -260,7 +261,7 @@ || return 1 deppkgs=$($APK $apkroot info --quiet --who-owns $so_files) || return 1 fi -@@ -1244,7 +1209,7 @@ +@@ -1283,7 +1248,7 @@ autodeps="$autodeps pc:$i" else warning "Could not find any provider for pc:$i" @@ -269,7 +270,7 @@ if [ -e "$pcfile" ]; then local owner=$($APK $apkroot info --quiet --who-owns $pcfile) warning "${owner:-package providing $pcfile} needs to be rebuilt" -@@ -1276,7 +1241,7 @@ +@@ -1315,7 +1280,7 @@ find_scanelf_paths() { local datadir="$1" @@ -278,7 +279,7 @@ if [ -n "$ldpath" ]; then paths="$paths:$(echo "${datadir}${ldpath}" | sed "s|:|:$datadir|g")" fi -@@ -1422,7 +1387,7 @@ +@@ -1461,7 +1426,7 @@ name="$(pkginfo_val pkgname "$controldir"/.PKGINFO)" datadir="$pkgbasedir"/$name for i in $(sort -u "$provides_pc"); do @@ -287,31 +288,16 @@ --print-requires \ --print-requires-private ${i%=*} \ | sed -E 's/\s*([<>=]+)\s*/\1/' \ -@@ -1502,14 +1467,11 @@ - } - - build_abuildrepo() { -- local d apk _build=build _check=check_fakeroot -+ local d apk _build=build _check=check - if ! is_function package; then - # if package() is missing then build is called from rootpkg - _build=true - fi -- if options_has "!checkroot"; then -- _check=check -- fi - if ! want_check; then - _check=true - fi -@@ -1524,7 +1486,6 @@ - fetch - unpack - prepare -- mkusers - $_build - $_check - rootpkg -@@ -1590,14 +1551,14 @@ +@@ -1555,7 +1520,7 @@ + logcmd "building $repo/$pkgname-$pkgver-r$pkgrel" + local _starttime=$(date --utc +%s) + msg "Building $repo/$pkgname $pkgver-r$pkgrel (using $program $program_version) started $(date -R)" +- for part in sanitycheck builddeps clean fetch unpack prepare mkusers build \ ++ for part in sanitycheck builddeps clean fetch unpack prepare build \ + $_check rootpkg; do + runpart $part + done +@@ -1625,14 +1590,14 @@ local i for i in doc man info html sgml licenses gtk-doc ri help; do @@ -330,8 +316,8 @@ [ -d "$mandir" ] && find "$mandir" -type l \ -a \( -name \*.[0-8n] -o -name \*.[0-8][a-z]* \) \ -a \! \( -name '*.gz' -o -name '*.bz2' -o -name '*.xz' \) \ -@@ -1629,10 +1590,10 @@ - [ $islink -eq 0 ] && gzip -9 "$name" +@@ -1664,10 +1629,10 @@ + [ $islink -eq 0 ] && $gzip -9 "$name" done - rm -f "$subpkgdir/usr/share/info/dir" @@ -343,28 +329,29 @@ } doc() { -@@ -1648,18 +1609,16 @@ - for f in $binfiles; do - srcdir=$(dirname $pkgdir/$f) - srcfile=$(basename $pkgdir/$f) -- dstdir=$(dirname $subpkgdir/usr/lib/debug/$f.debug) -- dstfile=$(basename $subpkgdir/usr/lib/debug/$f.debug) -+ dstdir=$(dirname $subpkgdir/@TERMUX_PREFIX@/lib/debug/$f.debug) -+ dstfile=$(basename $subpkgdir/@TERMUX_PREFIX@/lib/debug/$f.debug) - if [ ! -d $dstdir ] ; then - mkdir -p $dstdir - fi - cd $srcdir -- local XATTR=$(getfattr --match="" --dump "${srcfile}") - ${CROSS_COMPILE}objcopy --only-keep-debug $srcfile $dstfile - ${CROSS_COMPILE}objcopy --add-gnu-debuglink=$dstfile $srcdir/$srcfile - mv $dstfile $dstdir - ${CROSS_COMPILE}strip $srcfile -- [ -n "$XATTR" ] && { echo "$XATTR" | setfattr --restore=-; } +@@ -1682,19 +1647,15 @@ + scanelf -R "$pkgdir" | grep ET_DYN | sed "s:$pkgdir\/::g" | sed "s:ET_DYN ::g" | while read f; do + local ddbg_srcdir=$(dirname "$pkgdir/$f") + local ddbg_srcfile=$(basename "$pkgdir/$f") +- local ddbg_dstdir=$(dirname "$subpkgdir/usr/lib/debug/$f.debug") +- local ddbg_dstfile=$(basename "$subpkgdir/usr/lib/debug/$f.debug") ++ local ddbg_dstdir=$(dirname "$subpkgdir/@TERMUX_PREFIX@/lib/debug/$f.debug") ++ local ddbg_dstfile=$(basename "$subpkgdir/@TERMUX_PREFIX@/lib/debug/$f.debug") + mkdir -p "$ddbg_dstdir" + + cd "$ddbg_srcdir" +- local xattr=$(getfattr --match="" --dump "${ddbg_srcfile}") + ${CROSS_COMPILE}objcopy --only-keep-debug "$ddbg_srcfile" "$ddbg_dstfile" + ${CROSS_COMPILE}objcopy --add-gnu-debuglink="$ddbg_dstfile" "$ddbg_srcdir/$ddbg_srcfile" + mv "$ddbg_dstfile" "$ddbg_dstdir" + ${CROSS_COMPILE}strip "$ddbg_srcfile" +- if [ -n "$xattr" ]; then +- echo "$xattr" | setfattr --restore=- +- fi done return 0 } -@@ -1675,14 +1634,14 @@ +@@ -1710,14 +1671,14 @@ pkgdesc="$pkgdesc (development files)" cd "$pkgdir" || return 0 @@ -377,16 +364,16 @@ - usr/share/qt*/mkspecs \ - usr/lib/qt*/mkspecs \ - usr/lib/cmake \ -+ for i in include ./@TERMUX_PREFIX@/lib/pkgconfig ./@TERMUX_PREFIX@/share/aclocal \ ++ for i in ./@TERMUX_PREFIX@/lib/pkgconfig ./@TERMUX_PREFIX@/share/aclocal \ + ./@TERMUX_PREFIX@/share/gettext ./@TERMUX_PREFIX@/bin/*-config \ -+ ./@TERMUX_PREFIX@/share/vala/vapi ./@TERMUX_PREFIX@/share/gir-[0-9]*\ ++ ./@TERMUX_PREFIX@/share/vala/vapi ./@TERMUX_PREFIX@/share/gir-[0-9]* \ + ./@TERMUX_PREFIX@/share/qt*/mkspecs \ + ./@TERMUX_PREFIX@/lib/qt*/mkspecs \ + ./@TERMUX_PREFIX@/lib/cmake \ - $(find . -name include -type d) \ - $(find $libdirs -name '*.[acho]' \ - -o -name '*.prl' 2>/dev/null); do -@@ -1747,33 +1706,17 @@ + $(find . -name include -type d) \ + $([ -z "${subpackages##*$pkgname-static*}" ] && find $libdirs \ + -name '*.a' 2>/dev/null) \ +@@ -1808,27 +1769,11 @@ type "$1" 2>&1 | head -n 1 | egrep -q "is a (shell )?function" } @@ -402,28 +389,20 @@ -check_fakeroot() { - cd "$startdir" - [ -n "$FAKEROOT" ] && msg "Entering fakeroot..." -- do_fakeroot "$abuild_path" $color_opt $keep_build check +- do_fakeroot "$abuild_path" $forceroot $color_opt $keep_build check -} - --# build and package in fakeroot -+# build and package + # build and package in fakeroot rootpkg() { - local _package=package - if ! is_function package; then -- # if package() is missing then run 'build' in fakeroot instead -+ # if package() is missing then run 'build' instead - warning "No package() function in APKBUILD" - _package=build - fi cd "$startdir" rm -rf "$pkgdir" - [ -n "$FAKEROOT" ] && msg "Entering fakeroot..." -- do_fakeroot "$abuild_path" $color_opt $keep_build \ -+ "$abuild_path" $color_opt $keep_build \ - $_package \ +- do_fakeroot "$abuild_path" $forceroot $color_opt $keep_build \ ++ "$abuild_path" $forceroot $color_opt $keep_build \ + package \ prepare_subpackages \ prepare_language_packs \ -@@ -2096,7 +2039,7 @@ +@@ -2151,7 +2096,7 @@ $install_deps $recursive $upgrade $color_opt \ abuildindex || return 1 done @@ -432,23 +411,7 @@ $apk_opt_wait \ --virtual .makedepends-$pkgname $builddeps \ || return 1 -@@ -2125,14 +2068,11 @@ - } - - rootbld_actions() { -- local part _build=build _check=check_fakeroot -+ local part _build=build _check=check - if ! is_function package; then - # if package() is missing then build is called from rootpkg - _build=true - fi -- if options_has "!checkroot"; then -- _check=check -- fi - if ! want_check; then - _check=true - fi -@@ -2163,8 +2103,6 @@ +@@ -2218,8 +2163,6 @@ msg "Preparing build chroot..." @@ -457,7 +420,7 @@ BUILD_ROOT=$(mktemp -d /var/tmp/abuild.XXXXXXXXXX) local aportsgit=${APORTSDIR:-${startdir}} -@@ -2205,7 +2143,7 @@ +@@ -2260,7 +2203,7 @@ ) < "$repo_template" > "$BUILD_ROOT/etc/apk/repositories" calcdeps @@ -466,7 +429,7 @@ abuild alpine-base build-base git $hostdeps $builddeps local bwrap_opts="" -@@ -2252,11 +2190,7 @@ +@@ -2307,11 +2250,7 @@ [ -e "$filename" ] || continue [ "$osabi" != "STANDALONE" ] || continue @@ -478,7 +441,7 @@ done } -@@ -2346,22 +2280,22 @@ +@@ -2401,22 +2340,22 @@ local _quiet="$1" [ -z "$_quiet" ] && msg "Installing for build:$builddeps" @@ -505,7 +468,7 @@ --no-scripts .makedepends-$pkgname || : fi } -@@ -2481,7 +2415,7 @@ +@@ -2536,7 +2475,7 @@ package Install project into $pkgdir prepare Apply patches rootbld Build package in clean chroot @@ -514,7 +477,7 @@ sanitycheck Basic sanity check of APKBUILD snapshot Create a \$giturl or \$svnurl snapshot and upload to \$disturl sourcecheck Check if remote source package exists upstream -@@ -2563,7 +2497,7 @@ +@@ -2618,7 +2557,7 @@ if [ -z "$REPODEST" ]; then warning "REPODEST is not set and is now required. Defaulting to ~/packages" [ -n "$PKGDEST" ] && die "PKGDEST is no longer supported." diff --git a/packages/abuild/build.sh b/packages/abuild/build.sh index 2fee2021e..a9fb03a1a 100644 --- a/packages/abuild/build.sh +++ b/packages/abuild/build.sh @@ -1,10 +1,11 @@ +## TODO: restore fakeroot functionality + TERMUX_PKG_HOMEPAGE=https://github.com/alpinelinux/abuild TERMUX_PKG_DESCRIPTION="Build script to build Alpine packages" TERMUX_PKG_LICENSE="GPL-2.0" -TERMUX_PKG_VERSION=3.2.0 -TERMUX_PKG_REVISION=1 -TERMUX_PKG_SHA256=45b26674ca416e71612ff7924169a890a2cc45e945ecca33bc382f98e9ec3eb7 +TERMUX_PKG_VERSION=3.4.0 TERMUX_PKG_SRCURL=https://github.com/alpinelinux/abuild/archive/v$TERMUX_PKG_VERSION.tar.gz +TERMUX_PKG_SHA256=f6f704e34f9d388a0228b645050dc7db7bf92f15a088835ae2c9b244420b9b61 TERMUX_PKG_DEPENDS="apk-tools, autoconf, automake, bash, clang, curl, libtool, make, openssl-tool, pkg-config, tar, zlib" TERMUX_PKG_BUILD_IN_SRC=yes TERMUX_PKG_EXTRA_MAKE_ARGS="sysconfdir=$TERMUX_PREFIX/etc" diff --git a/packages/abuild/functions.sh.in.patch b/packages/abuild/functions.sh.in.patch index 3deadba14..b7dd420b7 100644 --- a/packages/abuild/functions.sh.in.patch +++ b/packages/abuild/functions.sh.in.patch @@ -1,12 +1,13 @@ ---- abuild-3.2.0/functions.sh.in 2018-06-22 10:24:10.000000000 +0300 -+++ abuild-3.2.0.mod/functions.sh.in 2018-11-20 13:54:13.195689889 +0200 +diff -uNr abuild-3.4.0/functions.sh.in abuild-3.4.0.mod/functions.sh.in +--- abuild-3.4.0/functions.sh.in 2019-06-14 15:13:23.000000000 +0300 ++++ abuild-3.4.0.mod/functions.sh.in 2019-07-21 17:00:19.730135313 +0300 @@ -5,40 +5,20 @@ arch_to_hostspec() { case "$1" in - aarch64) echo "aarch64-alpine-linux-musl" ;; - armel) echo "armv5-alpine-linux-musleabi" ;; -- armhf) echo "armv6-alpine-linux-muslgnueabihf" ;; +- armhf) echo "armv6-alpine-linux-musleabihf" ;; - armv7) echo "armv7-alpine-linux-musleabihf" ;; - mips) echo "mips-alpine-linux-musl" ;; - mips64) echo "mips64-alpine-linux-musl" ;;