Skip to content

Commit

Permalink
bump(main/nushell): 0.98.0
Browse files Browse the repository at this point in the history
Fixes #21503.
  • Loading branch information
fornwall committed Sep 19, 2024
1 parent cb8b212 commit 336f240
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 106 deletions.
26 changes: 26 additions & 0 deletions packages/nushell/Cargo.lock.patch

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 4 additions & 52 deletions packages/nushell/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,68 +2,20 @@ TERMUX_PKG_HOMEPAGE=https://www.nushell.sh
TERMUX_PKG_DESCRIPTION="A new type of shell operating on structured data"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="0.97.1"
TERMUX_PKG_VERSION="0.98.0"
TERMUX_PKG_SRCURL=https://github.com/nushell/nushell/archive/$TERMUX_PKG_VERSION.tar.gz
TERMUX_PKG_SHA256=e605d5a7f104b7f2bf99197ca2f34a4a68f68cc12ecab41f606113e6a65b67b1
TERMUX_PKG_SHA256=c77fd63c4a5f2d35f7dcbb3e9bd76dfaa23acc6bc21fb1de4e7a4a94dc458839
TERMUX_PKG_AUTO_UPDATE=true
TERMUX_PKG_DEPENDS="openssl, zlib"
TERMUX_PKG_DEPENDS="openssl"
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
--no-default-features
--features=default-no-clipboard
"

termux_step_pre_configure() {
termux_setup_rust

local _CARGO_TARGET_LIBDIR="target/${CARGO_TARGET_NAME}/release/deps"
mkdir -p $_CARGO_TARGET_LIBDIR

if [ $TERMUX_ARCH = "i686" ]; then
RUSTFLAGS+=" -C link-arg=-latomic"
elif [ $TERMUX_ARCH = "x86_64" ]; then
pushd $_CARGO_TARGET_LIBDIR
if [ "$TERMUX_ARCH" = "x86_64" ]; then
RUSTFLAGS+=" -C link-arg=$($CC -print-libgcc-file-name)"
echo "INPUT(-l:libunwind.a)" >libgcc.so
popd
fi

: "${CARGO_HOME:=$HOME/.cargo}"
export CARGO_HOME

rm -rf $CARGO_HOME/registry/src/*/libmimalloc-sys-*
cargo fetch --target "${CARGO_TARGET_NAME}"

local d p
p="libmimalloc-sys-tls.diff"
for d in $CARGO_HOME/registry/src/*/libmimalloc-sys-*; do
patch --silent -p1 -d ${d} < "${TERMUX_PKG_BUILDER_DIR}/${p}"
done

# XXX: Do not enable `mimalloc` feature. It will fetch `libmimalloc-sys`,
# XXX: which needs to be patched to compile successfully, at building
# XXX: time. `cargo fetch` will not fetch its source.
# XXX: Besides, the above `libminalloc-sys` patch is also necessary because
# XXX: some dependencies of nushell refer to it.
sed -i 's/"mimalloc",/ /g' $TERMUX_PKG_SRCDIR/Cargo.toml

mv $TERMUX_PREFIX/lib/libz.so.1{,.tmp}
mv $TERMUX_PREFIX/lib/libz.so{,.tmp}

ln -sfT $(readlink -f $TERMUX_PREFIX/lib/libz.so.1.tmp) \
$_CARGO_TARGET_LIBDIR/libz.so.1
ln -sfT $(readlink -f $TERMUX_PREFIX/lib/libz.so.tmp) \
$_CARGO_TARGET_LIBDIR/libz.so
}

termux_step_post_make_install() {
mv $TERMUX_PREFIX/lib/libz.so.1{.tmp,}
mv $TERMUX_PREFIX/lib/libz.so{.tmp,}
}

termux_step_post_massage() {
rm -f lib/libz.so.1
rm -f lib/libz.so

rm -rf $CARGO_HOME/registry/src/*/libmimalloc-sys-*
}
54 changes: 0 additions & 54 deletions packages/nushell/libmimalloc-sys-tls.diff

This file was deleted.

0 comments on commit 336f240

Please sign in to comment.