From c46625d309f47665754597540886d523509d4cc4 Mon Sep 17 00:00:00 2001 From: Forest Eckhardt Date: Thu, 3 Oct 2024 15:17:13 +0000 Subject: [PATCH 1/2] Updates HWC recipe to use new build script --- cflinuxfs4/recipe/hwc.rb | 12 ++++++++---- recipe/hwc.rb | 14 +++++++++----- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/cflinuxfs4/recipe/hwc.rb b/cflinuxfs4/recipe/hwc.rb index 2309c67a..4683f596 100644 --- a/cflinuxfs4/recipe/hwc.rb +++ b/cflinuxfs4/recipe/hwc.rb @@ -25,12 +25,16 @@ def cook Dir.chdir("#{tmp_path}/hwc") do system( { 'PATH' => "#{ENV['PATH']}:/usr/local/go/bin" }, - './scripts/build.sh' - ) or raise 'Could not build hwc' + "./bin/release-binaries.bash amd64 windows #{version} #{tmp_path}/hwc" + ) or raise 'Could not build hwc amd64' + system( + { 'PATH' => "#{ENV['PATH']}:/usr/local/go/bin" }, + "./bin/release-binaries.bash 386 windows #{version} #{tmp_path}/hwc" + ) or raise 'Could not build hwc 386' end - FileUtils.mv("#{tmp_path}/hwc/hwc-rel/hwc.exe", '/tmp/hwc.exe') - FileUtils.mv("#{tmp_path}/hwc/hwc-rel/hwc_x86.exe", '/tmp/hwc_x86.exe') + FileUtils.mv("#{tmp_path}/hwc/hwc-windows-386", '/tmp/hwc.exe') + FileUtils.mv("#{tmp_path}/hwc/hwc-windows-amd64", '/tmp/hwc_x86.exe') end def archive_files diff --git a/recipe/hwc.rb b/recipe/hwc.rb index e2e15821..85e705fc 100644 --- a/recipe/hwc.rb +++ b/recipe/hwc.rb @@ -23,13 +23,17 @@ def cook FileUtils.mv(Dir.glob("#{tmp_path}/hwc-*").first, "#{tmp_path}/hwc") Dir.chdir("#{tmp_path}/hwc") do system( - {"PATH" => "#{ENV["PATH"]}:/usr/local/go/bin"}, - "./scripts/build.sh" - ) or raise "Could not build hwc" + { 'PATH' => "#{ENV['PATH']}:/usr/local/go/bin" }, + "./bin/release-binaries.bash amd64 windows #{version} #{tmp_path}/hwc" + ) or raise 'Could not build hwc amd64' + system( + { 'PATH' => "#{ENV['PATH']}:/usr/local/go/bin" }, + "./bin/release-binaries.bash 386 windows #{version} #{tmp_path}/hwc" + ) or raise 'Could not build hwc 386' end - FileUtils.mv("#{tmp_path}/hwc/hwc-rel/hwc.exe", "/tmp/hwc.exe") - FileUtils.mv("#{tmp_path}/hwc/hwc-rel/hwc_x86.exe", "/tmp/hwc_x86.exe") + FileUtils.mv("#{tmp_path}/hwc/hwc-windows-386", '/tmp/hwc.exe') + FileUtils.mv("#{tmp_path}/hwc/hwc-windows-amd64", '/tmp/hwc_x86.exe') end def archive_files From e851e3531bf2b73632d3d8c67aab932ac587f6f4 Mon Sep 17 00:00:00 2001 From: Forest Eckhardt Date: Thu, 3 Oct 2024 15:29:53 +0000 Subject: [PATCH 2/2] Removes unnecessary recipe --- cflinuxfs4/recipe/hwc.rb | 55 ---------------------------------------- 1 file changed, 55 deletions(-) delete mode 100644 cflinuxfs4/recipe/hwc.rb diff --git a/cflinuxfs4/recipe/hwc.rb b/cflinuxfs4/recipe/hwc.rb deleted file mode 100644 index 4683f596..00000000 --- a/cflinuxfs4/recipe/hwc.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -require_relative 'base' -require_relative '../lib/install_go' -require 'yaml' -require 'digest' - -class HwcRecipe < BaseRecipe - attr_reader :name, :version - - def cook - download unless downloaded? - extract - - install_go_compiler - - system <<-EOF - sudo apt-get update - sudo apt-get -y upgrade - sudo apt-get -y install mingw-w64 - EOF - - FileUtils.rm_rf("#{tmp_path}/hwc") - FileUtils.mv(Dir.glob("#{tmp_path}/hwc-*").first, "#{tmp_path}/hwc") - Dir.chdir("#{tmp_path}/hwc") do - system( - { 'PATH' => "#{ENV['PATH']}:/usr/local/go/bin" }, - "./bin/release-binaries.bash amd64 windows #{version} #{tmp_path}/hwc" - ) or raise 'Could not build hwc amd64' - system( - { 'PATH' => "#{ENV['PATH']}:/usr/local/go/bin" }, - "./bin/release-binaries.bash 386 windows #{version} #{tmp_path}/hwc" - ) or raise 'Could not build hwc 386' - end - - FileUtils.mv("#{tmp_path}/hwc/hwc-windows-386", '/tmp/hwc.exe') - FileUtils.mv("#{tmp_path}/hwc/hwc-windows-amd64", '/tmp/hwc_x86.exe') - end - - def archive_files - ['/tmp/hwc.exe', '/tmp/hwc_x86.exe'] - end - - def url - "https://github.com/cloudfoundry/hwc/archive/#{version}.tar.gz" - end - - def tmp_path - '/tmp/src/code.cloudfoundry.org' - end - - def archive_filename - "#{name}-#{version}-windows-x86-64.zip" - end -end