From 09d4c3048e483fade86402f573678a09a697c1e8 Mon Sep 17 00:00:00 2001 From: Raboneko <119771935+raboneko@users.noreply.github.com> Date: Sun, 2 Nov 2025 00:09:48 -0700 Subject: [PATCH] add: deno (#6517) (#7029) * add: deno * completions * Update rust-deno.spec * clang * asdlfkj * mkdir? * bruh * no elvish? * %undefine __brp_mangle_shebangs * copy licernse --------- (cherry picked from commit c4ff7bfc38156e26b6f8b7f7efc5fadfc2862f62) Signed-off-by: madomado Co-authored-by: madomado --- anda/devs/deno/anda.hcl | 8 +++ anda/devs/deno/deno-fix-metadata-auto.diff | 27 ++++++++ anda/devs/deno/gcc-wrapper.sh | 6 ++ anda/devs/deno/rust-deno.spec | 71 ++++++++++++++++++++++ anda/devs/deno/update.rhai | 1 + 5 files changed, 113 insertions(+) create mode 100644 anda/devs/deno/anda.hcl create mode 100644 anda/devs/deno/deno-fix-metadata-auto.diff create mode 100755 anda/devs/deno/gcc-wrapper.sh create mode 100644 anda/devs/deno/rust-deno.spec create mode 100644 anda/devs/deno/update.rhai diff --git a/anda/devs/deno/anda.hcl b/anda/devs/deno/anda.hcl new file mode 100644 index 0000000000..6ccf5d1146 --- /dev/null +++ b/anda/devs/deno/anda.hcl @@ -0,0 +1,8 @@ +project pkg { + rpm { + spec = "rust-deno.spec" + } + labels { + large = 1 + } +} diff --git a/anda/devs/deno/deno-fix-metadata-auto.diff b/anda/devs/deno/deno-fix-metadata-auto.diff new file mode 100644 index 0000000000..067d9771cc --- /dev/null +++ b/anda/devs/deno/deno-fix-metadata-auto.diff @@ -0,0 +1,27 @@ +--- deno-2.5.2/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ deno-2.5.2/Cargo.toml 2025-09-25T08:45:18.476444+00:00 +@@ -650,24 +650,3 @@ + [target."cfg(unix)".dependencies.shell-escape] + version = "=0.1.5" + +-[target."cfg(windows)".dependencies.deno_subprocess_windows] +-version = "0.12.0" +- +-[target."cfg(windows)".dependencies.winapi] +-version = "=0.3.9" +-features = [ +- "knownfolders", +- "mswsock", +- "objbase", +- "shlobj", +- "tlhelp32", +- "winbase", +- "winerror", +- "winsock2", +-] +- +-[target."cfg(windows)".build-dependencies.winapi] +-version = "=0.3.9" +- +-[target."cfg(windows)".build-dependencies.winres] +-version = "=0.1.12" diff --git a/anda/devs/deno/gcc-wrapper.sh b/anda/devs/deno/gcc-wrapper.sh new file mode 100755 index 0000000000..f28bf41905 --- /dev/null +++ b/anda/devs/deno/gcc-wrapper.sh @@ -0,0 +1,6 @@ +#!/bin/bash +if [[ " $@ " =~ "jitterentropy" ]]; then + exec gcc $(echo "$@" | sed 's/-O[0-9s]//g') +else + exec gcc "$@" +fi diff --git a/anda/devs/deno/rust-deno.spec b/anda/devs/deno/rust-deno.spec new file mode 100644 index 0000000000..04071318cd --- /dev/null +++ b/anda/devs/deno/rust-deno.spec @@ -0,0 +1,71 @@ +%undefine __brp_mangle_shebangs +# Generated by rust2rpm 27 +%bcond check 0 + +%global crate deno + +Name: rust-deno +Version: 2.5.2 +Release: %autorelease +Summary: Deno executable + +License: MIT +URL: https://crates.io/crates/deno +Source: %{crates_source} +Source1: https://raw.githubusercontent.com/denoland/deno/refs/tags/v%version/LICENSE.md +Source2: gcc-wrapper.sh +# Automatically generated patch to strip dependencies and normalize metadata +Patch: deno-fix-metadata-auto.diff + +BuildRequires: cargo-rpm-macros >= 24 +BuildRequires: anda-srpm-macros +BuildRequires: protobuf-compiler +BuildRequires: llvm17-devel +BuildRequires: python3 +BuildRequires: cmake +BuildRequires: gcc +BuildRequires: clang +BuildRequires: clang-devel + +%global _description %{expand: +Provides the deno executable.} + +%description %{_description} + +%package -n %{crate} +Summary: %{summary} +License: ((Apache-2.0 OR MIT) AND BSD-3-Clause) AND ((MIT OR Apache-2.0) AND Unicode-DFS-2016) AND (0BSD OR MIT OR Apache-2.0) AND Apache-2.0 AND (Apache-2.0 AND ISC) AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR BSL-1.0 OR MIT) AND (Apache-2.0 OR ISC OR MIT) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND BSD-2-Clause AND (BSD-2-Clause OR Apache-2.0 OR MIT) AND BSD-3-Clause AND (BSD-3-Clause OR MIT) AND BSL-1.0 AND CC0-1.0 AND ISC AND (ISC AND (Apache-2.0 OR ISC)) AND (ISC AND (Apache-2.0 OR ISC) AND OpenSSL) AND MIT AND (MIT AND BSD-3-Clause) AND (MIT OR Apache-2.0) AND (MIT OR Apache-2.0 OR BSD-1-Clause) AND (MIT OR Apache-2.0 OR LGPL-2.1-or-later) AND (MIT OR Apache-2.0 OR Zlib) AND (MIT OR Zlib OR Apache-2.0) AND MPL-2.0 AND MPL-2.0+ AND Unicode-3.0 AND (Unlicense OR MIT) AND Zlib AND (Zlib OR Apache-2.0 OR MIT) +# LICENSE.dependencies contains a full license breakdown + +%description -n %{crate} %{_description} + +%files -n %{crate} +%license LICENSE.md +%license LICENSE.dependencies +%doc README.md +%{_bindir}/deno + +%pkg_completion -Bfzn %crate + +%prep +%autosetup -n %{crate}-%{version} -p1 +%cargo_prep_online + +cp %{S:1} . +cp %{S:2} gcc + +%global __cc %_builddir/%buildsubdir/gcc +sed '/\[env\]/a CC="%__cc"' -i .cargo/config + +%build +%{cargo_license_summary_online} +%{cargo_license_online} > LICENSE.dependencies +%{cargo_build} --locked + +%install +%crate_install_bin +mkdir -p %buildroot{%bash_completions_dir,%elvish_completions_dir,%fish_completions_dir,%zsh_completions_dir} +target/rpm/deno completions bash > %buildroot%bash_completions_dir/deno +%dnl target/rpm/deno completions elvish > %buildroot%elvish_completions_dir/deno.elv +target/rpm/deno completions fish > %buildroot%fish_completions_dir/deno.fish +target/rpm/deno completions zsh > %buildroot%zsh_completions_dir/_deno diff --git a/anda/devs/deno/update.rhai b/anda/devs/deno/update.rhai new file mode 100644 index 0000000000..a564f8eee7 --- /dev/null +++ b/anda/devs/deno/update.rhai @@ -0,0 +1 @@ +rpm.version(crates("deno"));