Skip to content

Commit

Permalink
Update AUR packages for termux
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxython committed Jul 11, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 8658390 commit 26dc34e
Showing 10 changed files with 104 additions and 34 deletions.
39 changes: 20 additions & 19 deletions termux/binutils-glibc/PKGBUILD
Original file line number Diff line number Diff line change
@@ -7,26 +7,30 @@

pkgname=binutils-glibc
pkgver=2.38
pkgrel=0
pkgrel=1
pkgdesc='A set of programs to assemble and manipulate binary and object files'
arch=(any)
arch=('aarch64' 'arm' 'x86_64' 'i686')
url='https://www.gnu.org/software/binutils/'
license=('GPL3' 'GPL' 'FDL1.3' 'custom:FSFAP')
#_commit=cb5f6a3e146cc70bc2d864989386df80acec5d3e
#source=(git+https://sourceware.org/git/binutils-gdb.git#commit=$_commit)
source=(https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.xz{,.sig}
gold-warn-unsupported.patch
fix-incorrect-undefined-symbol.patch)
fix-incorrect-undefined-symbol.patch
ldelf.c.patch)
sha256sums=('e316477a914f567eccc34d5d29785b8b0f5a10208d36bbacedcc39048ecfe024'
'SKIP'
'2d430b66f84a19c154725ec535280c493be1d34f1a90f95208dce02fecd0e4e4'
'fd33b2f8cac7561cecf3fdbb5a50fd2f2dfa6420516cbe57c47784a06fa16bf6')
'fd33b2f8cac7561cecf3fdbb5a50fd2f2dfa6420516cbe57c47784a06fa16bf6'
'1e9a96e2529986f352dc379b3ee18d62d86c436cda40941cad30e6f7e7e2d5e8')
validpgpkeys=(3A24BC1E8FB409FA9F14371813FCEF89DD9E3C4F)

