2018-11-19 13:08:36 +01:00
|
|
|
--- abuild-3.2.0/abuild.in 2018-06-22 10:24:10.000000000 +0300
|
2018-11-19 22:45:41 +01:00
|
|
|
+++ abuild-3.2.0.mod/abuild.in 2018-11-19 22:01:34.476022065 +0200
|
2018-11-19 13:08:36 +01:00
|
|
|
@@ -1,4 +1,4 @@
|
|
|
|
-#!/bin/ash -e
|
|
|
|
+#!/bin/bash -e
|
|
|
|
|
|
|
|
# abuild - build apk packages (light version of makepkg)
|
|
|
|
# Copyright (c) 2008-2015 Natanael Copa <ncopa@alpinelinux.org>
|
2018-11-19 13:11:04 +01:00
|
|
|
@@ -21,11 +21,7 @@
|
2018-11-19 13:08:55 +01:00
|
|
|
. "$datadir/functions.sh"
|
2018-11-19 13:08:36 +01:00
|
|
|
|
|
|
|
# defaults
|
2018-11-19 13:08:55 +01:00
|
|
|
-: ${FAKEROOT:="fakeroot"}
|
2018-11-19 13:08:36 +01:00
|
|
|
-: ${SUDO_APK:="abuild-apk"}
|
|
|
|
: ${APK:="apk"}
|
2018-11-19 13:11:04 +01:00
|
|
|
-: ${ADDUSER:="abuild-adduser"}
|
|
|
|
-: ${ADDGROUP:="abuild-addgroup"}
|
|
|
|
|
|
|
|
apk_opt_wait="--wait 30"
|
|
|
|
|
2018-11-19 13:12:52 +01:00
|
|
|
@@ -427,7 +423,7 @@
|
|
|
|
initdcheck || return 1
|
|
|
|
mkdir -p "$srcdir"
|
|
|
|
local gunzip=$(command -v pigz || echo gunzip)
|
|
|
|
- [ $gunzip = "/usr/bin/pigz" ] && gunzip="$gunzip -d"
|
|
|
|
+ [ $gunzip = "@TERMUX_PREFIX@/bin/pigz" ] && gunzip="$gunzip -d"
|
|
|
|
for u in $source; do
|
|
|
|
local s
|
|
|
|
if is_remote "$u"; then
|
|
|
|
@@ -455,7 +451,7 @@
|
|
|
|
*.tar.xz)
|
|
|
|
msg "Unpacking $s..."
|
|
|
|
local threads_opt
|
|
|
|
- if [ $(readlink -f $(command -v unxz)) != "/bin/busybox" ]; then
|
|
|
|
+ if [ $(realpath $(command -v unxz)) != "@TERMUX_PREFIX@/bin/busybox" ]; then
|
|
|
|
threads_opt="--threads=0"
|
|
|
|
fi
|
|
|
|
unxz $threads_opt -c "$s" | tar -C "$srcdir" -x || return 1;;
|
2018-11-19 13:11:04 +01:00
|
|
|
@@ -544,26 +540,6 @@
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
-mkusers() {
|
|
|
|
- local i
|
|
|
|
- for i in $pkggroups; do
|
|
|
|
- if ! getent group $i >/dev/null; then
|
|
|
|
- msg "Creating group $i"
|
|
|
|
- $ADDGROUP -S $i || return 1
|
|
|
|
- fi
|
|
|
|
- done
|
|
|
|
- for i in $pkgusers; do
|
|
|
|
- if ! getent passwd $i >/dev/null; then
|
|
|
|
- local gopt=
|
|
|
|
- msg "Creating user $i"
|
|
|
|
- if getent group $i >/dev/null; then
|
|
|
|
- gopt="-G $i"
|
|
|
|
- fi
|
|
|
|
- $ADDUSER -S -D -H $gopt $i || return 1
|
|
|
|
- fi
|
|
|
|
- done
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
# helper to update config.sub to a recent version
|
|
|
|
update_config_sub() {
|
|
|
|
find . -name config.sub | (local changed=false; while read f; do
|
2018-11-19 13:12:52 +01:00
|
|
|
@@ -671,10 +647,10 @@
|
|
|
|
find "$dir" -name '*.la' -type f -delete
|
|
|
|
fi
|
|
|
|
|
|
|
|
- # look for /usr/lib/charset.alias
|
|
|
|
- if [ -e "$dir"/usr/lib/charset.alias ] \
|
|
|
|
+ # look for @TERMUX_PREFIX@/lib/charset.alias
|
|
|
|
+ if [ -e "$dir"/@TERMUX_PREFIX@/lib/charset.alias ] \
|
|
|
|
&& ! options_has "charset.alias"; then
|
|
|
|
- error "Found /usr/lib/charset.alias"
|
|
|
|
+ error "Found @TERMUX_PREFIX@/lib/charset.alias"
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
# look for /etc/init.d and /etc/conf.d
|
2018-11-19 13:13:24 +01:00
|
|
|
@@ -682,22 +658,15 @@
|
2018-11-19 13:12:52 +01:00
|
|
|
&& ! is_openrc_pkg "$name"; then
|
|
|
|
warning "Found OpenRC directory (/etc/conf.d or /etc/init.d) but name doesn't end with -openrc"
|
|
|
|
fi
|
|
|
|
- # look for /usr/share/doc
|
|
|
|
- if [ -e "$dir"/usr/share/doc ] \
|
|
|
|
+ # look for @TERMUX_PREFIX@/share/doc
|
|
|
|
+ if [ -e "$dir"/@TERMUX_PREFIX@/share/doc ] \
|
|
|
|
&& ! is_doc_pkg "$name"; then
|
|
|
|
- warning "Found /usr/share/doc but package name doesn't end with -doc"
|
|
|
|
+ warning "Found @TERMUX_PREFIX@/share/doc but package name doesn't end with -doc"
|
|
|
|
fi
|
|
|
|
- # look for /usr/share/man
|
|
|
|
- if [ -e "$dir"/usr/share/man ]; then
|
|
|
|
+ # look for @TERMUX_PREFIX@/share/man
|
|
|
|
+ if [ -e "$dir"/@TERMUX_PREFIX@/share/man ]; then
|
|
|
|
if ! is_doc_pkg "$name"; then
|
|
|
|
- warning "Found /usr/share/man but package name doesn't end with -doc"
|
2018-11-19 13:13:24 +01:00
|
|
|
- fi
|
|
|
|
- # check for uncompressed man pages
|
|
|
|
- i=$(find "$dir"/usr/share/man -name '*.[0-8]' -type f | sed "s|^$dir|\t|")
|
|
|
|
- if [ -n "$i" ]; then
|
|
|
|
- error "Found uncompressed man pages:"
|
|
|
|
- echo "$i"
|
|
|
|
- return 1
|
2018-11-19 13:12:52 +01:00
|
|
|
+ warning "Found @TERMUX_PREFIX@/share/man but package name doesn't end with -doc"
|
|
|
|
fi
|
2018-11-19 13:13:24 +01:00
|
|
|
fi
|
|
|
|
# check directory permissions
|
|
|
|
@@ -758,9 +727,9 @@
|
2018-11-19 13:12:52 +01:00
|
|
|
&& postcheck "$pkgbasedir/$subpkgname" "$subpkgname" ) || return 1
|
|
|
|
done
|
|
|
|
postcheck "$pkgdir" "$pkgname" || return 1
|
|
|
|
- # post check for /usr/share/locale
|
|
|
|
- if [ -d "$pkgdir"/usr/share/locale ]; then
|
|
|
|
- warning "Found /usr/share/locale"
|
|
|
|
+ # post check for @TERMUX_PREFIX@/share/locale
|
|
|
|
+ if [ -d "$pkgdir"/@TERMUX_PREFIX@/share/locale ]; then
|
|
|
|
+ warning "Found @TERMUX_PREFIX@/share/locale"
|
|
|
|
warning2 "Maybe add \$pkgname-lang to subpackages?"
|
|
|
|
fi
|
|
|
|
}
|
2018-11-19 13:13:24 +01:00
|
|
|
@@ -770,7 +739,7 @@
|
2018-11-19 13:12:52 +01:00
|
|
|
install_if="$pkgname=$pkgver-r$pkgrel lang"
|
|
|
|
|
|
|
|
local dir
|
|
|
|
- for dir in ${langdir:-/usr/share/locale}; do
|
|
|
|
+ for dir in ${langdir:-@TERMUX_PREFIX@/share/locale}; do
|
|
|
|
mkdir -p "$subpkgdir"/${dir%/*}
|
|
|
|
mv "$pkgdir"/"$dir" "$subpkgdir"/"$dir" || return 1
|
|
|
|
done
|
2018-11-19 13:13:24 +01:00
|
|
|
@@ -789,7 +758,7 @@
|
2018-11-19 13:12:52 +01:00
|
|
|
install_if="$pkgname=$pkgver-r$pkgrel lang-$lang"
|
|
|
|
|
|
|
|
local dir
|
|
|
|
- for dir in ${langdir:-/usr/share/locale}; do
|
|
|
|
+ for dir in ${langdir:-@TERMUX_PREFIX@/share/locale}; do
|
|
|
|
mkdir -p "$subpkgdir"/$dir
|
|
|
|
mv "$pkgdir"/$dir/$lang* \
|
|
|
|
"$subpkgdir"/$dir/ \
|
2018-11-19 13:13:24 +01:00
|
|
|
@@ -844,7 +813,7 @@
|
2018-11-19 13:12:52 +01:00
|
|
|
|
|
|
|
check_license() {
|
|
|
|
local ret=0
|
|
|
|
- local license_list=/usr/share/spdx/license.lst
|
|
|
|
+ local license_list=@TERMUX_PREFIX@/share/spdx/license.lst
|
|
|
|
local exclude="AND OR WITH"
|
|
|
|
if options_has "!spdx" || ! [ -f "$license_list" ]; then
|
|
|
|
return 0
|
2018-11-19 22:45:41 +01:00
|
|
|
@@ -917,10 +886,7 @@
|
|
|
|
local builddate=$(date -u "+%s")
|
|
|
|
|
|
|
|
# Fix package size on several filesystems
|
|
|
|
- case "$(df -PT . | awk 'END {print $2}')" in
|
|
|
|
- btrfs|ecryptfs|zfs)
|
|
|
|
- sync;;
|
|
|
|
- esac
|
|
|
|
+ sync
|
|
|
|
|
|
|
|
local size=$(du -sk | awk '{print $1 * 1024}')
|
|
|
|
|
|
|
|
@@ -933,7 +899,7 @@
|
2018-11-19 13:08:55 +01:00
|
|
|
|
|
|
|
echo "# Generated by $(basename $0) $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
|
2018-11-19 22:45:41 +01:00
|
|
|
@@ -953,9 +919,9 @@
|
2018-11-19 13:12:52 +01:00
|
|
|
for i in $install $triggers; do
|
|
|
|
local s=${i%=*}
|
|
|
|
[ "$name" != "${s%.*}" ] && continue
|
|
|
|
- if head -n 1 "$startdir/$s" | grep '^#!/bin/sh' >/dev/null ; then
|
|
|
|
- msg "Script found. /bin/sh added as a dependency for $pkg"
|
|
|
|
- deps="$deps /bin/sh"
|
|
|
|
+ if head -n 1 "$startdir/$s" | grep '^#!@TERMUX_PREFIX@/bin/sh' >/dev/null ; then
|
|
|
|
+ msg "Script found. @TERMUX_PREFIX@/bin/sh added as a dependency for $pkg"
|
|
|
|
+ deps="$deps @TERMUX_PREFIX@/bin/sh"
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
2018-11-19 22:45:41 +01:00
|
|
|
@@ -1025,8 +991,8 @@
|
2018-11-19 13:12:52 +01:00
|
|
|
scanelf --quiet --recursive --rpath "$dir" \
|
|
|
|
| sed -e 's/[[:space:]].*//' -e 's/:/\n/' | sort -u \
|
|
|
|
>"$controldir"/.rpaths
|
|
|
|
- if grep -q -x '/usr/lib' "$controldir"/.rpaths; then
|
|
|
|
- warning "Redundant /usr/lib in rpath found"
|
|
|
|
+ if grep -q -x '@TERMUX_PREFIX@/lib' "$controldir"/.rpaths; then
|
|
|
|
+ warning "Redundant @TERMUX_PREFIX@/lib in rpath found"
|
|
|
|
fi
|
|
|
|
if grep '^/home/' "$controldir"/.rpaths; then
|
|
|
|
error "Has /home/... in rpath"
|
2018-11-19 22:45:41 +01:00
|
|
|
@@ -1052,12 +1018,12 @@
|
2018-11-19 13:12:52 +01:00
|
|
|
local dir="${subpkgdir:-$pkgdir}"
|
|
|
|
options_has "!tracedeps" && return 0
|
|
|
|
cd "$dir" || return 1
|
|
|
|
- for i in usr/lib/pkgconfig/*.pc; do
|
|
|
|
+ for i in ./@TERMUX_PREFIX@/lib/pkgconfig/*.pc; do
|
|
|
|
if ! [ -e "$i" ]; then
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
local f=${i##*/}
|
|
|
|
- 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
|
|
|
|
done
|
2018-11-19 22:45:41 +01:00
|
|
|
@@ -1147,12 +1113,19 @@
|
2018-11-19 13:12:52 +01:00
|
|
|
return 1
|
|
|
|
}
|
|
|
|
|
|
|
|
-# search rpaths and /usr/lib /lib for given so files
|
|
|
|
+# search rpaths and @TERMUX_PREFIX@/lib for given so files
|
|
|
|
find_so_files() {
|
2018-11-19 22:43:22 +01:00
|
|
|
+ local android_libs
|
2018-11-19 13:12:52 +01:00
|
|
|
local rpaths=$(cat "$1")
|
|
|
|
shift
|
2018-11-19 22:43:22 +01:00
|
|
|
+
|
|
|
|
+ case ${CTARGET_ARCH} in
|
|
|
|
+ aarch64|x86_64) android_libs="/system/lib64" ;;
|
|
|
|
+ *) android_libs="/system/lib" ;;
|
|
|
|
+ esac
|
|
|
|
+
|
2018-11-19 13:12:52 +01:00
|
|
|
while [ $# -gt 0 ]; do
|
|
|
|
- real_so_path "$1" /usr/lib /lib $rpaths || return 1
|
2018-11-19 22:43:22 +01:00
|
|
|
+ real_so_path "$1" @TERMUX_PREFIX@/lib $rpaths $android_libs || return 1
|
2018-11-19 13:12:52 +01:00
|
|
|
shift
|
|
|
|
done
|
|
|
|
return 0
|
2018-11-19 22:45:41 +01:00
|
|
|
@@ -1185,20 +1158,12 @@
|
2018-11-19 13:12:52 +01:00
|
|
|
esac
|
|
|
|
|
|
|
|
msg "Tracing dependencies..."
|
|
|
|
- # add pkgconfig if usr/lib/pkgconfig is found
|
|
|
|
- if [ -d "$pkgbasedir"/$name/usr/lib/pkgconfig ] \
|
|
|
|
+ # add pkgconfig if @TERMUX_PREFIX@/lib/pkgconfig is found
|
|
|
|
+ if [ -d "$pkgbasedir"/$name/@TERMUX_PREFIX@/lib/pkgconfig ] \
|
|
|
|
&& ! grep -q '^depend = pkgconfig' "$dir"/.PKGINFO; then
|
|
|
|
autodeps="$autodeps pkgconfig"
|
|
|
|
fi
|
2018-11-19 22:43:22 +01:00
|
|
|
|
|
|
|
- # special case for libpthread: we need depend on libgcc
|
|
|
|
- if [ "$CLIBC" = "uclibc" ] && [ -f "$dir"/.needs-so ] \
|
|
|
|
- && grep -q -w '^libpthread.so.*' "$dir"/.needs-so \
|
|
|
|
- && ! grep -q -w "^depend = libgcc" "$dir"/.PKGINFO; then
|
|
|
|
- autodeps="$autodeps libgcc"
|
|
|
|
- msg " added libgcc (due to libpthread)"
|
|
|
|
- fi
|
|
|
|
-
|
|
|
|
[ -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
|
2018-11-19 22:45:41 +01:00
|
|
|
@@ -1215,7 +1180,7 @@
|
2018-11-19 22:43:22 +01:00
|
|
|
|
|
|
|
# find all packages that holds the so files
|
|
|
|
if [ -f "$dir"/.rpaths ]; then
|
|
|
|
- local so_files=$(find_so_files "$dir"/.rpaths $missing) \
|
|
|
|
+ local so_files=$(find_so_files "$dir"/.rpaths $missing | grep -v /system/lib) \
|
|
|
|
|| return 1
|
|
|
|
deppkgs=$($APK $apkroot info --quiet --who-owns $so_files) || return 1
|
|
|
|
fi
|
2018-11-19 22:45:41 +01:00
|
|
|
@@ -1244,7 +1209,7 @@
|
2018-11-19 13:12:52 +01:00
|
|
|
autodeps="$autodeps pc:$i"
|
|
|
|
else
|
|
|
|
warning "Could not find any provider for pc:$i"
|
|
|
|
- local pcfile=/usr/lib/pkgconfig/"${i%%[<>=]*}".pc
|
|
|
|
+ local pcfile=@TERMUX_PREFIX@/lib/pkgconfig/"${i%%[<>=]*}".pc
|
|
|
|
if [ -e "$pcfile" ]; then
|
|
|
|
local owner=$($APK $apkroot info --quiet --who-owns $pcfile)
|
|
|
|
warning "${owner:-package providing $pcfile} needs to be rebuilt"
|
2018-11-19 22:45:41 +01:00
|
|
|
@@ -1276,7 +1241,7 @@
|
2018-11-19 13:12:52 +01:00
|
|
|
|
|
|
|
find_scanelf_paths() {
|
|
|
|
local datadir="$1"
|
|
|
|
- local paths="$datadir/lib:$datadir/usr/lib" i= rpaths=
|
|
|
|
+ local paths="$datadir/lib" i= rpaths=
|
|
|
|
if [ -n "$ldpath" ]; then
|
|
|
|
paths="$paths:$(echo "${datadir}${ldpath}" | sed "s|:|:$datadir|g")"
|
|
|
|
fi
|
2018-11-19 22:45:41 +01:00
|
|
|
@@ -1422,7 +1387,7 @@
|
2018-11-19 13:12:52 +01:00
|
|
|
name="$(pkginfo_val pkgname "$controldir"/.PKGINFO)"
|
|
|
|
datadir="$pkgbasedir"/$name
|
|
|
|
for i in $(sort -u "$provides_pc"); do
|
|
|
|
- PKG_CONFIG_PATH="$datadir"/usr/lib/pkgconfig pkg-config \
|
|
|
|
+ PKG_CONFIG_PATH="$datadir"/@TERMUX_PREFIX@/lib/pkgconfig pkg-config \
|
|
|
|
--print-requires \
|
|
|
|
--print-requires-private ${i%=*} \
|
|
|
|
| sed -E 's/\s*([<>=]+)\s*/\1/' \
|
2018-11-19 22:45:41 +01:00
|
|
|
@@ -1502,14 +1467,11 @@
|
2018-11-19 13:08:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
2018-11-19 22:45:41 +01:00
|
|
|
@@ -1524,7 +1486,6 @@
|
2018-11-19 13:11:04 +01:00
|
|
|
fetch
|
|
|
|
unpack
|
|
|
|
prepare
|
|
|
|
- mkusers
|
|
|
|
$_build
|
|
|
|
$_check
|
|
|
|
rootpkg
|
2018-11-19 22:45:41 +01:00
|
|
|
@@ -1590,14 +1551,14 @@
|
2018-11-19 13:12:52 +01:00
|
|
|
|
|
|
|
local i
|
|
|
|
for i in doc man info html sgml licenses gtk-doc ri help; do
|
|
|
|
- if [ -d "$pkgdir/usr/share/$i" ]; then
|
|
|
|
- mkdir -p "$subpkgdir/usr/share"
|
|
|
|
- mv "$pkgdir/usr/share/$i" "$subpkgdir/usr/share/"
|
|
|
|
+ if [ -d "$pkgdir/@TERMUX_PREFIX@/share/$i" ]; then
|
|
|
|
+ mkdir -p "$subpkgdir/@TERMUX_PREFIX@/share"
|
|
|
|
+ mv "$pkgdir/@TERMUX_PREFIX@/share/$i" "$subpkgdir/@TERMUX_PREFIX@/share/"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# compress man pages
|
|
|
|
- local mandir="$subpkgdir"/usr/share/man
|
|
|
|
+ local mandir="$subpkgdir"/@TERMUX_PREFIX@/share/man
|
|
|
|
[ -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' \) \
|
2018-11-19 22:45:41 +01:00
|
|
|
@@ -1629,10 +1590,10 @@
|
2018-11-19 13:12:52 +01:00
|
|
|
[ $islink -eq 0 ] && gzip -9 "$name"
|
|
|
|
done
|
|
|
|
|
|
|
|
- rm -f "$subpkgdir/usr/share/info/dir"
|
|
|
|
+ rm -f "$subpkgdir/@TERMUX_PREFIX@/share/info/dir"
|
|
|
|
|
|
|
|
# remove if empty, ignore error (not empty)
|
|
|
|
- rmdir "$pkgdir/usr/share" "$pkgdir/usr" 2>/dev/null || :
|
|
|
|
+ rmdir "$pkgdir/@TERMUX_PREFIX@/share" "$pkgdir" 2>/dev/null || :
|
|
|
|
}
|
|
|
|
|
|
|
|
doc() {
|
2018-11-19 22:45:41 +01:00
|
|
|
@@ -1648,18 +1609,16 @@
|
2018-11-19 13:12:52 +01:00
|
|
|
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
|
2018-11-19 22:44:16 +01:00
|
|
|
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=-; }
|
|
|
|
done
|
|
|
|
return 0
|
|
|
|
}
|
2018-11-19 22:45:41 +01:00
|
|
|
@@ -1675,14 +1634,14 @@
|
2018-11-19 13:12:52 +01:00
|
|
|
pkgdesc="$pkgdesc (development files)"
|
|
|
|
|
|
|
|
cd "$pkgdir" || return 0
|
|
|
|
- local libdirs=usr/
|
|
|
|
+ local libdirs=./@TERMUX_PREFIX@/lib
|
|
|
|
[ -d lib/ ] && libdirs="lib/ $libdirs"
|
|
|
|
- for i in usr/include usr/lib/pkgconfig usr/share/aclocal\
|
|
|
|
- usr/share/gettext usr/bin/*-config \
|
|
|
|
- usr/share/vala/vapi usr/share/gir-[0-9]*\
|
|
|
|
- usr/share/qt*/mkspecs \
|
|
|
|
- usr/lib/qt*/mkspecs \
|
|
|
|
- usr/lib/cmake \
|
|
|
|
+ for i in include ./@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/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
|
2018-11-19 22:45:41 +01:00
|
|
|
@@ -1747,33 +1706,17 @@
|
2018-11-19 13:08:55 +01:00
|
|
|
type "$1" 2>&1 | head -n 1 | egrep -q "is a (shell )?function"
|
|
|
|
}
|
|
|
|
|
|
|
|
-do_fakeroot() {
|
|
|
|
- if [ -n "$FAKEROOT" ]; then
|
|
|
|
- $FAKEROOT -- "$@"
|
|
|
|
- else
|
|
|
|
- "$@"
|
|
|
|
- fi
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-# wrap check() with fakeroot
|
|
|
|
-check_fakeroot() {
|
|
|
|
- cd "$startdir"
|
|
|
|
- [ -n "$FAKEROOT" ] && msg "Entering fakeroot..."
|
|
|
|
- do_fakeroot "$abuild_path" $color_opt $keep_build check
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-# build and package in fakeroot
|
|
|
|
+# build and package
|
|
|
|
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 \
|
|
|
|
prepare_subpackages \
|
|
|
|
prepare_language_packs \
|
2018-11-19 22:45:41 +01:00
|
|
|
@@ -2096,7 +2039,7 @@
|
2018-11-19 13:11:04 +01:00
|
|
|
$install_deps $recursive $upgrade $color_opt \
|
|
|
|
abuildindex || return 1
|
|
|
|
done
|
|
|
|
- $SUDO_APK add --upgrade --repository "$REPODEST/$repo" \
|
|
|
|
+ $APK add --upgrade --repository "$REPODEST/$repo" \
|
|
|
|
$apk_opt_wait \
|
|
|
|
--virtual .makedepends-$pkgname $builddeps \
|
|
|
|
|| return 1
|
2018-11-19 22:45:41 +01:00
|
|
|
@@ -2125,14 +2068,11 @@
|
2018-11-19 13:08:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
2018-11-19 22:45:41 +01:00
|
|
|
@@ -2163,8 +2103,6 @@
|
2018-11-19 13:11:04 +01:00
|
|
|
|
|
|
|
msg "Preparing build chroot..."
|
|
|
|
|
|
|
|
- mkusers
|
|
|
|
-
|
|
|
|
BUILD_ROOT=$(mktemp -d /var/tmp/abuild.XXXXXXXXXX)
|
|
|
|
local aportsgit=${APORTSDIR:-${startdir}}
|
|
|
|
|
2018-11-19 22:45:41 +01:00
|
|
|
@@ -2205,7 +2143,7 @@
|
2018-11-19 13:11:04 +01:00
|
|
|
) < "$repo_template" > "$BUILD_ROOT/etc/apk/repositories"
|
|
|
|
|
|
|
|
calcdeps
|
|
|
|
- $SUDO_APK add --initdb --root "$BUILD_ROOT" --update \
|
|
|
|
+ $APK add --initdb --root "$BUILD_ROOT" --update \
|
|
|
|
abuild alpine-base build-base git $hostdeps $builddeps
|
|
|
|
|
|
|
|
local bwrap_opts=""
|
2018-11-19 22:45:41 +01:00
|
|
|
@@ -2252,11 +2190,7 @@
|
2018-11-19 22:44:16 +01:00
|
|
|
[ -e "$filename" ] || continue
|
|
|
|
|
|
|
|
[ "$osabi" != "STANDALONE" ] || continue
|
|
|
|
- local XATTR=$(getfattr --match="" --dump "${filename}")
|
|
|
|
"${stripcmd}" "${filename}"
|
|
|
|
- if [ -n "$XATTR" ]; then
|
|
|
|
- echo "$XATTR" | setfattr --restore=-
|
|
|
|
- fi
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2018-11-19 22:45:41 +01:00
|
|
|
@@ -2346,22 +2280,22 @@
|
2018-11-19 13:11:04 +01:00
|
|
|
|
|
|
|
local _quiet="$1"
|
|
|
|
[ -z "$_quiet" ] && msg "Installing for build:$builddeps"
|
|
|
|
- $SUDO_APK add $_quiet $apk_opt_wait --repository "$REPODEST/$repo" \
|
|
|
|
+ $APK add $_quiet $apk_opt_wait --repository "$REPODEST/$repo" \
|
|
|
|
--virtual .makedepends-$pkgname \
|
|
|
|
$builddeps \
|
|
|
|
|| return 1
|
|
|
|
if [ -n "$CBUILDROOT" ]; then
|
|
|
|
[ -z "$_quiet" ] && msg "Installing for host:$hostdeps"
|
|
|
|
- $SUDO_APK add $_quiet --root "$CBUILDROOT" --arch "$CTARGET_ARCH" --repository "$REPODEST/$repo" $apk_opt_wait \
|
|
|
|
+ $APK add $_quiet --root "$CBUILDROOT" --arch "$CTARGET_ARCH" --repository "$REPODEST/$repo" $apk_opt_wait \
|
|
|
|
--no-scripts --virtual .makedepends-$pkgname $hostdeps || return 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
undeps() {
|
|
|
|
local _quiet="$@"
|
|
|
|
- $SUDO_APK del $_quiet $apk_opt_wait .makedepends-$pkgname || :
|
|
|
|
+ $APK del $_quiet $apk_opt_wait .makedepends-$pkgname || :
|
|
|
|
if [ -n "$CBUILDROOT" ]; then
|
|
|
|
- $SUDO_APK del $_quiet --root "$CBUILDROOT" --arch "$CTARGET_ARCH" $apk_opt_wait \
|
|
|
|
+ $APK del $_quiet --root "$CBUILDROOT" --arch "$CTARGET_ARCH" $apk_opt_wait \
|
|
|
|
--no-scripts .makedepends-$pkgname || :
|
|
|
|
fi
|
|
|
|
}
|
2018-11-19 22:45:41 +01:00
|
|
|
@@ -2481,7 +2415,7 @@
|
2018-11-19 13:08:55 +01:00
|
|
|
package Install project into $pkgdir
|
|
|
|
prepare Apply patches
|
|
|
|
rootbld Build package in clean chroot
|
|
|
|
- rootpkg Run 'package', the split functions and create apks as fakeroot
|
|
|
|
+ rootpkg Run 'package', the split functions and create apks
|
|
|
|
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
|
2018-11-19 22:45:41 +01:00
|
|
|
@@ -2563,7 +2497,7 @@
|
2018-11-19 13:08:36 +01:00
|
|
|
if [ -z "$REPODEST" ]; then
|
|
|
|
warning "REPODEST is not set and is now required. Defaulting to ~/packages"
|
|
|
|
[ -n "$PKGDEST" ] && die "PKGDEST is no longer supported."
|
|
|
|
- REPODEST="~/packages"
|
|
|
|
+ REPODEST="$HOME/packages"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# for recursive action
|