|
|
@ -2,6 +2,7 @@ |
|
|
|
|
|
|
|
|
# Slackware build script for deno |
|
|
# Slackware build script for deno |
|
|
|
|
|
|
|
|
|
|
|
# Copyright 2025 fourtysixandtwo <fourtysixandtwo@sliderr.net> |
|
|
# Copyright 2025, Lockywolf |
|
|
# Copyright 2025, Lockywolf |
|
|
# All rights reserved. |
|
|
# All rights reserved. |
|
|
# |
|
|
# |
|
|
@ -29,8 +30,7 @@ VERSION=${VERSION:-2.5.2} |
|
|
BUILD=${BUILD:-1} |
|
|
BUILD=${BUILD:-1} |
|
|
TAG=${TAG:-_SBo} |
|
|
TAG=${TAG:-_SBo} |
|
|
PKGTYPE=${PKGTYPE:-tgz} |
|
|
PKGTYPE=${PKGTYPE:-tgz} |
|
|
|
|
|
|
|
|
TARNAM=${PRGNAM}_src |
|
|
|
|
|
|
|
|
VSBUILD=${VSBUILD:-1} |
|
|
|
|
|
|
|
|
if [ -z "$ARCH" ]; then |
|
|
if [ -z "$ARCH" ]; then |
|
|
case "$( uname -m )" in |
|
|
case "$( uname -m )" in |
|
|
@ -72,67 +72,28 @@ rm -rf $PKG |
|
|
mkdir -p $TMP $PKG $OUTPUT |
|
|
mkdir -p $TMP $PKG $OUTPUT |
|
|
cd $TMP |
|
|
cd $TMP |
|
|
rm -rf $PRGNAM-$VERSION |
|
|
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 |
|
|
cd $PRGNAM-$VERSION |
|
|
tar xvf $CWD/$TARNAM.tar.gz |
|
|
|
|
|
cd $PRGNAM |
|
|
|
|
|
chown -R root:root . |
|
|
chown -R root:root . |
|
|
find -L . \ |
|
|
find -L . \ |
|
|
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ |
|
|
\( -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 \ |
|
|
\( -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" |
|
|
export PATH="/opt/rust/bin:$PATH" |
|
|
if [ -z "$LD_LIBRARY_PATH" ]; then |
|
|
if [ -z "$LD_LIBRARY_PATH" ]; then |
|
|
@ -141,13 +102,10 @@ else |
|
|
export LD_LIBRARY_PATH="/opt/rust/lib$LIBDIRSUFFIX:$LD_LIBRARY_PATH" |
|
|
export LD_LIBRARY_PATH="/opt/rust/lib$LIBDIRSUFFIX:$LD_LIBRARY_PATH" |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
CARGO_HOME=.cargo \ |
|
|
|
|
|
CFLAGS="$SLKCFLAGS" \ |
|
|
CFLAGS="$SLKCFLAGS" \ |
|
|
CXXFLAGS="$SLKCFLAGS" \ |
|
|
CXXFLAGS="$SLKCFLAGS" \ |
|
|
cargo build --release --locked |
|
|
cargo build --release --locked |
|
|
|
|
|
|
|
|
printf "LWF:cargo build succeeded.\n" |
|
|
|
|
|
|
|
|
|
|
|
install -Dm755 target/release/deno "$PKG"/usr/bin/deno |
|
|
install -Dm755 target/release/deno "$PKG"/usr/bin/deno |
|
|
install -dm755 "$PKG"/usr/share/bash-completion/completions |
|
|
install -dm755 "$PKG"/usr/share/bash-completion/completions |
|
|
./target/release/deno completions bash > "$PKG"/usr/share/bash-completion/completions/deno |
|
|
./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 |
|
|
install -dm755 "$PKG"/usr/share/fish/vendor_completions.d |
|
|
./target/release/deno completions fish > "$PKG"/usr/share/fish/vendor_completions.d/deno.fish |
|
|
./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 \ |
|
|
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 |
|
|
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true |
|
|
|
|
|
|
|
|
|