Skip to content

Commit

Permalink
Rename RubyBundle to RubyInstaller+MSYS
Browse files Browse the repository at this point in the history
As discussed in PR #42 .

This shortens the package directory names to ri and ri-msys because
InnoSetup fails otherwise to find iss files due to Windows MAX_PATH
limitations to 260 characters.

The name ri+msys doesn't work as a rake task, so that ri-msys is used
there.
  • Loading branch information
larskanis committed Mar 29, 2018
1 parent 63bbf32 commit 72b0f7f
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 23 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ include RubyInstaller::Build::Utils
task :gem => :build

# Forward package build tasks to the sub Rakefiles.
%w[rubyinstaller rubybundle].each do |packname|
%w[ri ri-msys].each do |packname|
namespace packname do |ns|
Rake::TaskManager.record_task_metadata = true
Rake.load_rakefile "packages/#{packname}/Rakefile"
Expand Down
22 changes: 11 additions & 11 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ build_script:
- c:/msys64/%MSYSTEM%/bin/gcc.exe --version

# Build the installer
- rake rubyinstaller:ruby-%target_ruby%-%arch%
- rake ri:ruby-%target_ruby%-%arch%

# Reuse installed ruby for RubyBundle
- c:/msys64/usr/bin/mkdir -p packages/rubybundle/recipes/
- c:/msys64/usr/bin/cp -a packages/rubyinstaller/recipes/unpack packages/rubybundle/recipes/
# Reuse installed ruby for RubyInstaller+MSYS
- c:/msys64/usr/bin/mkdir -p packages/ri-msys/recipes/
- c:/msys64/usr/bin/cp -a packages/ri/recipes/unpack packages/ri-msys/recipes/
# Remove broken pkg files from cache
- c:/msys64/usr/bin/rm -f c:/msys64/var/cache/pacman/pkg/{autoconf,automake,bash-completion,ca-certificates}*
# Build the rubybundle installer
- rake rubybundle:ruby-%target_ruby%-%arch%:installer-inno
# Build the RubyInstaller+MSYS installer
- rake ri-msys:ruby-%target_ruby%-%arch%:installer-inno

test_script:
# Run the built Ruby installer and install to c:/ri2-ruby
- ruby -e "Dir['packages/rubyinstaller/recipes/installer-inno/rubyinstaller-%target_ruby%*-%arch%.exe'].each{|f| system(f, '/verysilent', '/dir=c:/ri2-ruby', '/tasks=assocfiles,modpath,defaultutf8')}"
- ruby -e "Dir['packages/ri/recipes/installer-inno/rubyinstaller-%target_ruby%*-%arch%.exe'].each{|f| system(f, '/verysilent', '/dir=c:/ri2-ruby', '/tasks=assocfiles,modpath,defaultutf8')}"
# Activate the environment variables set by the installer, but exclude
# git's /usr/bin, because it conflicts with one RubyInstaller test.
- ps: $env:PATH = [Environment]::GetEnvironmentVariable("PATH","Machine") -replace ";C:\\Program Files\\Git\\usr\\bin" -replace ";C:\\Ruby193\\bin"
Expand Down Expand Up @@ -62,15 +62,15 @@ test_script:
# Run upload to github (only on tag builds)
- set DEPLOY_TAG=%APPVEYOR_REPO_TAG_NAME%
- IF "%target_ruby%" EQU "head" (SET DEPLOY_TAG=rubyinstaller-head)
- rake release:appveyor_upload -- packages/rubyinstaller/recipes/installer-inno/%DEPLOY_TAG%*-%arch%.exe packages/rubyinstaller/recipes/archive-7z/%DEPLOY_TAG%*-%arch%.7z packages/rubybundle/recipes/installer-inno/ruby*-%target_ruby%*-%arch%.exe
- rake release:appveyor_upload -- packages/ri/recipes/installer-inno/%DEPLOY_TAG%*-%arch%.exe packages/ri/recipes/archive-7z/%DEPLOY_TAG%*-%arch%.7z packages/ri-msys/recipes/installer-inno/ruby*-%target_ruby%*-%arch%.exe

# Provide the rubyinstaller.exe files for download
artifacts:
- path: packages/rubyinstaller/recipes/installer-inno/ruby*-$(target_ruby)*-$(arch).exe
- path: packages/ri/recipes/installer-inno/ruby*-$(target_ruby)*-$(arch).exe
name: Executable installer
- path: packages/rubyinstaller/recipes/archive-7z/ruby*-$(target_ruby)*-$(arch).7z
- path: packages/ri/recipes/archive-7z/ruby*-$(target_ruby)*-$(arch).7z
name: Plain archive file
- path: packages/rubybundle/recipes/installer-inno/ruby*-$(target_ruby)*-$(arch).exe
- path: packages/ri-msys/recipes/installer-inno/ruby*-$(target_ruby)*-$(arch).exe
name: Executable installer with MYS2

environment:
Expand Down
4 changes: 1 addition & 3 deletions packages/rubybundle/Rakefile → packages/ri-msys/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class RubyPackage < RubyInstaller::Build::Openstruct
super

