SHA256
1
0
forked from pool/asar

Accepting request 1001445 from home:dziobian:gulgul-ultron:19

pack as xz, fix licence

OBS-URL: https://build.opensuse.org/request/show/1001445
OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/asar?expand=0&rev=4
This commit is contained in:
Bruno Pitrus 2022-09-06 11:49:37 +00:00 committed by Git OBS Bridge
parent 45a0c8df3f
commit 886e6dce53
4 changed files with 14 additions and 17 deletions

View File

@ -20,20 +20,19 @@ Name: asar
Version: 3.2.0
Release: 0
Summary: Creating atom-shell (electron) app packages
License: MIT and X11 and ISC and SUSE-WTFPL-2.0 and Apache-2.0 and BSD-3-Clause
License: MIT and ISC
Group: Development/Languages/NodeJS
Url: https://github.com/electron/asar
Source0: https://github.com/electron/asar/archive/refs/tags/v%{version}.tar.gz
# Created by prepare-vendor.sh
Source1: vendor.tar.zst
Source1: vendor.tar.xz
BuildArch: noarch
BuildRequires: fdupes
BuildRequires: nodejs-packaging
BuildRequires: npm
BuildRequires: zstd
%global __requires_exclude ^npm(.*)$
Provides: nodejs-asar = %{version}
%description
@ -46,7 +45,6 @@ having random access support.
%autosetup -p1 -a 1
%build
cd node_modules
npm rebuild --verbose
%install
@ -78,6 +76,9 @@ find -name '.releaserc*' -type f -print -delete
%fdupes %{buildroot}
#%%check
#We can't run tests, we don't have mocha available.
%files
%defattr(-,root,root)
%doc CHANGELOG.md README.md

View File

@ -41,7 +41,7 @@ pushd "$ASAR_PATH" || cleanup_and_exit 1
echo ">>>>>> Install npm modules"
yarn install --pure-lockfile --ignore-scripts --production
yarn install --pure-lockfile --ignore-engines --ignore-scripts --production
ret=$?
if [ $ret -ne 0 ]; then
echo "ERROR: yarn install failed"
@ -56,10 +56,7 @@ find node_modules/ -name "*.dylib" -print -delete
find node_modules/ -name "*.so" -print -delete
find node_modules/ -name "*.o" -print -delete
find node_modules/ -name "*.a" -print -delete
find node_modules/ -name "*.snyk-*.flag" -print -delete
find node_modules/ -name "builderror.log" -print -delete
find node_modules/ -name ".deps" -type d -print0 | xargs -0 rm -rvf
sed -i "/\.deps/d" node_modules/.yarn-integrity
echo '>>>>>> Remove vendored binaries'
@ -70,13 +67,12 @@ find . -type f| sponge |\
echo ">>>>>> Package vendor files"
#Use zst, it decompresses faster.
rm -f "${ASAR_PKGDIR}/vendor.tar.zst"
ZSTD_CLEVEL=19 ZSTD_NBTHREADS="$(nproc)" tar --zstd -vvcf "${ASAR_PKGDIR}/vendor.tar.zst" node_modules
rm -f "${ASAR_PKGDIR}/vendor.tar.xz"
XZ_OPT="-T$(nproc) -e9 -vv" tar -vvJcf "${ASAR_PKGDIR}/vendor.tar.xz" node_modules
if [ $? -ne 0 ]; then
cleanup_and_exit 1
fi
echo "vendor $(du -sh "${ASAR_PKGDIR}/vendor.tar.zst")"
echo "vendor $(du -sh "${ASAR_PKGDIR}/vendor.tar.xz")"
popd || cleanup_and_exit 1

3
vendor.tar.xz Normal file
View File

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

View File

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