prepare() {
[[ ! -d binutils-gdb ]] && ln -s binutils-$pkgver binutils-gdb
mkdir -p binutils-build

patch -Np1 -i "${srcdir}"/ldelf.c.patch

cd binutils-gdb

# Turn off development mode (-Werror, gas run-time checks, date in sonames)
@@ -39,22 +43,19 @@ prepare() {
# Change the gold configuration script to only warn about
# unsupported targets. This allows the binutils to be built with
# BPF support enabled.
/data/data/com.termux/files/usr/bin/patch -Np1 -i "${srcdir}"/gold-warn-unsupported.patch
patch -Np1 -i "${srcdir}"/gold-warn-unsupported.patch

# fix incorrect "undefined reference" errors
# https://sourceware.org/bugzilla/show_bug.cgi?id=28879
/data/data/com.termux/files/usr/bin/patch -Np1 -i "${srcdir}"/fix-incorrect-undefined-symbol.patch
patch -Np1 -i "${srcdir}"/fix-incorrect-undefined-symbol.patch
}

build() {
cd binutils-build

CFLAGS="-Wl,-rpath=/data/data/com.termux/files/usr/glibc/lib -Wl,--dynamic-linker=/data/data/com.termux/files/usr/glibc/lib/ld-linux-aarch64.so.1"
CXXFLAGS="${CFLAGS}"

"$srcdir/binutils-gdb/configure" \
--prefix=/data/data/com.termux/files/usr/glibc \
--with-lib-path=/data/data/com.termux/files/usr/glibc/lib:/data/data/com.termux/files/usr/glibc/local/lib \
--prefix=${prefix}/glibc \
--with-lib-path=${prefix}/glibc/lib:${prefix}/glibc/local/lib \
--with-bugurl=https://bugs.archlinux.org/ \
--enable-cet \
--enable-deterministic-archives \
@@ -77,7 +78,7 @@ build() {
--with-pic \
--with-system-zlib

make -O tooldir=/data/data/com.termux/files/usr/glibc
make -O tooldir=${prefix}/glibc

# Extract the FSF All Permissive License
# <https://www.gnu.org/prep/maintain/html_node/License-Notices-for-Other-Files.html>
@@ -87,18 +88,18 @@ build() {

package() {
cd binutils-build
make prefix="$pkgdir/data/data/com.termux/files/usr/glibc" tooldir="$pkgdir/data/data/com.termux/files/usr/glibc" install
make prefix="$terdir/usr/glibc" tooldir="$terdir/usr/glibc" install

# Remove unwanted files
rm -f "$pkgdir"/data/data/com.termux/files/usr/glibc/share/man/man1/{dlltool,nlmconv,windres,windmc}*
rm -f "$terdir"/usr/glibc/share/man/man1/{dlltool,nlmconv,windres,windmc}*

# No shared linking to these files outside binutils
rm -f "$pkgdir"/data/data/com.termux/files/usr/glibc/lib/lib{bfd,opcodes}.so
echo 'INPUT( /data/data/com.termux/files/usr/glibc/lib/libbfd.a -liberty -lz -ldl )' > "$pkgdir/data/data/com.termux/files/usr/glibc/lib/libbfd.so"
echo 'INPUT( /data/data/com.termux/files/usr/glibc/lib/libopcodes.a -lbfd )' > "$pkgdir/data/data/com.termux/files/usr/glibc/lib/libopcodes.so"
rm -f "$terdir"/usr/glibc/lib/lib{bfd,opcodes}.so
echo "INPUT( ${prefix}/glibc/lib/libbfd.a -liberty -lz -ldl )" > "$terdir/usr/glibc/lib/libbfd.so"
echo "INPUT( ${prefix}/glibc/lib/libopcodes.a -lbfd )" > "$terdir/usr/glibc/lib/libopcodes.so"

# install FSF All Permissive License
install -Dm644 -t "${pkgdir}"/data/data/com.termux/files/usr/glibc/share/licenses/${pkgname}/ FSFAP
install -Dm644 -t "${terdir}"/usr/glibc/share/licenses/${pkgname}/ FSFAP

rm -f "${pkgdir}"/data/data/com.termux/files/usr/glibc/share/info/dir
rm -f "${terdir}"/usr/glibc/share/info/dir
}
38 changes: 38 additions & 0 deletions termux/binutils-glibc/ldelf.c.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
diff -uNr src/binutils-2.38/ld/ldelf.c src/binutils-2.38/ld/ldelf.c.patch
--- src/binutils-2.38/ld/ldelf.c 2022-01-22 15:14:09.000000000 +0300
+++ src/binutils-2.38/ld/ldelf.c.patch 2022-07-10 23:24:40.326945641 +0300
@@ -131,7 +131,7 @@
/* On Linux, it's possible to have different versions of the same
shared library linked against different versions of libc. The
dynamic linker somehow tags which libc version to use in
- /etc/ld.so.cache, and, based on the libc that it sees in the
+ /data/data/com.termux/files/usr/glibc/etc/ld.so.cache, and, based on the libc that it sees in the
executable, chooses which version of the shared library to use.

We try to do a similar check here by checking whether this shared
@@ -756,8 +756,8 @@
return ldelf_search_needed (ld_elf_hints, &needed, force, false, elfsize);
}

-/* For a native linker, check the file /etc/ld.so.conf for directories
- in which we may find shared libraries. /etc/ld.so.conf is really
+/* For a native linker, check the file /data/data/com.termux/files/usr/glibc/etc/ld.so.conf for directories
+ in which we may find shared libraries. /data/data/com.termux/files/usr/glibc/etc/ld.so.conf is really
only meaningful on Linux. */

struct ldelf_ld_so_conf
@@ -930,12 +930,12 @@

info.path = NULL;
info.len = info.alloc = 0;
- tmppath = concat (ld_sysroot, prefix, "/etc/ld.so.conf",
+ tmppath = concat (ld_sysroot, prefix, "/data/data/com.termux/files/usr/glibc/etc/ld.so.conf",
(const char *) NULL);
if (!ldelf_parse_ld_so_conf (&info, tmppath))
{
free (tmppath);
- tmppath = concat (ld_sysroot, "/etc/ld.so.conf",
+ tmppath = concat (ld_sysroot, "/data/data/com.termux/files/usr/glibc/etc/ld.so.conf",
(const char *) NULL);
ldelf_parse_ld_so_conf (&info, tmppath);
}
4 changes: 2 additions & 2 deletions termux/keyutils-glibc/PKGBUILD
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
pkgname=keyutils-glibc
_tag='5678a1aae8834b5c16b5ed7dc72ef8836a29e122' # git rev-parse v${pkgver}
pkgver=1.6.3
pkgrel=0
pkgrel=1
pkgdesc='Linux Key Management Utilities'
arch=('aarch64' 'arm' 'x86_64' 'i686')
url='https://www.kernel.org/'
@@ -35,7 +35,7 @@ build() {
package() {
cd keyutils
mkdir -p "${terdir}/usr/glibc"
make DESTDIR="${terdir}/usr/glibc" SBINDIR='/bin' BINDIR='/bin' LIBDIR='/lib' USRLIBDIR="/lib" install
make DESTDIR="${terdir}/usr/glibc" SBINDIR='/bin' BINDIR='/bin' LIBDIR='/lib' USRLIBDIR="/lib" INCLUDEDIR="/include" SHAREDIR="/share/keyutils" MANDIR="/share/man" install
rm "${terdir}"/usr/glibc/lib/libkeyutils.so
ln -s libkeyutils.so.1 "${terdir}"/usr/glibc/lib/libkeyutils.so
}
4 changes: 4 additions & 0 deletions termux/krb5-glibc/PKGBUILD
Original file line number Diff line number Diff line change
@@ -78,6 +78,10 @@ package() {
# systemd stuff
install -Dm 644 "${srcdir}"/krb5-{kadmind.service,kdc.service,kpropd.service,kpropd@.service,kpropd.socket} \
-t "${terdir}/usr/glibc/lib/systemd/system"

for i in bin/compile_et include/com_err.h lib/libcom_err.so share/et/et_c.awk share/et/et_h.awk share/man/man1/compile_et.1; do
rm "${terdir}"/usr/glibc/${i}
done
}

# vim: ts=2 sw=2 et:
2 changes: 1 addition & 1 deletion termux/libtirpc-glibc/PKGBUILD
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ pkgdesc="Transport Independent RPC library (SunRPC replacement)"
arch=('aarch64' 'arm' 'x86_64' 'i686')
url="http://git.linux-nfs.org/?p=steved/libtirpc.git;a=summary"
license=('BSD')
depends=('krb5')
#depends=('krb5')
backup=('data/data/com.termux/files/usr/glibc/etc/netconfig')
# git tree: git://linux-nfs.org/~steved/libtirpc
source=(https://downloads.sourceforge.net/sourceforge/libtirpc/libtirpc-${pkgver}.tar.bz2)
18 changes: 10 additions & 8 deletions termux/libtool-glibc/PKGBUILD
Original file line number Diff line number Diff line change
@@ -14,20 +14,24 @@ pkgdesc='A generic library support script'
arch=('aarch64' 'arm' 'x86_64' 'i686')
url='https://www.gnu.org/software/libtool'
license=(GPL)
groups=(base-devel)
#groups=(base-devel)
checkdepends=(gcc-fortran)
options=(debug)
_commit=6d7ce133ce54898cf28abd89d167cccfbc3c9b2b
source=(git+https://git.savannah.gnu.org/git/libtool.git#commit=$_commit
git+https://git.savannah.gnu.org/git/gnulib.git
gnulib-bootstrap::git+https://github.com/gnulib-modules/bootstrap.git
no_hostname.patch
disable-lto-link-order2.patch)
disable-lto-link-order2.patch
libtool.patch
libtoolize.in.patch)
sha256sums=('SKIP'
'SKIP'
'SKIP'
'693aabb24a6e7ce21fe0b5d14394e19edcb8476663b5afa4463f9fa0df24d946'
'b6dce6681f223b18a90614edbcdeb00f228abd1216e22c4bd07285321cd2ceb7')
'b6dce6681f223b18a90614edbcdeb00f228abd1216e22c4bd07285321cd2ceb7'
'SKIP'
'SKIP')

pkgver() {
cd libtool
@@ -55,15 +59,13 @@ prepare() {
build() {
cd libtool
./configure --prefix=${prefix}/glibc lt_cv_sys_lib_dlsearch_path_spec="${prefix}/glibc/lib"
sed -i 's|! /bin|! /data/data/com.termux/files/usr/bin|' $(ls -p | grep -v /)
sed -i 's|! /usr/bin|! /data/data/com.termux/files/usr/bin|' $(ls -p | grep -v /)
patch -Np1 -i "${srcdir}"/libtool.patch
patch -Np1 -i "${srcdir}"/libtoolize.in.patch
make
}

package() {
cd libtool
make DESTDIR="$pkgdir" install
sed -i 's|! /bin|! /data/data/com.termux/files/usr/bin|' "$terdir"/usr/glibc/bin/*
sed -i 's|! /usr/bin|! /data/data/com.termux/files/usr/bin|' "$terdir"/usr/glibc/bin/*
sed -i 's|SHELL="/bin/sh"|SHELL="/data/data/com.termux/files/usr/bin/sh"|' "$terdir"/usr/glibc/bin/libtool
rm "${terdir}"/usr/glibc/share/info/dir
}
17 changes: 17 additions & 0 deletions termux/libtool-glibc/libtool.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
--- libtool/libtool 2022-07-11 10:55:46.541316304 +0300
+++ libtool/libtool.patch 2022-07-11 11:01:31.801316173 +0300
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /data/data/com.termux/files/usr/bin/sh
# Generated automatically by config.status (libtool) 2.4.7-dirty
# NOTE: Changes made to this file will be lost: look at ltmain.sh.

@@ -65,7 +65,7 @@
shared_archive_member_spec=

# Shell to use when invoking shell scripts.
-SHELL="/bin/sh"
+SHELL="/data/data/com.termux/files/usr/bin/sh"

# An echo program that protects backslashes.
ECHO="printf %s\\n"
8 changes: 8 additions & 0 deletions termux/libtool-glibc/libtoolize.in.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
--- libtool/libtoolize.in 2022-07-11 10:54:34.621316332 +0300
+++ libtool/libtoolize.in.patch 2022-07-11 11:04:43.491316099 +0300
@@ -1,4 +1,4 @@
-#! /usr/bin/env sh
+#! /data/data/com.termux/files/usr/bin/env sh

# Prepare a package to use libtool.
# Written by Gary V. Vaughan <gary@gnu.org>, 2003
4 changes: 2 additions & 2 deletions termux/mpfr-glibc/PKGBUILD
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ arch=('aarch64' 'arm' 'x86_64' 'i686')
url='https://www.mpfr.org/'
license=('GPL3' 'LGPL3')
depends=()
makedepends=('autoconf-archive')
#makedepends=('autoconf-archive')
source=("https://ftp.gnu.org/gnu/mpfr/mpfr-${_pkgver}.tar.xz"{,.sig}
patches.diff) # wget https://www.mpfr.org/mpfr-4.1.0/allpatches -O patches.diff
sha512sums=('1bd1c349741a6529dfa53af4f0da8d49254b164ece8a46928cdb13a99460285622d57fe6f68cef19c6727b3f9daa25ddb3d7d65c201c8f387e421c7f7bee6273'
@@ -29,7 +29,7 @@ prepare() {
cd mpfr-${_pkgver}

patch -p1 < "$srcdir"/patches.diff
autoreconf -fiv
#autoreconf -fiv
}

build() {
4 changes: 2 additions & 2 deletions termux/openssl-glibc/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Maintainer: Pierre Schmitz <pierre@archlinux.de>

pkgname=openssl-glibc
_ver=1.1.1o
_ver=1.1.1q
# use a pacman compatible version scheme
pkgver=${_ver/[a-z]/.${_ver//[0-9.]/}}
pkgrel=0
@@ -13,7 +13,7 @@ makedepends=('perl')
backup=('data/data/com.termux/files/usr/glibc/etc/ssl/openssl.cnf')
source=("https://www.openssl.org/source/openssl-${_ver}.tar.gz"{,.asc}
'ca-dir.patch')
sha256sums=('9384a2b0570dd80358841464677115df785edb941c71211f75076d72fe6b438f'
sha256sums=('d7939ce614029cdff0b6c20f0e2e5703158a489a72b2507b8bd51bf8c8fd10ca'
'SKIP'
'9ffaf3fb5443fe1b7a18dc407f04a4a781834bcbc52187ff97f4c1fa1e2f8cdf')
validpgpkeys=('8657ABB260F056B1E5190839D9C4D26D0E604491'

0 comments on commit 26dc34e

Please # to comment.