2022-08-04 18:27:59 +03:00
|
|
|
distributable:
|
|
|
|
url: https://github.com/denoland/deno/archive/refs/tags/v{{ version }}.tar.gz
|
|
|
|
strip-components: 1
|
|
|
|
|
|
|
|
versions:
|
|
|
|
github: denoland/deno
|
|
|
|
|
|
|
|
provides:
|
|
|
|
- bin/deno
|
|
|
|
|
|
|
|
interprets:
|
2022-11-25 19:03:11 +03:00
|
|
|
# extensions: [ts, js] # nodejs.org for now
|
|
|
|
extensions: ts
|
|
|
|
args: [deno, run]
|
2022-08-04 18:27:59 +03:00
|
|
|
|
2022-11-28 18:53:42 +03:00
|
|
|
runtime:
|
|
|
|
env:
|
2023-12-14 08:10:53 +03:00
|
|
|
DENO_NO_UPDATE_CHECK: 'true'
|
2024-03-30 19:09:45 +03:00
|
|
|
DENORT_BIN: '{{prefix}}/bin/denort'
|
2024-02-23 04:31:59 +03:00
|
|
|
|
2022-08-04 18:27:59 +03:00
|
|
|
build:
|
2023-12-14 08:10:53 +03:00
|
|
|
script:
|
2024-04-03 22:32:39 +03:00
|
|
|
# deno does not need llvm to build on darwin+x86-64, and if it is present,
|
|
|
|
# deno will be linked to its libunwind, which then causes deno to need llvm
|
|
|
|
# in runtime.
|
|
|
|
- |
|
|
|
|
if test "{{hw.platform}}+{{ hw.arch }}" != "darwin+x86-64"; then
|
|
|
|
set -o allexport
|
|
|
|
source <(pkgx +llvm.org^17)
|
|
|
|
set +o allexport
|
|
|
|
fi
|
|
|
|
|
2024-04-01 21:28:44 +03:00
|
|
|
- |
|
|
|
|
rust_version=$(yq -er .toolchain.channel rust-toolchain.toml)
|
|
|
|
if semverator lt "$rust_version" 1.67.0; then
|
|
|
|
# older versions of rustc --print=split-debuginfo fails with:
|
|
|
|
# error: unknown print request `split-debuginfo`
|
|
|
|
# maybe due to newer cargo?
|
|
|
|
rust_version=1.67.0
|
|
|
|
fi
|
|
|
|
set -o allexport
|
2024-04-03 22:32:39 +03:00
|
|
|
source <(pkgx "+rust-lang.org~${rust_version}" +rust-lang.org/cargo^0)
|
2024-04-01 21:28:44 +03:00
|
|
|
set +o allexport
|
|
|
|
unset rust_version
|
|
|
|
|
2022-09-15 23:26:40 +03:00
|
|
|
# https://github.com/denoland/deno/issues/15596 -- reported fixed in 1.25.3
|
2023-12-14 08:10:53 +03:00
|
|
|
- run: |
|
|
|
|
find ext/ffi/tinycc -maxdepth 0 -empty -exec \
|
|
|
|
git clone https://github.com/TinyCC/tinycc.git {} \;
|
2022-09-15 23:26:40 +03:00
|
|
|
|
2024-04-01 21:28:44 +03:00
|
|
|
if test "{{hw.platform}}+{{ hw.arch }}" = "darwin+x86-64"; then
|
2023-12-14 08:10:53 +03:00
|
|
|
# our LLVM cannot build with deployment target set to 10.6
|
|
|
|
sed -i.bak s/MACOSX_DEPLOYMENT_TARGET/\#/ ext/ffi/tinycc/Makefile
|
|
|
|
fi
|
|
|
|
if: '>=1.25.0<1.25.4'
|
2023-01-27 03:23:00 +03:00
|
|
|
|
2023-03-07 22:38:38 +03:00
|
|
|
# change default bindir to ~/.local/bin per our conventions
|
2023-12-14 08:10:53 +03:00
|
|
|
- sed -i'' -e 's/home_path.push(".deno")/home_path.push(".local")/' cli/tools/installer.rs
|
|
|
|
|
|
|
|
- grep home_path cli/tools/installer.rs
|
2023-03-07 22:38:38 +03:00
|
|
|
|
2024-04-16 19:07:22 +03:00
|
|
|
# curve25519-dalek 4.1.2 introduces some odd simd issues on x86-64 on Rust <1.78 (unreleased)
|
|
|
|
- run: sed -i
|
|
|
|
-e 's/version = "4.1.2"/version = "4.1.1"/'
|
|
|
|
-e 's/0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348/e89b8c6a2e4b1f45971ad09761aafb85514a84744b67a95e32c3cc1352d1f65c/'
|
|
|
|
Cargo.lock
|
|
|
|
|
2024-05-01 17:46:00 +03:00
|
|
|
# 1.43.0 published as 1.43.1
|
|
|
|
- run: sed -i 's/^version = .*/version = "{{version}}"/' cli/Cargo.toml
|
|
|
|
|
2024-02-23 04:31:59 +03:00
|
|
|
- cargo install --locked --path cli --root "{{ prefix }}"
|
2022-08-04 18:27:59 +03:00
|
|
|
dependencies:
|
2023-12-14 08:10:53 +03:00
|
|
|
git-scm.org: 2 # to build tinycc
|
|
|
|
curl.se: '*' # required to download v8 (python is another option)
|
|
|
|
cmake.org: ^3 # deno.land>=1.36.1 requires cmake
|
|
|
|
protobuf.dev: '*' # deno.land>=1.36.4 requires protoc
|
2024-04-01 21:28:44 +03:00
|
|
|
github.com/mikefarah/yq: ^4
|
|
|
|
crates.io/semverator: ^0
|
2022-08-04 18:27:59 +03:00
|
|
|
|
|
|
|
test:
|
2024-04-01 21:28:44 +03:00
|
|
|
dependencies:
|
|
|
|
gnu.org/coreutils: '*' # for stat and numfmt
|
2023-12-14 08:10:53 +03:00
|
|
|
script:
|
|
|
|
- deno --version | grep {{version}}
|
|
|
|
- mv $FIXTURE test.ts
|
2024-02-23 04:31:59 +03:00
|
|
|
- deno install -f test.ts
|
2023-12-14 08:10:53 +03:00
|
|
|
- test "$($HOME/.local/bin/test)" = "Hello, world!"
|
2024-01-13 21:21:49 +03:00
|
|
|
- deno compile test.ts
|
|
|
|
- test "$(./test)" = "Hello, world!"
|
2024-03-30 19:09:45 +03:00
|
|
|
# human readable size of ./test should be equal to the size of denort to ensure our denort is being used
|
2024-04-16 19:07:22 +03:00
|
|
|
- run: test "$(stat -c %s ./test | numfmt --to=iec-i)" = "$(stat -c %s "{{prefix}}/bin/denort" | numfmt --to=iec-i)"
|
|
|
|
if: '>=1.40.5'
|
2024-04-01 21:28:44 +03:00
|
|
|
# tests download of dependencies
|
|
|
|
- deno eval 'import { VERSION } from "https://deno.land/std@0.221.0/version.ts"; console.log(VERSION);' | tee /dev/stderr | grep -q ^0.221.0$
|
2023-03-07 22:38:38 +03:00
|
|
|
fixture: |
|
|
|
|
console.log("Hello, world!");
|