mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-09 07:28:01 -05:00
* Make basic crew-profile-base package * Use crew consts * Upgrade to 0.0.2-pre2 * Convert aa* to cf* * Docbook * aa* to dz* * docbook-xsl * through fz* and fix environment variables * through mz* * through pz* * through zz* * fix crew-profile-base * upgrade crew-profile-base * major crew-profile-base changes * Upgrade crew-profile-base and fix xdg-base * fix sha256sum * Remove stale files * pkgsrc and sommelier * Add crew-profile-base to core packages and ready for merging * Bump versions * prevent conflicts with #5494 * fix sha256sum * fix fop * profile.d is not ours * fix bash * Upgrade crew-profile-base to 0.0.1-pre6 and fix bash * Remove self-referencing comment * Add binaries, fix rust, fix #{@ver} * move compatibility line * add core mandb deps back * File.exists? => File.exist? * deduplicate @env * update packages * Fix gdk_pixbug source url * Add binaries, use rubocop style fixes * Update cf from 6.36.1-1 to 6.53.0 * fix sl * fix depot tools * remove apulse since it conflicts with pulseaudio. * refactor crew_profile_base * first tranche of builds * go * add cf * hunspell * transmission * clean up dependency & env situation for gdk_pixbuf * fix gettext * fix nano * fix intel-media-driver * add zziplib for texlive * fix texlive * split fuse for flatpak * fix flatpak * delete rack (broken and unmaintained) * fix packer completion * modify and fix sl * fix s * fix stressng * fix stack * Add TMPDIR * Remove TMPDIR from build files * Fix aws2 version * Go: remove extraneous dependency * hunspell_fr_fr: use french in description * intel media driver: remove case x86_64 * aws2: quickfix * everything but texlive * texlive * fix stressng * Delete pkgsrc.rb * add back pkgsrc Co-authored-by: Satadru Pramanik <satadru@gmail.com> Co-authored-by: Ed Reel <edreel@gmail.com> Co-authored-by: satmandu <satadru@umich.edu>
146 lines
5.7 KiB
Ruby
146 lines
5.7 KiB
Ruby
require 'package'
|
|
|
|
class Php73 < Package
|
|
description 'PHP is a popular general-purpose scripting language that is especially suited to web development.'
|
|
homepage 'http://www.php.net/'
|
|
@_ver = '7.3.27'
|
|
version @_ver
|
|
license 'PHP-3.01'
|
|
compatibility 'all'
|
|
source_url "https://www.php.net/distributions/php-#{@_ver}.tar.xz"
|
|
source_sha256 '65f616e2d5b6faacedf62830fa047951b0136d5da34ae59e6744cbaf5dca148d'
|
|
|
|
binary_url({
|
|
aarch64: 'https://dl.bintray.com/chromebrew/chromebrew/php73-7.3.27-chromeos-armv7l.tar.xz',
|
|
armv7l: 'https://dl.bintray.com/chromebrew/chromebrew/php73-7.3.27-chromeos-armv7l.tar.xz',
|
|
i686: 'https://dl.bintray.com/chromebrew/chromebrew/php73-7.3.27-chromeos-i686.tar.xz',
|
|
x86_64: 'https://dl.bintray.com/chromebrew/chromebrew/php73-7.3.27-chromeos-x86_64.tar.xz'
|
|
})
|
|
binary_sha256({
|
|
aarch64: '7bd308b90ec61c6d1f03bfa97cc5883a9e963fab9d63d9922493d6ca5dceefcc',
|
|
armv7l: '7bd308b90ec61c6d1f03bfa97cc5883a9e963fab9d63d9922493d6ca5dceefcc',
|
|
i686: 'd3b0be456454fd98673477769c31b240c8fff997740239d1465d14434fde47ca',
|
|
x86_64: 'fc2d093bc2ba1ab0169c6d0f644649d952b4cb32286a2aa82331dfa5d5cc05ed'
|
|
})
|
|
|
|
depends_on 'libgcrypt'
|
|
depends_on 'libjpeg_turbo'
|
|
depends_on 'libxslt'
|
|
depends_on 'libzip'
|
|
depends_on 'exif'
|
|
depends_on 'freetype'
|
|
depends_on 're2c'
|
|
depends_on 'tidy'
|
|
depends_on 'unixodbc'
|
|
depends_on 'pygments'
|
|
|
|
def self.preflight
|
|
phpver = `php -v 2> /dev/null | head -1 | cut -d' ' -f2`.chomp
|
|
abort "PHP version #{phpver} already installed.".lightgreen unless phpver.empty?
|
|
end
|
|
|
|
def self.patch
|
|
# Configuration
|
|
system "sed -i 's,;pid = run/php-fpm.pid,pid = #{CREW_PREFIX}/tmp/run/php-fpm.pid,' sapi/fpm/php-fpm.conf.in"
|
|
system "sed -i 's,;error_log = log/php-fpm.log,error_log = #{CREW_PREFIX}/log/php-fpm.log,' sapi/fpm/php-fpm.conf.in"
|
|
system "sed -i 's,include=@php_fpm_sysconfdir@/php-fpm.d,include=#{CREW_PREFIX}/etc/php-fpm.d,' sapi/fpm/php-fpm.conf.in"
|
|
system "sed -i 's,^user,;user,' sapi/fpm/www.conf.in"
|
|
system "sed -i 's,^group,;group,' sapi/fpm/www.conf.in"
|
|
system "sed -i 's,@sbindir@,#{CREW_PREFIX}/bin,' sapi/fpm/init.d.php-fpm.in"
|
|
system "sed -i 's,@sysconfdir@,#{CREW_PREFIX}/etc,' sapi/fpm/init.d.php-fpm.in"
|
|
system "sed -i 's,@localstatedir@,#{CREW_PREFIX}/tmp,' sapi/fpm/init.d.php-fpm.in"
|
|
# Set some sane defaults
|
|
system "sed -i 's,post_max_size = 8M,post_max_size = 128M,' php.ini-development"
|
|
system "sed -i 's,upload_max_filesize = 2M,upload_max_filesize = 128M,' php.ini-development"
|
|
system "sed -i 's,;opcache.enable=0,opcache.enable=1,' php.ini-development"
|
|
# Fix cc: error: ext/standard/.libs/type.o: No such file or directory
|
|
# system "sed -i '98303d' configure"
|
|
# system "sed -i '98295,98296d' configure"
|
|
# Fix /usr/bin/file: No such file or directory
|
|
system 'filefix'
|
|
end
|
|
|
|
def self.build
|
|
system "env CFLAGS='-pipe -ltinfo' \
|
|
./configure \
|
|
--prefix=#{CREW_PREFIX} \
|
|
--docdir=#{CREW_PREFIX}/doc \
|
|
--infodir=#{CREW_PREFIX}/info \
|
|
--libdir=#{CREW_LIB_PREFIX} \
|
|
--localstatedir=#{CREW_PREFIX}/tmp \
|
|
--mandir=#{CREW_MAN_PREFIX} \
|
|
--sbindir=#{CREW_PREFIX}/bin \
|
|
--with-config-file-path=#{CREW_PREFIX}/etc \
|
|
--with-libdir=#{ARCH_LIB} \
|
|
--with-kerberos=#{CREW_LIB_PREFIX} \
|
|
--enable-exif \
|
|
--enable-fpm \
|
|
--enable-ftp \
|
|
--enable-mbstring \
|
|
--enable-opcache \
|
|
--enable-pcntl \
|
|
--enable-shared \
|
|
--enable-shmop \
|
|
--enable-sockets \
|
|
--enable-zip \
|
|
--with-bz2 \
|
|
--with-curl \
|
|
--with-gd \
|
|
--with-gettext \
|
|
--with-gmp \
|
|
--with-libzip \
|
|
--with-mysqli \
|
|
--with-openssl \
|
|
--with-pcre-regex \
|
|
--with-pdo-mysql \
|
|
--with-pear \
|
|
--with-readline \
|
|
--with-tidy \
|
|
--with-unixODBC \
|
|
--with-xsl \
|
|
--with-zlib"
|
|
system 'make'
|
|
end
|
|
|
|
def self.check
|
|
# system 'make', 'test'
|
|
end
|
|
|
|
def self.install
|
|
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/log"
|
|
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/tmp/run"
|
|
system 'make', "INSTALL_ROOT=#{CREW_DEST_DIR}", 'install'
|
|
FileUtils.install 'php.ini-development', "#{CREW_DEST_PREFIX}/etc/php.ini", mode: 0644
|
|
FileUtils.install 'sapi/fpm/init.d.php-fpm.in', "#{CREW_DEST_PREFIX}/etc/init.d/php-fpm", mode: 0755
|
|
FileUtils.install 'sapi/fpm/php-fpm.conf.in', "#{CREW_DEST_PREFIX}/etc/php-fpm.conf", mode: 0644
|
|
FileUtils.install 'sapi/fpm/www.conf.in', "#{CREW_DEST_PREFIX}/etc/php-fpm.d/www.conf", mode: 0644
|
|
Fileutils.ln_s "#{CREW_PREFIX}/etc/init.d/php-fpm", "#{CREW_DEST_PREFIX}/bin/php7-fpm"
|
|
|
|
# clean up some files created under #{CREW_DEST_DIR}. check http://pear.php.net/bugs/bug.php?id=20383 for more details
|
|
FileUtils.mv "#{CREW_DEST_DIR}/.depdb", "#{CREW_DEST_LIB_PREFIX}/php"
|
|
FileUtils.mv "#{CREW_DEST_DIR}/.depdblock", "#{CREW_DEST_LIB_PREFIX}/php"
|
|
FileUtils.rm_rf "#{CREW_DEST_DIR}/.channels"
|
|
FileUtils.rm_rf "#{CREW_DEST_DIR}/.filemap"
|
|
FileUtils.rm_rf "#{CREW_DEST_DIR}/.lock"
|
|
FileUtils.rm_rf "#{CREW_DEST_DIR}/.registry"
|
|
end
|
|
|
|
def self.postinstall
|
|
puts
|
|
puts 'To start the php-fpm service, execute:'.lightblue
|
|
puts 'php7-fpm start'.lightblue
|
|
puts
|
|
puts 'To stop the php-fpm service, execute:'.lightblue
|
|
puts 'php7-fpm stop'.lightblue
|
|
puts
|
|
puts 'To restart the php-fpm service, execute:'.lightblue
|
|
puts 'php7-fpm restart'.lightblue
|
|
puts
|
|
puts 'To start php-fpm on login, execute the following:'.lightblue
|
|
puts "echo 'if [ -f #{CREW_PREFIX}/bin/php7-fpm ]; then' >> ~/.bashrc".lightblue
|
|
puts "echo ' #{CREW_PREFIX}/bin/php7-fpm start' >> ~/.bashrc".lightblue
|
|
puts "echo 'fi' >> ~/.bashrc".lightblue
|
|
puts 'source ~/.bashrc'.lightblue
|
|
end
|
|
end
|