Skip to content

Commit a1c3f7f

Browse files
committed
forked version of termux-packages
0 parents  commit a1c3f7f

File tree

125 files changed

+12983
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+12983
-0
lines changed

.gitattributes

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Default.
2+
* text eol=lf
3+
4+
# Treat patch files as binaries but let diff'ing them
5+
# as normal text.
6+
*.diff binary diff
7+
*.patch binary diff
8+
*.patch32 binary diff
9+
*.patch64 binary diff
10+
*.patch.* binary diff
11+
12+
# Powershell scripts.
13+
*.ps1 text eol=crlf
14+
15+
# Binaries.
16+
*.gpg binary
17+
*.gz binary
18+
*.jpg binary
19+
*.png binary
20+
*.tar binary
21+
*.tar.* binary

.github/stale.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
daysUntilStale: 45
2+
daysUntilClose: 14
3+
4+
exemptLabels:
5+
- "not stale"
6+
- "package request"
7+
8+
markComment: >
9+
This issue/PR has been automatically marked as stale because it has not had
10+
recent activity. It will be closed if no further activity occurs. Thank you
11+
for your contributions.
12+
13+
staleLabel: wontfix
14+

.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Vim
2+
[._]*.s[a-w][a-z]
3+
[._]s[a-w][a-z]
4+
*.un~
5+
Session.vim
6+
.netrwhist
7+
*~
8+
9+
# Vagrant
10+
scripts/*.log
11+
scripts/.vagrant/
12+
13+
# Built *.deb files.
14+
/debs/
15+
/output/
16+
17+
# Preinstalled build tools.
18+
/build-tools/
19+
20+
# Predownloaded packages sources.
21+
/packages/*/cache
22+
/root-packages/*/cache
23+
/x11-packages/*/cache

LICENSE.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# License for package patches
2+
3+
The scripts and patches to build each package is licensed under the same
4+
license as the actual package (so the patches and scripts to build bash are
5+
licensed under the same license as bash, while the patches and scripts to build
6+
python are licensed under the same license as python).
7+
8+
# License for the build infrastructure
9+
10+
For build infrastructure outside the `packages/` folder the license is
11+
[Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0).

build-all.sh

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
#!/bin/bash
2+
# build-all.sh - script to build all packages with a build order specified by buildorder.py
3+
4+
set -e -u -o pipefail
5+
6+
if [ "$(uname -o)" = "Android" ] || [ -e "/system/bin/app_process" ]; then
7+
echo "On-device execution of this script is not supported."
8+
exit 1
9+
fi
10+
11+
# Read settings from .termuxrc if existing
12+
test -f "$HOME"/.termuxrc && . "$HOME"/.termuxrc
13+
: ${TERMUX_TOPDIR:="$HOME/.termux-build"}
14+
: ${TERMUX_ARCH:="aarch64"}
15+
: ${TERMUX_DEBUG_BUILD:=""}
16+
: ${TERMUX_INSTALL_DEPS:="-s"}
17+
# Set TERMUX_INSTALL_DEPS to -s unless set to -i
18+
19+
_show_usage() {
20+
echo "Usage: ./build-all.sh [-a ARCH] [-d] [-i] [-o DIR]"
21+
echo "Build all packages."
22+
echo " -a The architecture to build for: aarch64(default), arm, i686, x86_64 or all."
23+
echo " -d Build with debug symbols."
24+
echo " -i Build dependencies."
25+
echo " -o Specify deb directory. Default: debs/."
26+
exit 1
27+
}
28+
29+
while getopts :a:hdio: option; do
30+
case "$option" in
31+
a) TERMUX_ARCH="$OPTARG";;
32+
d) TERMUX_DEBUG_BUILD='-d';;
33+
i) TERMUX_INSTALL_DEPS='-i';;
34+
o) TERMUX_OUTPUT_DIR="$(realpath -m "$OPTARG")";;
35+
h) _show_usage;;
36+
*) _show_usage >&2 ;;
37+
esac
38+
done
39+
shift $((OPTIND-1))
40+
if [ "$#" -ne 0 ]; then _show_usage; fi
41+
42+
if [[ ! "$TERMUX_ARCH" =~ ^(all|aarch64|arm|i686|x86_64)$ ]]; then
43+
echo "ERROR: Invalid arch '$TERMUX_ARCH'" 1>&2
44+
exit 1
45+
fi
46+
47+
BUILDSCRIPT=$(dirname "$0")/build-package.sh
48+
BUILDALL_DIR=$TERMUX_TOPDIR/_buildall-$TERMUX_ARCH
49+
BUILDORDER_FILE=$BUILDALL_DIR/buildorder.txt
50+
BUILDSTATUS_FILE=$BUILDALL_DIR/buildstatus.txt
51+
52+
if [ -e "$BUILDORDER_FILE" ]; then
53+
echo "Using existing buildorder file: $BUILDORDER_FILE"
54+
else
55+
mkdir -p "$BUILDALL_DIR"
56+
./scripts/buildorder.py > "$BUILDORDER_FILE"
57+
fi
58+
if [ -e "$BUILDSTATUS_FILE" ]; then
59+
echo "Continuing build-all from: $BUILDSTATUS_FILE"
60+
fi
61+
62+
exec > >(tee -a "$BUILDALL_DIR"/ALL.out)
63+
exec 2> >(tee -a "$BUILDALL_DIR"/ALL.err >&2)
64+
trap 'echo ERROR: See $BUILDALL_DIR/${PKG}.err' ERR
65+
66+
while read -r PKG PKG_DIR; do
67+
# Check build status (grepping is a bit crude, but it works)
68+
if [ -e "$BUILDSTATUS_FILE" ] && grep "^$PKG\$" "$BUILDSTATUS_FILE" >/dev/null; then
69+
echo "Skipping $PKG"
70+
continue
71+
fi
72+
73+
echo -n "Building $PKG... "
74+
BUILD_START=$(date "+%s")
75+
bash -x "$BUILDSCRIPT" -a "$TERMUX_ARCH" $TERMUX_DEBUG_BUILD \
76+
${TERMUX_OUTPUT_DIR+-o $TERMUX_OUTPUT_DIR} $TERMUX_INSTALL_DEPS "$PKG_DIR" \
77+
> "$BUILDALL_DIR"/"${PKG}".out 2> "$BUILDALL_DIR"/"${PKG}".err
78+
BUILD_END=$(date "+%s")
79+
BUILD_SECONDS=$(( BUILD_END - BUILD_START ))
80+
echo "done in $BUILD_SECONDS"
81+
82+
# Update build status
83+
echo "$PKG" >> "$BUILDSTATUS_FILE"
84+
done<"${BUILDORDER_FILE}"
85+
86+
# Update build status
87+
rm -f "$BUILDSTATUS_FILE"
88+
echo "Finished"

0 commit comments

Comments
 (0)