self.rubyver, self.pkgrel = packagever.split("-", 2)
self.packagename = "rubybundle"
self.packagename = "rubyinstaller+msys"
self.rubyver2 = packagever=='head' ? "2.6" : rubyver[/^\d+\.\d+/]

self.install_gems = %w[]
Expand All @@ -23,15 +23,13 @@ class RubyPackage < RubyInstaller::Build::Openstruct
self.msysdir = "msys64"
self.mingwdir = "mingw64"
self.default_instdir = "C:\\Ruby#{rubyver2.gsub(".","")}-x64"
self.name = "rubybundle-#{rubyver}-x64"
when 'x86'
self.pacman_arch = "mingw-w64-i686"
self.ruby_arch = "i386-mingw32"
self.msys_arch = "i686"
self.msysdir = "msys32"
self.mingwdir = "mingw32"
self.default_instdir = "C:\\Ruby#{rubyver2.gsub(".","")}"
self.name = "rubybundle-#{rubyver}-x86"
else
raise "invalid arch #{arch}"
end
Expand Down
2 changes: 0 additions & 2 deletions packages/rubyinstaller/Rakefile → packages/ri/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ class RubyPackage < RubyInstaller::Build::Openstruct
self.ruby_arch = "x64-mingw32"
self.mingwdir = "mingw64"
self.default_instdir = "C:\\Ruby#{rubyver2.gsub(".","")}-x64"
self.name = "rubyinstaller-#{rubyver}-x64"
when 'x86'
self.pacman_arch = "mingw-w64-i686"
self.ruby_arch = "i386-mingw32"
self.mingwdir = "mingw32"
self.default_instdir = "C:\\Ruby#{rubyver2.gsub(".","")}"
self.name = "rubyinstaller-#{rubyver}-x86"
else
raise "invalid arch #{arch}"
end
Expand Down
2 changes: 1 addition & 1 deletion recipes/installer-inno/60-generate-iss-file.rake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
iss_files = ovl_glob("#{thisdir}/*.iss*").map{|f| ovl_expand_file(f) }

# Compile the iss file from ERB template
self.iss_compiler = RubyInstaller::Build::ErbCompiler.new(File.join(thisdir, "rubyinstaller.iss.erb"), File.join(thisdir, "#{package.name}.iss"))
self.iss_compiler = RubyInstaller::Build::ErbCompiler.new(File.join(thisdir, "rubyinstaller.iss.erb"), File.join(thisdir, "#{package.packagenameverarch}.iss"))
file iss_compiler.result_filename => [iss_compiler.erb_filename_abs] + iss_files - [iss_compiler.result_filename] do |t|
puts "erb #{t.name}"
iss_compiler.write_result(self)
Expand Down
8 changes: 4 additions & 4 deletions recipes/installer-inno/rubyinstaller.iss.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@
; License: Modified BSD License

<% require "etc" %>
<% rubybundle = package.respond_to?(:msysdir) %>
<% with_msys = package.respond_to?(:msysdir) %>

#define RubyVersion <%=q package.rubyver %>
#define PackageRelease <%=q package.pkgrel %>
#define RubyBuildPlatform <%=q package.ruby_arch %>

; Build Installer details using above values
#define InstallerName "Ruby " + <%=q package.packagever %> + "-" + <%=q package.arch %> + "<%= " with MSYS2" if rubybundle %>"
#define InstallerName "Ruby " + <%=q package.packagever %> + "-" + <%=q package.arch %> + "<%= " with MSYS2" if with_msys %>"
#define InstallerPublisher "RubyInstaller Team"
#define InstallerHomepage "http://rubyinstaller.org"

#define CurrentYear GetDateTimeString('yyyy', '', '')
#define PackageBaseId "MRI"

#define MsysDir <%=q( rubybundle ? package.msysdir : '' )%>
#define MsysDir <%=q( with_msys ? package.msysdir : '' )%>

[Setup]
DefaultDirName=<%=q package.default_instdir %>
Expand Down Expand Up @@ -159,7 +159,7 @@ Name: {group}\{cm:UninstallProgram,{#InstallerName}}; Filename: {uninstallexe}
[Components]
Name: "ruby"; Description: "Ruby-<%= package.rubyver %> base files"; Types: custom; Flags: fixed

Name: "msys2"; Description: "MSYS2 development toolchain <%= Time.now.strftime("%Y-%m-%d") %>"; Types: <%= "custom" if rubybundle %>; Flags: disablenouninstallwarning <%= "fixed" unless rubybundle %>
Name: "msys2"; Description: "MSYS2 development toolchain <%= Time.now.strftime("%Y-%m-%d") %>"; Types: <%= "custom" if with_msys %>; Flags: disablenouninstallwarning <%= "fixed" unless with_msys %>

[Types]
Name: "custom"; Description: "Default installation"; Flags: iscustom
Expand Down
2 changes: 1 addition & 1 deletion recipes/msys2/90-define-main-task.rake
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
desc "install RubyBundle embedded msys2 environment"
desc "install RubyInstaller embedded msys2 environment"
task "base" => [self.devtools]

0 comments on commit 72b0f7f

Please sign in to comment.