From 669a5c25f6686c78929d5766973f9b0e5869c28f Mon Sep 17 00:00:00 2001 From: DagoRed Date: Sat, 15 Jul 2023 22:52:05 +0000 Subject: [PATCH 1/5] adding pkgbuild for deno Signed-off-by: Will Christensen --- extra/deno/Cargo.toml.patch | 26 ++++++++++++++++++ extra/deno/PKGBUILD | 55 +++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 extra/deno/Cargo.toml.patch create mode 100644 extra/deno/PKGBUILD diff --git a/extra/deno/Cargo.toml.patch b/extra/deno/Cargo.toml.patch new file mode 100644 index 0000000000..c8a1cebea1 --- /dev/null +++ b/extra/deno/Cargo.toml.patch @@ -0,0 +1,26 @@ +--- Cargo.toml.orig 2023-07-15 15:39:59.618904488 +0000 ++++ Cargo.toml 2023-07-15 22:04:36.249321112 +0000 +@@ -169,9 +169,9 @@ + + # NB: the `bench` and `release` profiles must remain EXACTLY the same. + [profile.release] +-codegen-units = 1 ++codegen-units = 32 + incremental = true +-lto = true ++lto = false + opt-level = 'z' # Optimize for size + + # Build release with debug symbols: cargo build --profile=release-with-debug +@@ -181,9 +181,9 @@ + + # NB: the `bench` and `release` profiles must remain EXACTLY the same. + [profile.bench] +-codegen-units = 1 ++codegen-units = 32 + incremental = true +-lto = true ++lto = false + opt-level = 'z' # Optimize for size + + # Key generation is too slow on `debug` diff --git a/extra/deno/PKGBUILD b/extra/deno/PKGBUILD new file mode 100644 index 0000000000..5c1ea9e6c7 --- /dev/null +++ b/extra/deno/PKGBUILD @@ -0,0 +1,55 @@ +# Maintainer: Felix Yan +# Contributor: Metal A-wing <1 at 233 dot email> + +# ALARM: Will Christensen +# - edit Config.toml for release codegen-units to 32, lto to false + + +pkgname=deno +pkgver=1.35.1 +_commit=b4824bf45f3d12e1b53e7eb5afcd49c38a575210 +pkgrel=1 +pkgdesc="A secure runtime for JavaScript and TypeScript" +arch=('x86_64' 'aarch64') +url="https://deno.land" +license=('MIT') +options=('!lto') +depends=('gcc-libs') +makedepends=('git' 'python' 'rust' 'nodejs') +source=("git+https://github.com/denoland/deno.git#commit=$_commit" "Cargo.toml.patch") +sha512sums=('SKIP' + 'a0041dcece68c4d7e1e40d7b78e508e976260cd56eb30f606ec277e9d7ddd9b5d41e2a18f8fb426e6f14c670ef14c5d0801453874c0793d7d7b553e7080e387f') + +prepare() { + cd $pkgname + # https://github.com/denoland/deno/issues/19528 + git cherry-pick -n c8dc6b14ec5c1b6de28118ed3b07d037eaaaf702 + patch -Np1 -i ../Cargo.toml.patch -u Cargo.toml +} + +build() { + cd $pkgname + # For systems with less than 4.5 GB swap + CARGO_TARGET_DIR=tmp cargo install + cargo build --release +} + +check() { + cd $pkgname + ./target/release/deno run cli/tests/testdata/run/002_hello.ts +} + +package() { + cd $pkgname + install -Dm755 target/release/deno "$pkgdir"/usr/bin/deno + + install -dm755 "$pkgdir"/usr/share/bash-completion/completions + ./target/release/deno completions bash > "$pkgdir"/usr/share/bash-completion/completions/deno + install -dm755 "$pkgdir"/usr/share/zsh/site-functions + ./target/release/deno completions zsh > "$pkgdir"/usr/share/zsh/site-functions/_deno + install -dm755 "$pkgdir"/usr/share/fish/vendor_functions.d + ./target/release/deno completions fish > "$pkgdir"/usr/share/fish/vendor_functions.d/deno.fish + + install -Dm644 LICENSE.md -t "$pkgdir"/usr/share/licenses/$pkgname/ +} + From 7ac5a42110c5294842de2e05aaf50e91a980b0cf Mon Sep 17 00:00:00 2001 From: DagoRed Date: Sat, 15 Jul 2023 23:06:41 +0000 Subject: [PATCH 2/5] edit cargo target for lower ram hosts Signed-off-by: Will Christensen --- extra/deno/PKGBUILD | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extra/deno/PKGBUILD b/extra/deno/PKGBUILD index 5c1ea9e6c7..ff8d8ea980 100644 --- a/extra/deno/PKGBUILD +++ b/extra/deno/PKGBUILD @@ -24,13 +24,13 @@ prepare() { cd $pkgname # https://github.com/denoland/deno/issues/19528 git cherry-pick -n c8dc6b14ec5c1b6de28118ed3b07d037eaaaf702 - patch -Np1 -i ../Cargo.toml.patch -u Cargo.toml + patch -Np1 -u Cargo.toml -i ../../Cargo.toml.patch } build() { cd $pkgname # For systems with less than 4.5 GB swap - CARGO_TARGET_DIR=tmp cargo install + CARGO_TARGET_DIR=tmp cargo install mdbook cargo build --release } From eebc6e1b05c14df537273c0de4495a2ad0f3a52b Mon Sep 17 00:00:00 2001 From: DagoRed Date: Sun, 16 Jul 2023 04:57:35 +0000 Subject: [PATCH 3/5] simplify cargo target Signed-off-by: Will Christensen --- extra/deno/PKGBUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/deno/PKGBUILD b/extra/deno/PKGBUILD index ff8d8ea980..2063dda5ed 100644 --- a/extra/deno/PKGBUILD +++ b/extra/deno/PKGBUILD @@ -30,7 +30,7 @@ prepare() { build() { cd $pkgname # For systems with less than 4.5 GB swap - CARGO_TARGET_DIR=tmp cargo install mdbook + CARGO_TARGET_DIR=tmp cargo build --release } From 135c63dc1ee3efa8678b6d272b5cbf71852b20ea Mon Sep 17 00:00:00 2001 From: DagoRed Date: Mon, 17 Jul 2023 03:27:47 +0000 Subject: [PATCH 4/5] adjust check and package targets Signed-off-by: Will Christensen --- extra/deno/PKGBUILD | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/extra/deno/PKGBUILD b/extra/deno/PKGBUILD index 2063dda5ed..c2176454bb 100644 --- a/extra/deno/PKGBUILD +++ b/extra/deno/PKGBUILD @@ -3,6 +3,8 @@ # ALARM: Will Christensen # - edit Config.toml for release codegen-units to 32, lto to false +# - use tmp folder due to smaller ARM targets having limited swap +# - adjust check and package to use tmp location for release pkgname=deno @@ -36,20 +38,20 @@ build() { check() { cd $pkgname - ./target/release/deno run cli/tests/testdata/run/002_hello.ts + ls -lsa + ./tmp/release/deno run cli/tests/testdata/run/002_hello.ts } package() { cd $pkgname - install -Dm755 target/release/deno "$pkgdir"/usr/bin/deno + install -Dm755 tmp/release/deno "$pkgdir"/usr/bin/deno install -dm755 "$pkgdir"/usr/share/bash-completion/completions - ./target/release/deno completions bash > "$pkgdir"/usr/share/bash-completion/completions/deno + ./tmp/release/deno completions bash > "$pkgdir"/usr/share/bash-completion/completions/deno install -dm755 "$pkgdir"/usr/share/zsh/site-functions - ./target/release/deno completions zsh > "$pkgdir"/usr/share/zsh/site-functions/_deno + ./tmp/release/deno completions zsh > "$pkgdir"/usr/share/zsh/site-functions/_deno install -dm755 "$pkgdir"/usr/share/fish/vendor_functions.d - ./target/release/deno completions fish > "$pkgdir"/usr/share/fish/vendor_functions.d/deno.fish + ./tmp/release/deno completions fish > "$pkgdir"/usr/share/fish/vendor_functions.d/deno.fish install -Dm644 LICENSE.md -t "$pkgdir"/usr/share/licenses/$pkgname/ } - From 5e65a0628f5a1a0b7f2a1e161afa25484a6393a6 Mon Sep 17 00:00:00 2001 From: Will Christensen Date: Fri, 21 Jul 2023 14:56:10 +0000 Subject: [PATCH 5/5] simplifying build after expaning cargo target dir --- extra/deno/PKGBUILD | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/extra/deno/PKGBUILD b/extra/deno/PKGBUILD index c2176454bb..e0f55083a9 100644 --- a/extra/deno/PKGBUILD +++ b/extra/deno/PKGBUILD @@ -3,8 +3,6 @@ # ALARM: Will Christensen # - edit Config.toml for release codegen-units to 32, lto to false -# - use tmp folder due to smaller ARM targets having limited swap -# - adjust check and package to use tmp location for release pkgname=deno @@ -32,26 +30,27 @@ prepare() { build() { cd $pkgname # For systems with less than 4.5 GB swap - CARGO_TARGET_DIR=tmp + CARGO_TARGET_DIR=tmp cargo install mdbook cargo build --release } check() { cd $pkgname ls -lsa - ./tmp/release/deno run cli/tests/testdata/run/002_hello.ts + # ./tmp/release/deno run cli/tests/testdata/run/002_hello.ts + ./target/release/deno run cli/tests/testdata/run/002_hello.ts } package() { cd $pkgname - install -Dm755 tmp/release/deno "$pkgdir"/usr/bin/deno + install -Dm755 target/release/deno "$pkgdir"/usr/bin/deno install -dm755 "$pkgdir"/usr/share/bash-completion/completions - ./tmp/release/deno completions bash > "$pkgdir"/usr/share/bash-completion/completions/deno + ./target/release/deno completions bash > "$pkgdir"/usr/share/bash-completion/completions/deno install -dm755 "$pkgdir"/usr/share/zsh/site-functions - ./tmp/release/deno completions zsh > "$pkgdir"/usr/share/zsh/site-functions/_deno + ./target/release/deno completions zsh > "$pkgdir"/usr/share/zsh/site-functions/_deno install -dm755 "$pkgdir"/usr/share/fish/vendor_functions.d - ./tmp/release/deno completions fish > "$pkgdir"/usr/share/fish/vendor_functions.d/deno.fish + ./target/release/deno completions fish > "$pkgdir"/usr/share/fish/vendor_functions.d/deno.fish install -Dm644 LICENSE.md -t "$pkgdir"/usr/share/licenses/$pkgname/ }