Browse Source

development/deno: New maintainer, and vendored sources.

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
master
fourtysixandtwo 6 days ago
committed by Willy Sudiarto Raharjo
parent
commit
fb3459ce12
No known key found for this signature in database GPG Key ID: 3F617144D7238786
  1. 74
      development/deno/deno.SlackBuild
  2. 1888
      development/deno/deno.info
  3. 17
      development/deno/mkvendored.sh

74
development/deno/deno.SlackBuild

@ -2,6 +2,7 @@
# Slackware build script for deno
# Copyright 2025 fourtysixandtwo <fourtysixandtwo@sliderr.net>
# Copyright 2025, Lockywolf
# All rights reserved.
#
@ -29,8 +30,7 @@ VERSION=${VERSION:-2.5.2}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
TARNAM=${PRGNAM}_src
VSBUILD=${VSBUILD:-1}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@ -72,67 +72,28 @@ rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
mkdir $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
tar xvf $CWD/$PRGNAM-vendored-sources-$VERSION-$VSBUILD.tar.?z
cd $PRGNAM-$VERSION
tar xvf $CWD/$TARNAM.tar.gz
cd $PRGNAM
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
-o -perm 511 \) -exec chmod 755 {} \; -o \
-o -perm 511 \) -exec chmod 755 {} \+ -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
rm -rf ./".cargo"
mkdir .cargo
cat << EOF >> .cargo/config
[source.crates-io]
registry = 'https://github.com/rust-lang/crates.io-index'
replace-with = 'vendored-sources'
[source.vendored-sources]
directory = '$(pwd)/vendor'
EOF
# deps and versions come from Cargo.lock
mkdir vendor
(
cd vendor
grep -h -A 3 "\[\[package\]\]" $(find ../ -maxdepth 1 -mindepth 1 -name Cargo.lock | tr '\n' ' ') | \
sed 's/[[:space:]]*=[[:space:]]*/=/g;s/^--//;s/^\[\[/--\n[[/' | \
awk 'BEGIN { RS = "--\n" ; FS="\n" } { print $2, $3, $4 }' | sed 's/"//g;s/name=//;s/ version=/=/' | \
grep crates\.io-index | sed 's/ source=.*$//' | sort -u | while read -r dep ; do
ver="$(printf "%s\n" "$dep" | cut -d= -f2)"
dep="$(printf "%s\n" "$dep" | cut -d= -f1)"
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
tar xvf $CWD/"$dep-$ver".crate
#mkdir -p ./vendor/v8-140.2.0/.cargo/.rusty_v8/
#cp $CWD/librusty_v8_release_x86_64-unknown-linux-gnu.a.gz ./vendor/v8-140.2.0/.cargo/.rusty_v8/https___github_com_denoland_rusty_v8_releases_download_v140_2_0_librusty_v8_release_x86_64_unknown_linux_gnu_a_gz
touch "$dep-$ver/.cargo-ok"
export RUSTY_V8_ARCHIVE=$CWD/librusty_v8_release_x86_64-unknown-linux-gnu.a.gz
# generate checksum
{
printf "{\n"
printf ' "files": {\n'
# prevent cargo from using the network.
# this only works because we have a vendored sources tarball with
# everything cargo would have downloaded.
export CARGO_NET_OFFLINE=true
(
cd "$dep-$ver"
find . -type f -print0 | xargs -0 sha256sum | sed -n '/\.cargo-checksum\.json/!p' | sed 's/\.\///;s/^\([^ ]*\)[[:space:]][[:space:]]*\(.*\)$/"\2":"\1",/'
) | sed '$ s/,$//'
printf " },\n"
printf ' "package": "'
sha256sum "$CWD/$dep-$ver.crate" | cut -f1 -d' ' | sed 's/$/"/'
printf "}\n"
} > "$dep"-"$ver"/.cargo-checksum.json
done
)
mkdir -p ./vendor/v8-140.2.0/.cargo/.rusty_v8/
cp $CWD/librusty_v8_release_x86_64-unknown-linux-gnu.a.gz ./vendor/v8-140.2.0/.cargo/.rusty_v8/https___github_com_denoland_rusty_v8_releases_download_v140_2_0_librusty_v8_release_x86_64_unknown_linux_gnu_a_gz
# prevent cargo from writing outside of $TMP
export CARGO_HOME=$(pwd)/.cargo
export PATH="/opt/rust/bin:$PATH"
if [ -z "$LD_LIBRARY_PATH" ]; then
@ -141,13 +102,10 @@ else
export LD_LIBRARY_PATH="/opt/rust/lib$LIBDIRSUFFIX:$LD_LIBRARY_PATH"
fi
CARGO_HOME=.cargo \
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
cargo build --release --locked
printf "LWF:cargo build succeeded.\n"
install -Dm755 target/release/deno "$PKG"/usr/bin/deno
install -dm755 "$PKG"/usr/share/bash-completion/completions
./target/release/deno completions bash > "$PKG"/usr/share/bash-completion/completions/deno
@ -156,8 +114,6 @@ install -dm755 "$PKG"/usr/share/zsh/site-functions
install -dm755 "$PKG"/usr/share/fish/vendor_completions.d
./target/release/deno completions fish > "$PKG"/usr/share/fish/vendor_completions.d/deno.fish
printf "LWF:AUR install succeeded.\n"
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true

1888
development/deno/deno.info
File diff suppressed because it is too large
View File

17
development/deno/mkvendored.sh

@ -0,0 +1,17 @@
#!/bin/bash
# This is a wrapper script for cargo-mkvendored.sh which is
# included in the cargo-vendor-filterer slackbuild and needs to be
# installed. It is only needed if you are upgrading the version and
# need new vendored rust libs.
#
# create $PRGNAM-vendored-sources-$VERSION-$VSBUILD.tar.xz
# requires network access, but does not require root privilege.
# requires that $PRGNAM's REQUIRES need to be installed first
if [ -f /usr/bin/cargo-mkvendored.sh ]; then
/usr/bin/cargo-mkvendored.sh
else
echo " ERROR: cargo-mkvendored.sh script is not available!!
ERROR: Install the cargo-vendor-filterer slackbuild."
fi
Loading…
Cancel
Save