3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #180827 from drupol/php/update-script

php: Provide an update script.
This commit is contained in:
Elis Hirwing 2023-01-05 14:14:36 +01:00 committed by GitHub
commit d6f6154cc7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -27,6 +27,10 @@ let
, system-sendmail
, valgrind
, xcbuild
, writeShellScript
, common-updater-scripts
, curl
, jq
, version
, hash
@ -300,6 +304,19 @@ let
outputs = [ "out" "dev" ];
passthru = {
updateScript =
let
script = writeShellScript "php${lib.versions.major version}${lib.versions.minor version}-update-script" ''
set -o errexit
PATH=${lib.makeBinPath [ common-updater-scripts curl jq ]}
new_version=$(curl --silent "https://www.php.net/releases/active" | jq --raw-output '."${lib.versions.major version}"."${lib.versions.majorMinor version}".version')
update-source-version "$UPDATE_NIX_ATTR_PATH.unwrapped" "$new_version" "--file=$1"
'';
in [
script
# Passed as an argument so that update.nix can ensure it does not become a store path.
(./. + "/${lib.versions.majorMinor version}.nix")
];
buildEnv = mkBuildEnv { } [ ];
withExtensions = mkWithExtensions { } [ ];
overrideAttrs =