Codebase list ruby-fxruby / run/867a9ad8-16f3-49f2-8da1-08141b9b00dd/main debian / patches / installation-with-rakefile.patch
run/867a9ad8-16f3-49f2-8da1-08141b9b00dd/main

Tree @run/867a9ad8-16f3-49f2-8da1-08141b9b00dd/main (Download .tar.gz)

installation-with-rakefile.patch @run/867a9ad8-16f3-49f2-8da1-08141b9b00dd/mainraw · history · blame

From: Sophie Brun <[email protected]>
Date: Tue, 8 Mar 2022 12:15:51 +0100
Subject: Installation with Rakefile

Last-Update: 2021-03-08
dh_auto_install doesn't work because any task for install are defined in
Rakefile. Add task :install to use dh_ruby correctly in build.
---
 Rakefile | 138 ++++++++++++++++++++++++++++++++++-----------------------------
 1 file changed, 74 insertions(+), 64 deletions(-)

Index: ruby-fxruby.git/Rakefile
===================================================================
--- ruby-fxruby.git.orig/Rakefile
+++ ruby-fxruby.git/Rakefile
@@ -7,67 +7,67 @@ require 'bundler/gem_helper'
 require './lib/fox16/version.rb'
 
 
-class FoxGemHelper < Bundler::GemHelper
-  attr_accessor :cross_platforms
-
-  def install
-    super
-
-    task "release:guard_clean" => ["release:update_history"]
-
-    task "release:update_history" do
-      update_history
-    end
-
-    task "release:rubygem_push" => ["gem:windows"]
-  end
-
-  def hfile
-    "History.md"
-  end
-
-  def headline
-    '([^\w]*)(\d+\.\d+\.\d+(?:\.\w+)?)([^\w]+)([2Y][0Y][0-9Y][0-9Y]-[0-1M][0-9M]-[0-3D][0-9D])([^\w]*|$)'
-  end
-
-  def reldate
-    Time.now.strftime("%Y-%m-%d")
-  end
-
-  def update_history
-    hin = File.read(hfile)
-    hout = hin.sub(/#{headline}/) do
-      raise "#{hfile} isn't up-to-date for version #{version}" unless $2==version.to_s
-      $1 + $2 + $3 + reldate + $5
-    end
-    if hout != hin
-      Bundler.ui.confirm "Updating #{hfile} for release."
-      File.write(hfile, hout)
-      Rake::FileUtilsExt.sh "git", "commit", hfile, "-m", "Update release date in #{hfile}"
-    end
-  end
-
-  def tag_version
-    Bundler.ui.confirm "Tag release with annotation:"
-    m = File.read(hfile).match(/(?<annotation>#{headline}.*?)#{headline}/m) || raise("Unable to find release notes in #{hfile}")
-    Bundler.ui.info(m[:annotation].gsub(/^/, "    "))
-    IO.popen(["git", "tag", "--file=-", version_tag], "w") do |fd|
-      fd.write m[:annotation]
-    end
-    yield if block_given?
-  rescue
-    Bundler.ui.error "Untagging #{version_tag} due to error."
-    sh_with_code "git tag -d #{version_tag}"
-    raise
-  end
-
-  def rubygem_push(path)
-    cross_platforms.each do |ruby_platform|
-      super(path.gsub(/\.gem\z/, "-#{ruby_platform}.gem"))
-    end
-    super(path)
-  end
-end
+#class FoxGemHelper < Bundler::GemHelper
+#  attr_accessor :cross_platforms
+#
+#  def install
+#    super
+#
+#    task "release:guard_clean" => ["release:update_history"]
+#
+#    task "release:update_history" do
+#      update_history
+#    end
+#
+#    task "release:rubygem_push" => ["gem:windows"]
+#  end
+#
+#  def hfile
+#    "History.md"
+#  end
+#
+#  def headline
+#    '([^\w]*)(\d+\.\d+\.\d+(?:\.\w+)?)([^\w]+)([2Y][0Y][0-9Y][0-9Y]-[0-1M][0-9M]-[0-3D][0-9D])([^\w]*|$)'
+#  end
+#
+#  def reldate
+#    Time.now.strftime("%Y-%m-%d")
+#  end
+#
+#  def update_history
+#    hin = File.read(hfile)
+#    hout = hin.sub(/#{headline}/) do
+#      raise "#{hfile} isn't up-to-date for version #{version}" unless $2==version.to_s
+#      $1 + $2 + $3 + reldate + $5
+#    end
+#    if hout != hin
+#      Bundler.ui.confirm "Updating #{hfile} for release."
+#      File.write(hfile, hout)
+#      Rake::FileUtilsExt.sh "git", "commit", hfile, "-m", "Update release date in #{hfile}"
+#    end
+#  end
+
+#  def tag_version
+#    Bundler.ui.confirm "Tag release with annotation:"
+#    m = File.read(hfile).match(/(?<annotation>#{headline}.*?)#{headline}/m) || raise("Unable to find release notes in #{hfile}")
+#    Bundler.ui.info(m[:annotation].gsub(/^/, "    "))
+#    IO.popen(["git", "tag", "--file=-", version_tag], "w") do |fd|
+#      fd.write m[:annotation]
+#    end
+#    yield if block_given?
+#  rescue
+#    Bundler.ui.error "Untagging #{version_tag} due to error."
+#    sh_with_code "git tag -d #{version_tag}"
+#    raise
+#  end
+#
+#  def rubygem_push(path)
+#    cross_platforms.each do |ruby_platform|
+#      super(path.gsub(/\.gem\z/, "-#{ruby_platform}.gem"))
+#    end
+#    super(path)
+#  end
+#end
 
 # Some constants we'll need
 LIBFXSCINTILLA_VERSION            = ENV['LIBFXSCINTILLA_VERSION'] || '2.28.0'
@@ -85,7 +85,17 @@ task :test => [:compile] do
   sh "ruby -w -W2 -Ilib test/TS_All.rb -v"
 end
 
-task :gem => ["ext/fox16_c/extconf.rb", "fxruby:configure", :build]
+task :default => ["ext/fox16_c/extconf.rb", "fxruby:configure"]
+
+desc "Install gem"
+task :install => :compile
+
+# The "docs" task created by Hoe assumes that we want to run RDoc
+# over everything under the "lib" and "ext" subdirectories.
+# We need to go back and tell it to skip the stuff under ext.
+# rdoc_target = Rake::Task['docs'].prerequisites.first
+# rdoc_files = Rake::Task[rdoc_target].prerequisites
+# rdoc_files.reject! {|x| x == "ext/fox16_c" }
 
 
 gem_spec = Bundler.load_gemspec('fxruby.gemspec')
@@ -140,8 +150,8 @@ ext_task = Rake::ExtensionTask.new("fox1
     end
   end
 
-  FoxGemHelper.install_tasks
-  Bundler::GemHelper.instance.cross_platforms = ext.cross_platform
+  #FoxGemHelper.install_tasks
+  #Bundler::GemHelper.instance.cross_platforms = ext.cross_platform
 end
 
 namespace :gem do