#1 Remove uglify-js build dependency.
Merged 4 years ago by jaruga. Opened 4 years ago by jaruga.
rpms/ jaruga/rubygem-uglifier feature/bundle-uglify-js  into  master

file modified
+7 -11
@@ -6,7 +6,7 @@ 

  

  Name: rubygem-%{gem_name}

  Version: 3.2.0

- Release: 7%{?dist}

+ Release: 8%{?dist}

  Summary: Ruby wrapper for UglifyJS JavaScript compressor

  # lib/source-map.js is BSD.

  # lib/uglify.js is BSD.
@@ -29,9 +29,9 @@ 

  BuildRequires: rubygem(execjs) >= 0.3.0

  BuildRequires: rubygem(rspec)

  BuildRequires: %{_bindir}/node

- BuildRequires: uglify-js = %{uglify_js_version}

- # uglify-js does not provide single file uglify-js.js yet => let's

- # generate and bundle it here.

+ 

+ # Bundle uglify-js by the request from the Fedora Minimization team.

+ # https://bugzilla.redhat.com/show_bug.cgi?id=1828876

  Provides: bundled(uglify-js) = %{uglify_js_version}

  # There is not included dist/source-map.js yet.

  # https://bugzilla.redhat.com/show_bug.cgi?id=1358915
@@ -62,14 +62,7 @@ 

  sed -i '/files/ s|"lib/es5.js".freeze, ||' %{gem_name}.gemspec

  sed -i '/files/ s|"lib/split.js".freeze, ||' %{gem_name}.gemspec

  

- # Explicitly removing the file.

- rm lib/uglify.js

- 

  %build

- # It's nice to regenerate from system uglify.js

- # See "Use of pregenerated code" Guidelines.

- uglifyjs --self --comments /Copyright/ > lib/uglify.js

- 

  # Create the gem as gem install only works on a gem file

  gem build %{gem_name}.gemspec

  
@@ -111,6 +104,9 @@ 

  %{gem_instdir}/Rakefile

  

  %changelog

+ * Mon Apr 27 2020 Jun Aruga <jaruga@redhat.com> - 3.2.0-8

+ - Bundle uglify-js by the request from the Fedora Minimization team.

+ 

  * Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.0-7

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

  

Remove uglify-js build dependency, bundling it.

There are 2 reasons to do it.

  1. This is a request from Troy Dawson at Fedora Minimization team.
  2. The difficulty of the management. uglify-js requires nodejs-acorn, which requires nodejs-rollup, which requires nodejs-source-map-support which is orphaned now.
    https://src.fedoraproject.org/rpms/nodejs-source-map-support

I tested the following things as usual.

Why wouldn't you regenerate the file? Although it's bundled, the guidelines stand, or am I mistaken?

Because I think that uglifyjs command to regenerate the lib/uglify.js file is in uglify-js RPM we removed in this PR, we can not regenerated it in the progress of the building.

<mock-chroot> sh-5.0# rpm -qf /usr/bin/uglifyjs
uglify-js-2.8.22-9.fc32.noarch

If there is such request, it would be nice to support it by some link to ticket or ML thread or what not.

Unfortunately the request happened by the individual email. There is no link for that.
Bu if you like opening the ticket, maybe Troy @tdawson can open it.

I was debating on doing a formal bug or not. I guess that answers the question. :)
Here is the bug.

https://bugzilla.redhat.com/show_bug.cgi?id=1828876

rebased onto 407d870

4 years ago

I rebased adding the bugzilla ticket URL in the spec file.
So, please review again.

@tdawson thx, it will help once history asks :)

@jaruga I don't have other concerns.

Pull-Request has been merged by jaruga

4 years ago

Thanks for opening the ticket and reviewing. I merged it now.