Commit | Line | Data |
---|---|---|
59f0d218 FF |
1 | TERMUX_PKG_HOMEPAGE=https://packages.debian.org/apt |
2 | TERMUX_PKG_DESCRIPTION="Front-end for the dpkg package manager" | |
d4ec417b | 3 | TERMUX_PKG_DEPENDS="liblzma, dpkg, gpgv" |
03fffa39 | 4 | # Wait with updating to later version until the NDK supports std::to_string() and other |
d4f51079 FF |
5 | # functions (hopefully in r15, https://github.com/android-ndk/ndk/issues/82). |
6 | # Updating to apt 1.4 will also get rid of the build hacks used as apt has transitioned | |
7 | # to a clean cmake build system. | |
3c323c69 | 8 | TERMUX_PKG_VERSION=1.2.12 |
de9af52c | 9 | TERMUX_PKG_REVISION=2 |
03fffa39 FF |
10 | # TERMUX_PKG_SRCURL=http://ftp.debian.org/debian/pool/main/a/apt/apt_${TERMUX_PKG_VERSION}.tar.xz |
11 | TERMUX_PKG_SRCURL=https://launchpad.net/ubuntu/+archive/primary/+files/apt_${TERMUX_PKG_VERSION}.tar.xz | |
95acf6ed | 12 | TERMUX_PKG_SHA256=e820d27cba73476df4abcff27dadd1b5847474bfe85f7e9202a9a07526973ea6 |
580afa5a | 13 | TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--no-create ac_cv_lib_bz2_BZ2_bzopen=no" |
59f0d218 | 14 | TERMUX_PKG_FOLDERNAME=apt-${TERMUX_PKG_VERSION} |
d4f51079 | 15 | TERMUX_PKG_BUILD_IN_SRC=yes |
59f0d218 | 16 | TERMUX_PKG_ESSENTIAL=yes |
620ebd76 | 17 | TERMUX_PKG_CONFFILES="etc/apt/sources.list" |
59f0d218 | 18 | |
59f0d218 | 19 | termux_step_pre_configure () { |
385c8aef FF |
20 | # Some files use STD*_FILENO without including <unistd.h> where they are declared. |
21 | # Define them here to avoid having to patch files: | |
22 | CXXFLAGS+=" -DSTDIN_FILENO=0 -DSTDOUT_FILENO=1 -DSTDERR_FILENO=2 -DAI_IDN=0" | |
23 | ||
eab01be6 | 24 | cp $TERMUX_SCRIPTDIR/scripts/config.{guess,sub} $TERMUX_PKG_SRCDIR/buildlib |
385c8aef | 25 | perl -p -i -e "s/TERMUX_ARCH/$TERMUX_ARCH/" $TERMUX_PKG_SRCDIR/configure |
a1b579d9 FF |
26 | |
27 | rm $TERMUX_PKG_SRCDIR/apt-pkg/{cdrom.cc,indexcopy.cc} | |
59f0d218 FF |
28 | } |
29 | ||
59f0d218 | 30 | termux_step_make_install () { |
d4f51079 FF |
31 | cp $TERMUX_PKG_BUILDDIR/build/bin/apt{,-get,-cache,-config,-key} $TERMUX_PREFIX/bin/ |
32 | cp $TERMUX_PKG_BUILDDIR/build/bin/libapt-{pkg.so.5.0.0,private.so.0.0} $TERMUX_PREFIX/lib/ | |
5f3c9b82 | 33 | (cd $TERMUX_PREFIX/lib; ln -s -f libapt-pkg.so.5.0.0 libapt-pkg.so.5.0; ln -s -f libapt-pkg.so.5.0.0 libapt-pkg.so ) |
d4f51079 FF |
34 | mkdir -p $TERMUX_PREFIX/lib/apt/methods $TERMUX_PREFIX/share/man/man{5,8} |
35 | cp $TERMUX_PKG_BUILDDIR/build/docs/apt{,-cache,-get}.8 $TERMUX_PREFIX/share/man/man8/ | |
36 | cp $TERMUX_PKG_BUILDDIR/build/docs/{apt.conf,sources.list}.5 $TERMUX_PREFIX/share/man/man5/ | |
de9af52c | 37 | cp $TERMUX_PKG_BUILDDIR/build/bin/methods/{copy,file,gpgv,gzip,http,https,rsh,store} $TERMUX_PREFIX/lib/apt/methods |
d4f51079 | 38 | (cd $TERMUX_PREFIX/lib/apt/methods; ln -f -s gzip xz) |
de9af52c | 39 | (cd $TERMUX_PREFIX/lib/apt/methods; ln -f -s rsh ssh) |
59f0d218 | 40 | |
d4f51079 FF |
41 | mkdir -p $TERMUX_PREFIX/etc/apt |
42 | printf "# The main termux repository:\ndeb [arch=all,${TERMUX_ARCH}] http://termux.net stable main\n" > $TERMUX_PREFIX/etc/apt/sources.list | |
59f0d218 | 43 | |
d4f51079 FF |
44 | # The trusted.gpg was created with "apt-key add public-key.key": |
45 | cp $TERMUX_PKG_BUILDER_DIR/trusted.gpg $TERMUX_PREFIX/etc/apt/ | |
039b43de FF |
46 | |
47 | mkdir -p $TERMUX_PREFIX/etc/bash_completion.d/ | |
48 | cp $TERMUX_PKG_SRCDIR/completions/bash/apt \ | |
49 | $TERMUX_PREFIX/etc/bash_completion.d/ | |
59f0d218 | 50 | } |