这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions packages/python-brotli/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
TERMUX_PKG_HOMEPAGE=https://github.com/google/brotli
TERMUX_PKG_DESCRIPTION="lossless compression algorithm and format (Python bindings)"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=1.1.0
TERMUX_PKG_REVISION=2
TERMUX_PKG_SRCURL=https://github.com/google/brotli/archive/v$TERMUX_PKG_VERSION.tar.gz
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has the same TERMUX_PKG_SRCURL as main/brotli,

would it make sense to combine the build.sh and make this a subpackage of that?

TERMUX_PKG_VERSION=1.1.0
TERMUX_PKG_SRCURL=https://github.com/google/brotli/archive/v$TERMUX_PKG_VERSION.tar.gz

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not realize that.
It's definitely an option.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to leave that for another time actually.

Mainly because I don't think subpackages support all required build variables.
https://github.com/termux/termux-packages/wiki/Creating-new-package#subpackage-build-script-variables

TERMUX_PKG_PYTHON_COMMON_DEPS in particular doesn't seems to have an equivalent for subpackages.
I'm not really happy with the current separation of subpackages as some separate class of package as I've stated previously and this seems to be another case to solidify that.

Leaving it as a separate package for the time being doesn't appear to have any adverse consequences.
It is independent from Brotli in all but source repository as is already.

Copy link
Member

@robertkirkman robertkirkman Mar 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I agree it's a bit confusing, but TERMUX_PKG_PYTHON_COMMON_DEPS is actually dependencies that only get installed while the package is building (there are no instances of packages or subpackages that install TERMUX_PKG_PYTHON_COMMON_DEPS during install-time rather than build-time).

Because of that, it means that you would actually put TERMUX_PKG_PYTHON_COMMON_DEPS in the build.sh of the main package, not the subpackage (because, since it's not possible to build a subpackage without also building the main package, the build dependencies of subpackages are defined in the build.sh of the main package).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having an interstitial main/python-brotli package at least makes the "succession" clearer.
Having a BREAKS/REPLACES for a TUR package is a bit iffy.
Although, I'm not even sure replacing a "standalone" package with a subpackage of the same name would require a breaks/replaces entry.

TERMUX_PKG_SHA256=e720a6ca29428b803f4ad165371771f5398faba397edf6778837a18599ea13ff
TERMUX_PKG_DEPENDS="python, python-pip"
TERMUX_PKG_PYTHON_COMMON_DEPS="wheel"
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_AUTO_UPDATE=true

termux_step_configure() {
# ERROR: ./lib/python3.12/site-packages/_brotli.cpython-312.so contains undefined symbols:
# 31: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND log2
LDFLAGS+=" -lm"
LDFLAGS+=" -Wl,--no-as-needed -lpython${TERMUX_PYTHON_VERSION}"
}

termux_step_make() {
:
}

termux_step_make_install() {
pip install . --prefix="$TERMUX_PREFIX" -vv --no-build-isolation --no-deps
}
25 changes: 25 additions & 0 deletions packages/python-pycryptodomex/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
TERMUX_PKG_HOMEPAGE=https://www.pycryptodome.org/
TERMUX_PKG_DESCRIPTION="A self-contained Python package of low-level cryptographic primitives"
TERMUX_PKG_LICENSE="BSD 2-Clause, Public Domain"
TERMUX_PKG_LICENSE_FILE="LICENSE.rst"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="3.21.0"
TERMUX_PKG_REVISION=2
TERMUX_PKG_SRCURL="https://github.com/Legrandin/pycryptodome/archive/refs/tags/v${TERMUX_PKG_VERSION}x.tar.gz"
TERMUX_PKG_SHA256=7762d1b658b47e989f21ed844a8bf9a527b130fecec26f0d5076656dc38c0558
TERMUX_PKG_DEPENDS="python, python-pip"
TERMUX_PKG_PYTHON_COMMON_DEPS="wheel"
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_AUTO_UPDATE=true

termux_step_pre_configure() {
LDFLAGS+=" -Wl,--no-as-needed -lpython${TERMUX_PYTHON_VERSION}"
}

termux_step_make() {
:
}

termux_step_make_install() {
pip install . --prefix="$TERMUX_PREFIX" -vv --no-build-isolation --no-deps
}
47 changes: 47 additions & 0 deletions packages/python-yt-dlp/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
TERMUX_PKG_HOMEPAGE=https://github.com/yt-dlp/yt-dlp
TERMUX_PKG_DESCRIPTION="A youtube-dl fork with additional features and fixes"
TERMUX_PKG_LICENSE="Unlicense"
TERMUX_PKG_MAINTAINER="Joshua Kahn @TomJo2000"
TERMUX_PKG_VERSION="2025.02.19"
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://github.com/yt-dlp/yt-dlp/archive/refs/tags/$TERMUX_PKG_VERSION.tar.gz
TERMUX_PKG_SHA256=3942d04ac56b7cbd51881653946662dc84b8628c9405f9e9bacb29d0259e0ab1
TERMUX_PKG_DEPENDS="libc++, libexpat, openssl, python, python-brotli, python-pip, python-pycryptodomex"
TERMUX_PKG_RECOMMENDS="ffmpeg"
TERMUX_PKG_PYTHON_COMMON_DEPS="hatchling, wheel"
TERMUX_PKG_PYTHON_TARGET_DEPS="mutagen, pycryptodomex, websockets, certifi, brotli, requests, urllib3"
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_HOSTBUILD=true
TERMUX_PKG_AUTO_UPDATE=true
TERMUX_PKG_PROVIDES='yt-dlp'

termux_step_host_build() {
cp -Rf $TERMUX_PKG_SRCDIR ./

( cd src && make completions )
}

termux_step_make() {
:
}

termux_step_make_install() {
# Install library
pip install . --prefix=$TERMUX_PREFIX -vv --no-build-isolation --no-deps

# Install completions
install -Dm600 $TERMUX_PKG_HOSTBUILD_DIR/src/completions/bash/yt-dlp \
-t "$TERMUX_PREFIX"/share/bash-completion/completions
install -Dm600 $TERMUX_PKG_HOSTBUILD_DIR/src/completions/zsh/_yt-dlp \
-t "$TERMUX_PREFIX"/share/zsh/site-functions
install -Dm600 $TERMUX_PKG_HOSTBUILD_DIR/src/completions/fish/yt-dlp.fish \
-t "$TERMUX_PREFIX"/share/fish/completions
}

termux_step_create_debscripts() {
cat <<- EOF > ./postinst
#!$TERMUX_PREFIX/bin/sh
echo "Installing dependencies through pip..."
pip3 install ${TERMUX_PKG_PYTHON_TARGET_DEPS//, / }
EOF
}