- Add bash, fish, and zsh completion subpackages

OBS-URL: https://build.opensuse.org/package/show/devel:languages:javascript/deno?expand=0&rev=200
This commit is contained in:
Soc Virnyl Estela 2024-10-07 23:26:43 +00:00 committed by Git OBS Bridge
commit e860e7e38d
12 changed files with 4801 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

15
_constraints Normal file
View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Trying constraint per:
https://lists.opensuse.org/archives/list/factory@lists.opensuse.org/thread/G4HX77LQANTQTZMARIU4XQI4JT3RCEQ7/#G3N7PCAUIIVPO63V5QYKY6QMZK4TEP2Q
-->
<constraints>
<hardware>
<disk>
<size unit="G">18</size>
</disk>
<physicalmemory>
<size unit="G">21</size>
</physicalmemory>
</hardware>
</constraints>

28
_service Normal file
View File

@ -0,0 +1,28 @@
<!--
# vim: set syntax=xml
-->
<services>
<!--
Build Deno and rusty_v8 as completely from
scratch as we can. We pull in all the sources
through git.
TODO: migrate to obs_scm as soon as "exclude"
works there.
-->
<service name="tar_scm" mode="manual">
<param name="scm">git</param>
<param name="url">https://github.com/denoland/deno</param>
<param name="revision">c7cba4eda73e000baa6bfbce6a156f9974edee36</param>
<param name="version">2.0.0~rc10</param>
</service>
<service name="tar" mode="manual"/>
<service name="recompress" mode="manual">
<param name="file">deno-2.0.0*.tar</param>
<param name="compression">zst</param>
</service>
<service name="cargo_vendor" mode="manual">
<param name="srcdir">deno</param>
</service>
</services>

3
deno-1.44.4.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6ab2aacd0fe42b4ff6d177a75638c620df963109492613896c0895932e8941ec
size 102007712

3
deno-1.45.0.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ceaff4e42f323923ae76cf1c6336394d564e112fefa99415e75233776acd0231
size 105075132

3
deno-2.0.0~rc10.tar.zst Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2d86a702a9b58a0dfd4c05aedb53c592c70149b949fcaf2b252ce5f4003a81df
size 106781187

18
deno-disable-lto.patch Normal file
View File

@ -0,0 +1,18 @@
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -146,7 +146,6 @@ winapi = "=0.3.9"
[profile.release]
codegen-units = 1
incremental = true
-lto = true
opt-level = 'z' # Optimize for size
# Build release with debug symbols: cargo build --profile=release-with-debug
@@ -158,7 +157,6 @@ debug = true
[profile.bench]
codegen-units = 1
incremental = true
-lto = true
opt-level = 'z' # Optimize for size
# Key generation is too slow on `debug`

4541
deno.changes Normal file

File diff suppressed because it is too large Load Diff

5
deno.obsinfo Normal file
View File

@ -0,0 +1,5 @@
name: deno
version: 2.0.0~rc10
mtime: 1706983689
commit: c7cba4eda73e000baa6bfbce6a156f9974edee36

158
deno.spec Normal file
View File

@ -0,0 +1,158 @@
#
# 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/
#
Name: deno
Version: 2.0.0~rc10
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: vendor.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.68.0
BuildRequires: gn
BuildRequires: lld
BuildRequires: llvm
BuildRequires: ninja
BuildRequires: pkgconfig
BuildRequires: python3-base
BuildRequires: rusty_v8
BuildRequires: sccache
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)
%ifarch %{arm} aarch64
Patch10: deno-disable-lto.patch
%endif
%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
# 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
%{__cargo} update --offline
%build
# 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++
# 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

3
vendor.tar.zst Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:49a469b5988c25f1d652499c31c103288f4332a19fdd2665e311416bb48de756
size 97310468