From bfb46444bdc95c901c7b48bdc008eff5605f83ec Mon Sep 17 00:00:00 2001 From: jeremy Date: Mon, 1 Aug 2022 16:23:45 +0000 Subject: [PATCH] Update to rake-compiler 1.2.0 Remove use of SUBST_CMD, no longer needed. Remove test code, as tests now have dependencies not in ports. Remove cross compiling support as mingw was removed last year. Add patch to remove chown/chgrp use when not running as root, similar to how Ruby is patched. --- devel/ruby-rake-compiler/Makefile | 15 +---- devel/ruby-rake-compiler/distinfo | 4 +- .../patches/patch-lib_rake_extensiontask_rb | 60 ++++++++++++------- .../patches/patch-tasks_bin_cross-ruby_rake | 25 -------- devel/ruby-rake-compiler/pkg/PLIST | 9 ++- 5 files changed, 46 insertions(+), 67 deletions(-) delete mode 100644 devel/ruby-rake-compiler/patches/patch-tasks_bin_cross-ruby_rake diff --git a/devel/ruby-rake-compiler/Makefile b/devel/ruby-rake-compiler/Makefile index 5c04be76b19..c7251542991 100644 --- a/devel/ruby-rake-compiler/Makefile +++ b/devel/ruby-rake-compiler/Makefile @@ -1,10 +1,9 @@ COMMENT = build and package Ruby extensions using Rake as glue -DISTNAME = rake-compiler-0.7.9 -REVISION = 6 +DISTNAME = rake-compiler-1.2.0 CATEGORIES = devel -HOMEPAGE = https://github.com/luislavena/rake-compiler +HOMEPAGE = https://github.com/rake-compiler/rake-compiler MAINTAINER = Jeremy Evans @@ -15,14 +14,4 @@ MODULES = lang/ruby CONFIGURE_STYLE = ruby gem -pre-configure: - ${SUBST_CMD} -DMAKE_PROGRAM=${MAKE_PROGRAM} \ - ${WRKSRC}/lib/rake/extensiontask.rb \ - ${WRKSRC}/tasks/bin/cross-ruby.rake - rm ${WRKSRC}/lib/rake/extensiontask.rb.beforesubst \ - ${WRKSRC}/tasks/bin/cross-ruby.rake.beforesubst - -TEST_DEPENDS = devel/ruby-isolate,${MODRUBY_FLAVOR} -MODRUBY_TEST = rake rspec - .include diff --git a/devel/ruby-rake-compiler/distinfo b/devel/ruby-rake-compiler/distinfo index 6b7db0aac02..6d0c344b373 100644 --- a/devel/ruby-rake-compiler/distinfo +++ b/devel/ruby-rake-compiler/distinfo @@ -1,2 +1,2 @@ -SHA256 (rake-compiler-0.7.9.gem) = iEhKAhaDiF6mUqeUKaC8hw4gWGvdAGo43IzYLsckpqw= -SIZE (rake-compiler-0.7.9.gem) = 31232 +SHA256 (rake-compiler-1.2.0.gem) = 4CvPVtLz2Ay4eLdgJo6PE9yOQlHJ+6CA3td5sWeub/U= +SIZE (rake-compiler-1.2.0.gem) = 38912 diff --git a/devel/ruby-rake-compiler/patches/patch-lib_rake_extensiontask_rb b/devel/ruby-rake-compiler/patches/patch-lib_rake_extensiontask_rb index 6eeba1d1c39..07b83fa224c 100644 --- a/devel/ruby-rake-compiler/patches/patch-lib_rake_extensiontask_rb +++ b/devel/ruby-rake-compiler/patches/patch-lib_rake_extensiontask_rb @@ -1,27 +1,43 @@ -Include the mingw directory in the PATH if cross compiling. +Do not try to chown/chgrp when installing unless running +as root. This is done for the same reasons as the patch for +lib/rubygems/ext/ext_conf_builder.rb in the Ruby port. Don't have it accidently use gmake, because the makefiles created can use BSD make extensions. ---- lib/rake/extensiontask.rb.orig Wed Dec 31 16:00:00 1969 -+++ lib/rake/extensiontask.rb Wed Nov 30 04:25:41 2011 -@@ -70,6 +70,8 @@ Rerun `rake` under MRI Ruby 1.8.x/1.9.x to cross/nativ - # only define cross platform functionality when enabled - return unless @cross_compile - -+ ENV['PATH'] = "${LOCALBASE}/mingw32/bin:#{ENV['PATH']}" -+ - if cross_platform.is_a?(Array) then - cross_platform.each { |platf| define_cross_platform_tasks(platf) } - else -@@ -359,9 +361,7 @@ Rerun `rake` under MRI Ruby 1.8.x/1.9.x to cross/nativ - if RUBY_PLATFORM =~ /mswin/ then - 'nmake' - else -- ENV['MAKE'] || %w[gmake make].find { |c| -- system("#{c} -v >> #{dev_null} 2>&1") -- } -+ ENV['MAKE'] || 'make' - end +Index: lib/rake/extensiontask.rb +--- lib/rake/extensiontask.rb.orig ++++ lib/rake/extensiontask.rb +@@ -157,7 +157,9 @@ module Rake + task "copy:#{@name}:#{platf}:#{ruby_ver}" => [lib_path, tmp_binary_path, "#{tmp_path}/Makefile"] do + # install in lib for native platform only + unless for_platform +- sh "#{make} install target_prefix=", chdir: tmp_path ++ command = "#{make} install target_prefix=" ++ command += " INSTALL_PROG='/usr/bin/install -c -m 0755'" unless Process.uid == 0 ++ sh command, chdir: tmp_path + end end - @make + # copy binary from temporary location to staging directory +@@ -502,20 +504,7 @@ Java extension should be preferred. + end + + def make +- unless @make +- @make = +- if RUBY_PLATFORM =~ /mswin/ then +- 'nmake' +- else +- ENV['MAKE'] || find_make +- end +- end +- +- unless @make +- raise "Couldn't find a suitable `make` tool. Use `MAKE` env to set an alternative." +- end +- +- @make ++ @make ||= ENV['MAKE'] || 'make' + end + + def find_make diff --git a/devel/ruby-rake-compiler/patches/patch-tasks_bin_cross-ruby_rake b/devel/ruby-rake-compiler/patches/patch-tasks_bin_cross-ruby_rake deleted file mode 100644 index d052f6cff2c..00000000000 --- a/devel/ruby-rake-compiler/patches/patch-tasks_bin_cross-ruby_rake +++ /dev/null @@ -1,25 +0,0 @@ -Include the mingw directory in the PATH as this file is only used -for cross-compilation. - -Add the j flag to tar as all downloaded files are .tar.bz2. - ---- tasks/bin/cross-ruby.rake.orig Wed Dec 31 16:00:00 1969 -+++ tasks/bin/cross-ruby.rake Wed Nov 30 04:23:04 2011 -@@ -17,6 +17,8 @@ - # for cross-compilation. - # - -+ENV['PATH'] = "${LOCALBASE}/mingw32/bin:#{ENV['PATH']}" -+ - require 'rake' - require 'rake/clean' - -@@ -84,7 +86,7 @@ end - source_file = RUBY_SOURCE ? RUBY_SOURCE.split('/').last : "#{RUBY_CC_VERSION}.tar.bz2" - file "#{USER_HOME}/sources/#{RUBY_CC_VERSION}" => ["#{USER_HOME}/sources/#{source_file}"] do |t| - chdir File.dirname(t.name) do -- t.prerequisites.each { |f| sh "tar xf #{File.basename(f)}" } -+ t.prerequisites.each { |f| sh "tar jxf #{File.basename(f)}" } - end - end - diff --git a/devel/ruby-rake-compiler/pkg/PLIST b/devel/ruby-rake-compiler/pkg/PLIST index 9e31f757a7d..ffca41f3583 100644 --- a/devel/ruby-rake-compiler/pkg/PLIST +++ b/devel/ruby-rake-compiler/pkg/PLIST @@ -1,11 +1,12 @@ ${GEM_BIN}/rake-compiler${GEM_BIN_SUFFIX} ${GEM_LIB}/cache/${DISTNAME}.gem ${GEM_LIB}/gems/${DISTNAME}/ -${GEM_LIB}/gems/${DISTNAME}/History.txt -${GEM_LIB}/gems/${DISTNAME}/Isolate +${GEM_LIB}/gems/${DISTNAME}/Gemfile +${GEM_LIB}/gems/${DISTNAME}/History.md ${GEM_LIB}/gems/${DISTNAME}/LICENSE.txt -${GEM_LIB}/gems/${DISTNAME}/README.rdoc +${GEM_LIB}/gems/${DISTNAME}/README.md ${GEM_LIB}/gems/${DISTNAME}/Rakefile +${GEM_LIB}/gems/${DISTNAME}/appveyor.yml ${GEM_LIB}/gems/${DISTNAME}/bin/ ${GEM_LIB}/gems/${DISTNAME}/bin/rake-compiler ${GEM_LIB}/gems/${DISTNAME}/cucumber.yml @@ -52,7 +53,5 @@ ${GEM_LIB}/gems/${DISTNAME}/tasks/bootstrap.rake ${GEM_LIB}/gems/${DISTNAME}/tasks/common.rake ${GEM_LIB}/gems/${DISTNAME}/tasks/cucumber.rake ${GEM_LIB}/gems/${DISTNAME}/tasks/gem.rake -${GEM_LIB}/gems/${DISTNAME}/tasks/news.rake -${GEM_LIB}/gems/${DISTNAME}/tasks/release.rake ${GEM_LIB}/gems/${DISTNAME}/tasks/rspec.rake ${GEM_LIB}/specifications/${DISTNAME}.gemspec