php: simplify version definitions

This commit is contained in:
Piotr Kwiecinski
2026-02-24 20:56:33 +01:00
parent 65abdb778b
commit eac682cd51
6 changed files with 72 additions and 238 deletions
-59
View File
@@ -1,59 +0,0 @@
{ callPackage, ... }@_args:
let
base = callPackage ./generic.nix (
_args
// {
version = "8.2.30";
hash = "sha256-EEggtsj8lZ3eSzNCE19CvavyRuhpGKFjgaF9hEfIZvo=";
}
);
in
base.withExtensions (
{ all, ... }:
with all;
[
bcmath
calendar
curl
ctype
dom
exif
fileinfo
filter
ftp
gd
gettext
gmp
iconv
imap
intl
ldap
mbstring
mysqli
mysqlnd
opcache
openssl
pcntl
pdo
pdo_mysql
pdo_odbc
pdo_pgsql
pdo_sqlite
pgsql
posix
readline
session
simplexml
sockets
soap
sodium
sysvsem
sqlite3
tokenizer
xmlreader
xmlwriter
zip
zlib
]
)
-59
View File
@@ -1,59 +0,0 @@
{ callPackage, ... }@_args:
let
base = callPackage ./generic.nix (
_args
// {
version = "8.3.30";
hash = "sha256-gAt7btULc8jueETuXy98xhL6p4daCqfEUp6O1YZqUDA=";
}
);
in
base.withExtensions (
{ all, ... }:
with all;
[
bcmath
calendar
curl
ctype
dom
exif
fileinfo
filter
ftp
gd
gettext
gmp
iconv
imap
intl
ldap
mbstring
mysqli
mysqlnd
opcache
openssl
pcntl
pdo
pdo_mysql
pdo_odbc
pdo_pgsql
pdo_sqlite
pgsql
posix
readline
session
simplexml
sockets
soap
sodium
sysvsem
sqlite3
tokenizer
xmlreader
xmlwriter
zip
zlib
]
)
-58
View File
@@ -1,58 +0,0 @@
{ callPackage, ... }@_args:
let
base = callPackage ./generic.nix (
_args
// {
version = "8.4.18";
hash = "sha256-WGsy2Szrz7yklcX2rRozZAVT0KnAv9LmcVM02VnPmFg=";
}
);
in
base.withExtensions (
{ all, ... }:
with all;
[
bcmath
calendar
curl
ctype
dom
exif
fileinfo
filter
ftp
gd
gettext
gmp
iconv
intl
ldap
mbstring
mysqli
mysqlnd
opcache
openssl
pcntl
pdo
pdo_mysql
pdo_odbc
pdo_pgsql
pdo_sqlite
pgsql
posix
readline
session
simplexml
sockets
soap
sodium
sysvsem
sqlite3
tokenizer
xmlreader
xmlwriter
zip
zlib
]
)
-57
View File
@@ -1,57 +0,0 @@
{ callPackage, ... }@_args:
let
base = callPackage ./generic.nix (
_args
// {
version = "8.5.3";
hash = "sha256-/F7KvBg862TZ/KPc04e9KbK2dEgyavmY/eADEkkWgjs=";
}
);
in
base.withExtensions (
{ all, ... }:
with all;
[
bcmath
calendar
curl
ctype
dom
exif
fileinfo
filter
ftp
gd
gettext
gmp
iconv
intl
ldap
mbstring
mysqli
mysqlnd
openssl
pcntl
pdo
pdo_mysql
pdo_odbc
pdo_pgsql
pdo_sqlite
pgsql
posix
readline
session
simplexml
sockets
soap
sodium
sysvsem
sqlite3
tokenizer
xmlreader
xmlwriter
zip
zlib
]
)
+71 -4
View File
@@ -1,4 +1,5 @@
{
lib,
callPackage,
stdenv,
llvmPackages,
@@ -12,10 +13,76 @@ let
withJitSealloc = false; # See https://bugs.php.net/bug.php?id=78927 and https://bugs.php.net/bug.php?id=78630
};
};
generic =
{ version, hash }:
let
base = callPackage ./generic.nix (commonArgs // { inherit version hash; });
in
base.withExtensions (
{ all, ... }:
with all;
[
bcmath
calendar
curl
ctype
dom
exif
fileinfo
filter
ftp
gd
gettext
gmp
iconv
intl
ldap
mbstring
mysqli
mysqlnd
openssl
pcntl
pdo
pdo_mysql
pdo_odbc
pdo_pgsql
pdo_sqlite
pgsql
posix
readline
session
simplexml
sockets
soap
sodium
sysvsem
sqlite3
tokenizer
xmlreader
xmlwriter
zip
zlib
]
++ lib.optional (lib.versionOlder version "8.4") all.imap
++ lib.optional (lib.versionOlder version "8.5") all.opcache
);
in
{
php82 = callPackage ./8.2.nix commonArgs;
php83 = callPackage ./8.3.nix commonArgs;
php84 = callPackage ./8.4.nix commonArgs;
php85 = callPackage ./8.5.nix commonArgs;
php82 = generic {
version = "8.2.30";
hash = "sha256-EEggtsj8lZ3eSzNCE19CvavyRuhpGKFjgaF9hEfIZvo=";
};
php83 = generic {
version = "8.3.30";
hash = "sha256-gAt7btULc8jueETuXy98xhL6p4daCqfEUp6O1YZqUDA=";
};
php84 = generic {
version = "8.4.18";
hash = "sha256-WGsy2Szrz7yklcX2rRozZAVT0KnAv9LmcVM02VnPmFg=";
};
php85 = generic {
version = "8.5.3";
hash = "sha256-/F7KvBg862TZ/KPc04e9KbK2dEgyavmY/eADEkkWgjs=";
};
}
@@ -389,7 +389,7 @@ let
[
script
# Passed as an argument so that update.nix can ensure it does not become a store path.
(./. + "/${lib.versions.majorMinor version}.nix")
./default.nix
];
buildEnv = mkBuildEnv { } [ ];
withExtensions = mkWithExtensions { } [ ];