deno/deno.spec
Soc Virnyl Estela 17bda34809 - Update to version 2.0.5:
* fix: panic_hook hangs without procfs
  * chore: deprecate run itests
  * fix(install): handle invalid function error, and fallback to junctions regardless of the error
  * fix: op_run_microtasks crash
  * fix(add): better error message when adding package that only has pre-release versions
  * chore: fix serve_watch_all test
  * ci: use self-hosted mac arm runner for building on tags
  * fix(workspace): support wildcard packages
  * fix(ext/node): add `findSourceMap` to the default export of `node:module`
  * fix(fmt): do not panic for jsx ignore container followed by jsx text
  * fix(lsp): scope attribution for lazily loaded assets
  * fix(types): missing `import` permission on `PermissionOptionsObject`
  * fix(fmt): ignore file directive for YAML files
  * refactor(runtime/permissions): use concrete error types
  * chore: update dlint to v0.68.0 for internal
  * perf(lsp): don't walk coverage directory
  * fix(add): only add npm deps to package.json if it's at least as close as deno.json
  * fix: improved support for cjs and cts modules
  * chore: upgrade to rust 1.82 and LLVM 19
  * fix(cli): set `npm_config_user_agent` when running npm packages or tasks
  * fix(node): Implement `os.userInfo` properly, add missing `toPrimitive`
  * fix(ext/node): resolve exports even if parent module filename isn't present
  * fix(ext/node): convert errors from `fs.readFile/fs.readFileSync` to node format
  * fix: surface package.json location on dep parse failure
  * fix(coverage): exclude comment lines from coverage reports
  * fix(fmt): fix several HTML and components issues
  * fix(lsp): include unstable features from editor settings
  * fix: clamp smi in fast calls by default
  * fix: remove permission check in op_require_node_module_paths
  * fix(ext/node): return `this` from `http.Server.ref/unref()`
  * fix(serve): support serve hmr
  * docs(console): Update docstrings for install and uninstall
- Experiment with vendoring cargo home registry. See the documentation at
  https://github.com/openSUSE-Rust/obs-service-cargo/blob/master/README.md#cargo-vendor-home-registry

OBS-URL: https://build.opensuse.org/package/show/devel:languages:javascript/deno?expand=0&rev=224
2024-11-07 11:34:45 +00:00

161 lines
5.1 KiB
RPMSpec

#
# spec file for package deno
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2020-2024 Avindra Goolcharan <avindra@opensuse.org>
# Copyright (c) 2018-2024 the Deno authors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%global _lto_cflags %nil
Name: deno
Version: 2.0.5
Release: 0
Summary: A secure JavaScript and TypeScript runtime
License: MIT
Group: Productivity/Other
URL: https://github.com/denoland/deno
Source0: %{name}-%{version}.tar.zst
Source1: registry.tar.zst
BuildRequires: cargo-packaging
BuildRequires: clang
# needed by `libz-ng-sys` after 1.36.1
# see: https://build.opensuse.org/package/show/devel:languages:javascript/deno#comment-1808174
BuildRequires: cmake
BuildRequires: cargo >= 1.80
BuildRequires: gn
BuildRequires: lld
BuildRequires: llvm
BuildRequires: llvm-gold
BuildRequires: ninja
BuildRequires: pkgconfig
BuildRequires: python3-base
BuildRequires: rusty_v8
BuildRequires: zstd
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(gmodule-2.0)
BuildRequires: pkgconfig(gobject-2.0)
BuildRequires: pkgconfig(gthread-2.0)
BuildRequires: pkgconfig(protobuf)
# deno does not build on 32-bit archs
ExclusiveArch: x86_64 aarch64 ppc64 ppc64le s390x
# PATCH-FIX-OPENSUSE - Disable LTO (to reduce req memory)
Patch10: deno-disable-lto.patch
%package fish-completion
Summary: Fish Completion for %{name}
Group: System/Shells
Supplements: (%{name} and fish)
Requires: %{name}
Requires: fish
BuildArch: noarch
%description fish-completion
Fish command-line completion support for %{name}.
%package zsh-completion
Summary: Zsh Completion for %{name}
Group: System/Shells
Supplements: (%{name} and zsh)
Requires: %{name}
Requires: zsh
BuildArch: noarch
%description zsh-completion
Zsh command-line completion support for %{name}.
%package bash-completion
Summary: Bash Completion for %{name}
Group: System/Shells
Supplements: (%{name} and bash-completion)
Requires: %{name}
Requires: bash-completion
BuildArch: noarch
%description bash-completion
Bash command-line completion support for %{name}.
%description
A JavaScript and TypeScript platform built on V8
Deno has standard library and has features such as
a linter, a language server protocol, a code formatter and
a unit test runner.
Remote code is fetched and cached on first execution, and only
updated with the --reload flag.
%prep
%autosetup -a1 -p1 -n %{name}
# From archlinux. We are using a patched v8 from our build
unlink $PWD/rusty_v8 || true
ln -sf %{_libdir}/crates/rusty_v8 $PWD/rusty_v8
echo -e "\n[patch.crates-io]\nv8 = { path = './rusty_v8' }" >> Cargo.toml
export CARGO_HOME=$PWD/.cargo
%build
export CARGO_HOME=$PWD/.cargo
# Ensure that the clang version matches. This command came from Archlinux. Thanks.
export CLANG_VERSION=$(clang --version | grep -m1 version | sed 's/.* \([0-9]\+\).*/\1/')
export V8_FROM_SOURCE=1
export CLANG_BASE_PATH=%{_prefix}
export CC=clang
export CXX=clang++
export CFLAGS="%{optflags} -Wno-unknown-warning-option"
export CXXFLAGS="%{optflags} -Wno-unknown-warning-option"
# https://www.chromium.org/developers/gn-build-configuration
export GN_ARGS="clang_version=${CLANG_VERSION} use_lld=true enable_nacl = false blink_symbol_level = 0 v8_symbol_level = 0"
%{cargo_build}
%install
# place deno cli manually (cannot cargo install)
mkdir -p %{buildroot}%{_bindir}
export PATH="%{buildroot}%{_bindir}:${PATH}"
mkdir -p %{buildroot}%{_datadir}/bash-completion/completions
mkdir -p %{buildroot}%{_datadir}/fish/vendor_completions.d
mkdir -p %{buildroot}%{_datadir}/zsh/site-functions
cp target/release/deno %{buildroot}%{_bindir}
deno completions bash > %{buildroot}%{_datadir}/bash-completion/completions/%{name}
deno completions fish > %{buildroot}%{_datadir}/fish/vendor_completions.d/%{name}.fish
deno completions zsh > %{buildroot}%{_datadir}/zsh/site-functions/_%{name}
%check
export PATH="${PATH}:%{buildroot}%{_bindir}"
deno run tests/testdata/run/002_hello.ts
%files
%license LICENSE.md
%doc README.md
%{_bindir}/%{name}
%files bash-completion
%dir %{_datadir}/bash-completion
%dir %{_datadir}/bash-completion/completions
%{_datadir}/bash-completion/completions/%{name}
%files fish-completion
%dir %{_datadir}/fish
%dir %{_datadir}/fish/vendor_completions.d
%{_datadir}/fish/vendor_completions.d/%{name}.fish
%files zsh-completion
%dir %{_datadir}/zsh
%dir %{_datadir}/zsh/site-functions
%{_datadir}/zsh/site-functions/_%{name}
%changelog