summaryrefslogtreecommitdiff
path: root/config/software/asdf_php.rb
blob: 3225ac88c24414b032b8c850008bf8094b49cb8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# frozen_string_literal: true

name "asdf_php"
default_version "7.4.8"
license_file "LICENSE"

dependency "autoconf"
dependency "libtool"
dependency "libxml2"
dependency "openssl"
dependency "zlib"
dependency "libsqlite3"

source url: "https://www.php.net/distributions/php-#{version}.tar.gz"
relative_path "php-#{version}"

version("7.4.8") { source sha256: "649f6bcdb60dc38d5edd7f3a7b2905d15d88c1d13e40307e8972ede347cea6ba" }

build do
  env = with_standard_compiler_flags(with_embedded_path)
  configure_command = [
    "--prefix=#{install_dir}",
    "--with-openssl=#{install_dir}/embedded"
  ]
  configure(*configure_command, env: env)
  make "-j #{workers}", env: env
  make "-j #{workers} install", env: env
end

build do
  command "curl https://getcomposer.org/installer -o #{project_dir}/composer-setup.php"
  command "#{install_dir}/bin/php #{project_dir}/composer-setup.php --install-dir=#{install_dir}/bin --filename=composer"
end

build do
  delete "#{install_dir}/embedded/bin/sqlite3"
end