Add phpbrew package (#9690)

This commit is contained in:
Ed Reel
2024-04-20 05:39:57 -05:00
committed by GitHub
parent c2d60215e9
commit 66a2ad03e8
4 changed files with 48 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
/usr/local/bin/phpbrew
/usr/local/etc/bash.d/10-phpbrew
/usr/local/etc/env.d/10-phpbrew
/home/chronos/user/.phpbrew/bashrc

View File

@@ -0,0 +1,4 @@
/usr/local/bin/phpbrew
/usr/local/etc/bash.d/10-phpbrew
/usr/local/etc/env.d/10-phpbrew
/home/chronos/user/.phpbrew/bashrc

35
packages/phpbrew.rb Normal file
View File

@@ -0,0 +1,35 @@
require 'package'
class Phpbrew < Package
description 'Brew & manage PHP versions in pure PHP at HOME'
homepage 'https://phpbrew.github.io/phpbrew/'
version '2.2.0'
license 'MIT'
compatibility 'x86_64 aarch64 armv7l'
source_url 'https://github.com/phpbrew/phpbrew/releases/download/2.2.0/phpbrew.phar'
source_sha256 '3247b8438888827d068542b2891392e3beffebe122f4955251fa4f9efa0da03d'
depends_on 'php83' unless File.exist? "#{CREW_PREFIX}/bin/php"
no_compile_needed
def self.install
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/etc/env.d"
File.write "#{CREW_DEST_PREFIX}/etc/env.d/10-phpbrew", <<~EOF
PHPBREW_SET_PROMPT=1
PHPBREW_RC_ENABLE=1
EOF
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/etc/bash.d"
File.write "#{CREW_DEST_PREFIX}/etc/bash.d/10-phpbrew", <<~EOF
[[ ! -s #{HOME}/.phpbrew/bashrc ]] && phpbrew init
[[ -e #{HOME}/.phpbrew/bashrc ]] && source #{HOME}/.phpbrew/bashrc
EOF
FileUtils.mkdir_p "#{CREW_DEST_HOME}/.phpbrew"
FileUtils.touch "#{CREW_DEST_HOME}/.phpbrew/bashrc"
FileUtils.install 'phpbrew.phar', "#{CREW_DEST_PREFIX}/bin/phpbrew", mode: 0o755
end
def self.postinstall
ExitMessage.add "\nSee https://github.com/phpbrew/phpbrew/wiki/Quick-Start for more information.\n".lightblue
end
end

View File

@@ -6906,6 +6906,11 @@ url: https://github.com/nbs-system/php-malware-finder
activity: low
---
kind: url
name: phpbrew
url: https://github.com/phpbrew/phpbrew/releases
activity: low
---
kind: url
name: phpsysinfo
url: https://sourceforge.net/projects/phpsysinfo/files/phpsysinfo/
activity: low