Commit 020265da authored by Ed Reel's avatar Ed Reel Committed by GitHub

Update composer from 1.10.13 to 2.0.4 (#4557)

parent 335e866c
......@@ -3,10 +3,10 @@ require 'package'
class Composer < Package
description 'Dependency Manager for PHP'
homepage 'https://getcomposer.org/'
version '1.10.13'
version '2.0.4'
compatibility 'all'
source_url 'https://github.com/composer/composer/archive/1.10.13.tar.gz'
source_sha256 '363500cc6ce33ff2d87ce9d706e4577d7328b7a932e3edd72df26b85b369ec78'
source_url 'https://github.com/composer/composer/archive/2.0.4.tar.gz'
source_sha256 '0d699731fe6b3b31a3a2a86032459f08449dbe095fe57749536da922d32294c2'
depends_on 'php74' unless File.exists? "#{CREW_PREFIX}/bin/php"
depends_on 'xdg_base'
......@@ -22,15 +22,10 @@ class Composer < Package
end
def self.install
system "php -r \"copy('https://getcomposer.org/installer', 'composer-setup.php');\""
system 'curl -Ls -o installer.sig https://composer.github.io/installer.sig'
abort 'Checksum mismatch. :/ Try again.'.lightred unless Digest::SHA384.hexdigest( File.read('composer-setup.php') ) == File.read('installer.sig')
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/bin"
system "php composer-setup.php --install-dir=#{CREW_DEST_PREFIX}/bin --filename=composer --version=#{version}"
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/.config"
FileUtils.cp_r "#{HOME}/.config/composer", "#{CREW_DEST_PREFIX}/.config"
FileUtils.rm_rf "#{HOME}/.config"
FileUtils.ln_s "#{CREW_PREFIX}/.config", "#{HOME}/.config"
system "curl -Ls -o composer https://github.com/composer/composer/releases/download/#{version}/composer.phar"
abort 'Checksum mismatch. :/ Try again.'.lightred unless Digest::SHA256.hexdigest( File.read('composer') ) == 'c3b2bc477429c923c69f7f9b137e06b2a93c6a1e192d40ffad1741ee5d54760d'
system "install -Dm755 composer #{CREW_DEST_PREFIX}/bin/composer"
FileUtils.ln_sf "#{CREW_PREFIX}/.config", "#{HOME}/.config"
end
def self.postinstall
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment