commit b12e1bbf4efced5c12df0b8d1bd67f7bb87be48d19c31d06442b59d8d2e892e4 Author: Avindra Goolcharan Date: Tue Jan 26 16:33:21 2021 +0000 Accepting request 866956 from home:avindra:devel:languages:javascript +jstime OBS-URL: https://build.opensuse.org/request/show/866956 OBS-URL: https://build.opensuse.org/package/show/devel:languages:javascript/jstime?expand=0&rev=1 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -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 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/_service b/_service new file mode 100644 index 0000000..ae7b895 --- /dev/null +++ b/_service @@ -0,0 +1,116 @@ + + + + + + git + https://github.com/denoland/rusty_v8 + v0.16.0 + 0.16.0 + .github + + + *.settings + *.txt + AUTHORS + build/android + build/chromeos + build/fuchsia + + + + + + + + buildtools/checkdeps + buildtools/clang_format + buildtools/third_party/libc++/trunk/benchmarks + buildtools/third_party/libc++/trunk/docs + buildtools/third_party/libc++/trunk/lib + buildtools/third_party/libc++/trunk/test + buildtools/third_party/libc++/trunk/utils + buildtools/third_party/libc++/trunk/www + buildtools/third_party/libc++abi/trunk/test + v8/ChangeLog + v8/benchmarks/ + v8/docs/ + v8/samples + + + + v8/tools/*.js + v8/tools/*.mjs + v8/tools/*.html + v8/tools/turbolizer + v8/tools/clusterfuzz + + + + + + + *.tar + xz + + + diff --git a/jstime-0.21.0.tar.gz b/jstime-0.21.0.tar.gz new file mode 100644 index 0000000..0470ef5 --- /dev/null +++ b/jstime-0.21.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:668b4b7f1f1018a465a9d0a155334e1844899c196d8d24c00480bf342177a450 +size 32313 diff --git a/jstime.changes b/jstime.changes new file mode 100644 index 0000000..ed4ef7f --- /dev/null +++ b/jstime.changes @@ -0,0 +1,11 @@ +------------------------------------------------------------------- +Wed Jan 20 15:00:39 UTC 2021 - Avindra Goolcharan + +- update to v0.21.0: + * rusty_v8 updated to 0.16.0 +- enable binary stripping + +------------------------------------------------------------------- +Sun Jan 3 21:48:14 UTC 2021 - Avindra Goolcharan + +- initial package at v0.20.1, based mostly on the deno build diff --git a/jstime.spec b/jstime.spec new file mode 100644 index 0000000..226d931 --- /dev/null +++ b/jstime.spec @@ -0,0 +1,73 @@ +# +# spec file for package jstime +# +# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2020-2021 Avindra Goolcharan +# +# 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: jstime +Version: 0.21.0 +Release: 0 +Summary: Another JavaScript runtime based on rusty_v8 +License: MIT +Group: Productivity/Other +URL: https://github.com/jstime/jstime +Source0: https://github.com/jstime/jstime/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz +Source1: vendor.tar.xz +Source99: revendor_source.sh +BuildRequires: clang +BuildRequires: gn +BuildRequires: lld +BuildRequires: llvm +BuildRequires: ninja +BuildRequires: pkgconfig +BuildRequires: python +BuildRequires: python2-setuptools +BuildRequires: rust-packaging +BuildRequires: pkgconfig(glib-2.0) +BuildRequires: pkgconfig(gmodule-2.0) +BuildRequires: pkgconfig(gobject-2.0) +BuildRequires: pkgconfig(gthread-2.0) +# deno does not build on 32-bit archs +ExclusiveArch: x86_64 aarch64 ppc64 ppc64le s390x + +%description +A JavaScript runtime built on rusty_v8 (from deno). + +%prep +%autosetup -a1 +%define cargo_registry $(pwd)/vendor +%{cargo_prep} + +%build +export V8_FROM_SOURCE=1 +export CLANG_BASE_PATH=%{_prefix} +# https://www.chromium.org/developers/gn-build-configuration +export GN_ARGS="enable_nacl = false blink_symbol_level = 0" +# enable binary stripping +export RUSTFLAGS="%{__global_rustflags} -Clink-arg=-s" +%{cargo_build} + +%install +# place jstime cli manually (cannot cargo install) +mkdir -p %{buildroot}%{_bindir} +cp target/release/jstime %{buildroot}%{_bindir} + +%files +%license LICENSE +%doc README.md +%{_bindir}/%{name} + +%changelog diff --git a/revendor_source.sh b/revendor_source.sh new file mode 100644 index 0000000..69829e4 --- /dev/null +++ b/revendor_source.sh @@ -0,0 +1,64 @@ +#!/bin/sh +set -euo pipefail + +# packaging helper to workaround: +# https://github.com/denoland/rusty_v8/issues/566 + +# the defacto output from "cargo vendor" is +# not useful as it is missing files. this +# script merges rusty_v8 into place from source + +# output is a single, merged vendor tarball + +wd="$(mktemp -d /tmp/revendor.XXXXX)" + +# take what we need into the build +cp rusty_v8*xz $wd +cp vendor*xz $wd + +cd $wd + +echo -n "Extracting vendor..." +tar xf vendor*xz +echo "done" + +echo -n "Extracting rusty_v8..." +tar xf rusty*xz \ + --exclude="Cargo.toml" \ + --exclude="Cargo.lock" +echo " done" + +# take vendored Cargo toml and lock which +# can still be used +cp vendor/rusty_v8/{Cargo.*,.cargo*} . + + +# get rid of everything else +rm -fr vendor/rusty_v8 + +# drop version prefix +target=$(find . -name "rusty_v8-*" -type d) +mv $target rusty_v8 + +# insert proper files +mv Cargo.* .cargo* rusty_v8 +echo "Check final rusty_v8 root:" +ls -la rusty_v8 +mv rusty_v8 vendor + +# extra: workaround winapi bloat +# by ejecting it from the build +# +# https://github.com/rust-lang/cargo/issues/7058 +echo -n "Pruning winapi bloat... " +rm -fr vendor/winapi*gnu*/lib/*.a +echo "done" + +# remake tarball +echo -n "Compressing archive... " +tar -cf - vendor/ | xz -6 -c - > vendor-merged.tar.xz +echo "done" + +echo "Inspect the tarball and replace the" +echo "existing one if it's ok. Should be under 30MB." +ls -lh vendor-merged.tar.xz diff --git a/vendor.tar.xz b/vendor.tar.xz new file mode 100644 index 0000000..5dcac9b --- /dev/null +++ b/vendor.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5e5e1df7f59c1a2ed67cc1991661e57f30e503de85bd44a9a8c4fa6345872d70 +size 20765396