Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deno #2002

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Deno #2002

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions extra/deno/Cargo.toml.patch
Original file line number Diff line number Diff line change
@@ -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`
56 changes: 56 additions & 0 deletions extra/deno/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Maintainer: Felix Yan <[email protected]>
# Contributor: Metal A-wing <1 at 233 dot email>

# ALARM: Will Christensen <wirwc[at]gmail.com>
# - 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 -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 mdbook
cargo build --release
}

check() {
cd $pkgname
ls -lsa
# ./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 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/
}