dcb926abd4
* termux-licenses: remove licenses that contain copyright information These licenses cannot be taken from the common termux-licenses package as the copyright information needs to be distributed with the package as well. 271 packages in the main repository needs to be rebuilt after this change. * termux_step_install_license: remove duplicated comment * Bump packages that has a license with copyright information We need to include this copyright information in the package so need to rebuild them now that termux_step_install_license has been modified. The affected licenses are: MIT, ISC, PythonPL, Openfont-1.1, ZLIB, Libpng, BSD, BSD 2-Clause, BSD 3-Clause. * zlib: extract license file from zlib.h * xorgproto: include all individual license files in package * libgcrypt: include LICENSE file in package It contains some copyright information so needs to be included in package * libcrypt: add a dummy BSD 2-Clause license According to homepage it is suppose to be BSD 2-Clause, but original project did not include a license file * libandroid-spawn: add LICENSE file to package * libandroid-glob: add license file to package * licenses: allow for comma separated TERMUX_PKG_LICENSE_FILE %ci:no-build * libicu: fix so that termux_step_install_license finds license file %ci:no-build * termux_step_install_license: check for license file as "License" %ci:no-build * libtiff: specify TERMUX_PKG_LICENSE_FILE %ci:no-build * asciidoctor: install license to standard location * krb5: specify license file * libdb: specify path to license file %ci:no-build * libprotobuf: specify path to license file * darkhttpd: extract license file from darkhttpd.c * w3m: ensure host libraries are not picked up * w3m: extract LICENSE file from dock/README * liblua{,52}: extract license files from doc/readme.html * termux_step_install_license: look for License.txt as well * dart: specify path to LICENSE file * nim: specify license file * runit: specify license file * termux_step_install_license: look for LICENSE.TXT as well * ossp-uuid: extract LICENSE from README * pigz: extract LICENSE from pigz.c * ttyrec: extract LICENSE from ttyrec.c %ci:no-build * bmon: specify license files Most of the source files are licensed under MIT, it is not clear (to me) which parts that are licensed under BSD 2-Clause. %ci:no-build * wordgrinder: specify license files * fdupes: add LICENSE * autossh: add LICENSE patch * cmake: specify LICENSE file * dos2unix: specify LICENSE file * gnuplot: specify LICENSE file * termux_step_install_license: look for variants of "copyright" also * picolisp: specify LICENSE file * lua-lpeg: extract license file * tidy: specify license file * gflags: specify LICENSE file * timewarrior: fix src url It seems to have been changed. * postgresql: specify license file * ttyrec: fix license patch header * fossil: specify license file * fmt: specify license file * i2pd: specify license file * leptonica: specify license file * imgflo: add license file patch * ired: add license file from ired github repo * libzen: specify license file * libmediainfo: specify license file * mediainfo: specify license file * tty-clock: add license patch * samefile: add license patch * quickjs: add license patch * docbook-xml: add LICENSE patch * docbook-xsl: specify LICENSE files * gnuplot: configure with --without-latex * timewarrior: add libshared to SRCURL as well The non-release archives does not contain gitsubmodules so we need to download it manually. * restic: switch back to using 0.9.6 archive * dart: revert revision bump dart's SDK does not fully support python3 yet, and trying to solve that is not entirely trivial. We save the dart bump (and upgrade to 2.8.4) for another day. %ci:no-build
94 lines
4.1 KiB
Bash
94 lines
4.1 KiB
Bash
TERMUX_PKG_HOMEPAGE=https://www.rust-lang.org/
|
|
TERMUX_PKG_DESCRIPTION="Systems programming language focused on safety, speed and concurrency"
|
|
TERMUX_PKG_LICENSE="MIT"
|
|
TERMUX_PKG_MAINTAINER="Kevin Cotugno @kcotugno"
|
|
TERMUX_PKG_VERSION=1.43.1
|
|
TERMUX_PKG_REVISION=4
|
|
TERMUX_PKG_SRCURL=https://static.rust-lang.org/dist/rustc-$TERMUX_PKG_VERSION-src.tar.xz
|
|
TERMUX_PKG_SHA256=eb0a103c67c4565403d9e6f84a1c708982a5e9e5b3c0d831e4d6f6451795d106
|
|
TERMUX_PKG_DEPENDS="libc++, clang, openssl, lld, zlib, libllvm"
|
|
termux_step_configure() {
|
|
termux_setup_cmake
|
|
termux_setup_rust
|
|
|
|
# it breaks building rust tools without doing this because it tries to find
|
|
# ../lib from bin location:
|
|
# this is about to get ugly but i have to make sure a rustc in a proper bin lib
|
|
# configuration is used otherwise it fails a long time into the build...
|
|
# like 30 to 40 + minutes ... so lets get it right
|
|
|
|
# upstream only tests build ver one version behind $TERMUX_PKG_VERSION
|
|
local BOOTSTRAP_VERSION=1.42.0
|
|
rustup install $BOOTSTRAP_VERSION
|
|
rustup default $BOOTSTRAP_VERSION-x86_64-unknown-linux-gnu
|
|
export PATH=$HOME/.rustup/toolchains/$BOOTSTRAP_VERSION-x86_64-unknown-linux-gnu/bin:$PATH
|
|
local RUSTC=$(which rustc)
|
|
local CARGO=$(which cargo)
|
|
|
|
sed "s%\\@TERMUX_PREFIX\\@%$TERMUX_PREFIX%g" \
|
|
$TERMUX_PKG_BUILDER_DIR/config.toml \
|
|
| sed "s%\\@TERMUX_STANDALONE_TOOLCHAIN\\@%$TERMUX_STANDALONE_TOOLCHAIN%g" \
|
|
| sed "s%\\@triple\\@%$CARGO_TARGET_NAME%g" \
|
|
| sed "s%\\@RUSTC\\@%$RUSTC%g" \
|
|
| sed "s%\\@CARGO\\@%$CARGO%g" \
|
|
> config.toml
|
|
|
|
local env_host=$(printf $CARGO_TARGET_NAME | tr a-z A-Z | sed s/-/_/g)
|
|
export LD_LIBRARY_PATH=$TERMUX_PKG_BUILDDIR/build/x86_64-unknown-linux-gnu/stage2/lib
|
|
export ${env_host}_OPENSSL_DIR=$TERMUX_PREFIX
|
|
export X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR=/usr/lib/x86_64-linux-gnu
|
|
export X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR=/usr/include
|
|
export PKG_CONFIG_ALLOW_CROSS=1
|
|
# for backtrace-sys
|
|
export CC_x86_64_unknown_linux_gnu=gcc
|
|
export CFLAGS_x86_64_unknown_linux_gnu="-O2"
|
|
unset CC CXX CPP LD CFLAGS CXXFLAGS CPPFLAGS LDFLAGS PKG_CONFIG AR RANLIB
|
|
# we can't use -L$PREFIX/lib since it breaks things but we need to link against libLLVM-9.so
|
|
ln -sf $PREFIX/lib/libLLVM-9.0.1.so $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/$TERMUX_HOST_PLATFORM/$TERMUX_PKG_API_LEVEL/
|
|
|
|
# rust checks libs in PREFIX/lib because both host and target are x86_64. It then can't find libc.so and libdl.so because rust program doesn't
|
|
# know where those are. Putting them temporarly in $PREFIX/lib prevents that failure
|
|
|
|
if [ $TERMUX_ARCH = "x86_64" ]; then
|
|
cp $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/x86_64-linux-android/$TERMUX_PKG_API_LEVEL/libc.so $TERMUX_PREFIX/lib/
|
|
cp $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/x86_64-linux-android/$TERMUX_PKG_API_LEVEL/libdl.so $TERMUX_PREFIX/lib/
|
|
mv $TERMUX_PREFIX/lib/libtinfo.so.6 $TERMUX_PREFIX/lib/libtinfo.so.6.tmp
|
|
fi
|
|
}
|
|
|
|
termux_step_make() {
|
|
return 0;
|
|
}
|
|
termux_step_make_install() {
|
|
$TERMUX_PKG_SRCDIR/x.py dist librustc --host $CARGO_TARGET_NAME --target $CARGO_TARGET_NAME --target wasm32-unknown-unknown
|
|
$TERMUX_PKG_SRCDIR/x.py dist rustc-dev --host $CARGO_TARGET_NAME --target $CARGO_TARGET_NAME --target wasm32-unknown-unknown
|
|
$TERMUX_PKG_SRCDIR/x.py install --stage 2 --host $CARGO_TARGET_NAME --target $CARGO_TARGET_NAME --target wasm32-unknown-unknown
|
|
tar xvf build/dist/rustc-dev-$TERMUX_PKG_VERSION-$CARGO_TARGET_NAME.tar.gz
|
|
./rustc-dev-$TERMUX_PKG_VERSION-$CARGO_TARGET_NAME/install.sh --prefix=$TERMUX_PREFIX
|
|
|
|
cd "$TERMUX_PREFIX/lib"
|
|
rm -f libc.so libdl.so
|
|
if [ $TERMUX_ARCH = "x86_64" ]; then
|
|
mv $TERMUX_PREFIX/lib/libtinfo.so.6.tmp $TERMUX_PREFIX/lib/libtinfo.so.6
|
|
fi
|
|
|
|
ln -sf rustlib/$CARGO_TARGET_NAME/lib/*.so .
|
|
ln -sf $TERMUX_PREFIX/bin/lld $TERMUX_PREFIX/bin/rust-lld
|
|
|
|
cd "$TERMUX_PREFIX/lib/rustlib"
|
|
rm -rf components \
|
|
install.log \
|
|
uninstall.sh \
|
|
rust-installer-version \
|
|
manifest-* \
|
|
x86_64-unknown-linux-gnu
|
|
rm $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/$TERMUX_HOST_PLATFORM/$TERMUX_PKG_API_LEVEL/libLLVM-9.0.1.so
|
|
|
|
}
|
|
termux_step_post_massage() {
|
|
if [ $TERMUX_ARCH = "x86_64" ]; then
|
|
rm lib/libtinfo.so.6
|
|
fi
|
|
}
|
|
|