workflows/check-nix-format: enforce for php-packages

This commit is contained in:
Pol Dellaiera 2024-05-04 23:04:36 +02:00
parent a1fd087b05
commit c759efa5e7
No known key found for this signature in database
GPG Key ID: D476DFE9C67467CA
62 changed files with 675 additions and 368 deletions

View File

@ -39,6 +39,7 @@ jobs:
pkgs/test/cuda pkgs/test/cuda
pkgs/top-level/cuda-packages.nix pkgs/top-level/cuda-packages.nix
NIX_FMT_PATHS_VSCODE_EXTS: pkgs/applications/editors/vscode/extensions NIX_FMT_PATHS_VSCODE_EXTS: pkgs/applications/editors/vscode/extensions
NIX_FMT_PATHS_PHP_PACKAGES: pkgs/development/php-packages
# Iterate over all environment variables beginning with NIX_FMT_PATHS_. # Iterate over all environment variables beginning with NIX_FMT_PATHS_.
run: | run: |
for env_var in "${!NIX_FMT_PATHS_@}"; do for env_var in "${!NIX_FMT_PATHS_@}"; do

View File

@ -1,8 +1,14 @@
{ buildPecl, lib, rabbitmq-c, fetchFromGitHub }: {
buildPecl,
lib,
rabbitmq-c,
fetchFromGitHub,
}:
let let
version = "2.1.2"; version = "2.1.2";
in buildPecl { in
buildPecl {
inherit version; inherit version;
pname = "amqp"; pname = "amqp";

View File

@ -1,8 +1,16 @@
{ buildPecl, lib, pcre2, fetchFromGitHub, php, fetchpatch }: {
buildPecl,
lib,
pcre2,
fetchFromGitHub,
php,
fetchpatch,
}:
let let
version = "5.1.23"; version = "5.1.23";
in buildPecl { in
buildPecl {
inherit version; inherit version;
pname = "apcu"; pname = "apcu";
@ -16,9 +24,15 @@ in buildPecl {
buildInputs = [ pcre2 ]; buildInputs = [ pcre2 ];
doCheck = true; doCheck = true;
checkTarget = "test"; checkTarget = "test";
checkFlagsArray = [ "REPORT_EXIT_STATUS=1" "NO_INTERACTION=1" ]; checkFlagsArray = [
"REPORT_EXIT_STATUS=1"
"NO_INTERACTION=1"
];
makeFlags = [ "phpincludedir=$(dev)/include" ]; makeFlags = [ "phpincludedir=$(dev)/include" ];
outputs = [ "out" "dev" ]; outputs = [
"out"
"dev"
];
meta = with lib; { meta = with lib; {
changelog = "https://github.com/krakjoe/apcu/releases/tag/v${version}"; changelog = "https://github.com/krakjoe/apcu/releases/tag/v${version}";

View File

@ -1,8 +1,13 @@
{ buildPecl, lib, fetchFromGitHub }: {
buildPecl,
lib,
fetchFromGitHub,
}:
let let
version = "1.1.1"; version = "1.1.1";
in buildPecl { in
buildPecl {
inherit version; inherit version;
pname = "ast"; pname = "ast";

View File

@ -1,4 +1,8 @@
{ lib, php82, fetchFromGitHub }: {
lib,
php82,
fetchFromGitHub,
}:
php82.buildComposerProject (finalAttrs: { php82.buildComposerProject (finalAttrs: {
pname = "box"; pname = "box";

View File

@ -1,10 +1,11 @@
{ lib {
, fetchFromGitHub lib,
, fetchpatch fetchFromGitHub,
, installShellFiles fetchpatch,
, php installShellFiles,
, nix-update-script php,
, testers nix-update-script,
testers,
}: }:
php.buildComposerProject (finalAttrs: { php.buildComposerProject (finalAttrs: {

View File

@ -1,14 +1,15 @@
{ lib {
, callPackage lib,
, fetchFromGitHub callPackage,
, php fetchFromGitHub,
, unzip php,
, _7zz unzip,
, xz _7zz,
, git xz,
, curl git,
, cacert curl,
, makeBinaryWrapper cacert,
makeBinaryWrapper,
}: }:
php.buildComposerProject (finalAttrs: { php.buildComposerProject (finalAttrs: {
@ -37,7 +38,16 @@ php.buildComposerProject (finalAttrs: {
postInstall = '' postInstall = ''
wrapProgram $out/bin/composer \ wrapProgram $out/bin/composer \
--prefix PATH : ${lib.makeBinPath [ _7zz cacert curl git unzip xz ]} --prefix PATH : ${
lib.makeBinPath [
_7zz
cacert
curl
git
unzip
xz
]
}
''; '';
vendorHash = "sha256-dNNV9fTyGyRoGeDV/vBjn0aMgkaUMsrKQv5AOoiYokQ="; vendorHash = "sha256-dNNV9fTyGyRoGeDV/vBjn0aMgkaUMsrKQv5AOoiYokQ=";

View File

@ -1,4 +1,13 @@
{ lib, buildPecl, fetchFromGitHub, writeText, libcouchbase, zlib, php, substituteAll }: {
lib,
buildPecl,
fetchFromGitHub,
writeText,
libcouchbase,
zlib,
php,
substituteAll,
}:
let let
pname = "couchbase"; pname = "couchbase";
version = "3.2.2"; version = "3.2.2";
@ -15,7 +24,10 @@ buildPecl {
configureFlags = [ "--with-couchbase" ]; configureFlags = [ "--with-couchbase" ];
buildInputs = [ libcouchbase zlib ]; buildInputs = [
libcouchbase
zlib
];
patches = [ patches = [
(substituteAll { (substituteAll {

View File

@ -1,14 +1,15 @@
{ lib {
, stdenv lib,
, buildPecl stdenv,
, cargo buildPecl,
, rustc cargo,
, fetchFromGitHub rustc,
, rustPlatform fetchFromGitHub,
, curl rustPlatform,
, pcre2 curl,
, libiconv pcre2,
, darwin libiconv,
darwin,
}: }:
buildPecl rec { buildPecl rec {
@ -32,21 +33,26 @@ buildPecl rec {
env.NIX_CFLAGS_COMPILE = "-O2"; env.NIX_CFLAGS_COMPILE = "-O2";
nativeBuildInputs = [ nativeBuildInputs =
[
cargo cargo
rustc rustc
] ++ lib.optionals stdenv.isLinux [ ]
++ lib.optionals stdenv.isLinux [
rustPlatform.bindgenHook rustPlatform.bindgenHook
rustPlatform.cargoSetupHook rustPlatform.cargoSetupHook
] ++ lib.optionals stdenv.isDarwin [ ]
++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk_11_0.rustPlatform.bindgenHook darwin.apple_sdk_11_0.rustPlatform.bindgenHook
darwin.apple_sdk_11_0.rustPlatform.cargoSetupHook darwin.apple_sdk_11_0.rustPlatform.cargoSetupHook
]; ];
buildInputs = [ buildInputs =
[
curl curl
pcre2 pcre2
] ++ lib.optionals stdenv.isDarwin [ ]
++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.CoreFoundation darwin.apple_sdk.frameworks.CoreFoundation
darwin.apple_sdk.frameworks.Security darwin.apple_sdk.frameworks.Security
libiconv libiconv
@ -56,7 +62,10 @@ buildPecl rec {
changelog = "https://github.com/DataDog/dd-trace-php/blob/${src.rev}/CHANGELOG.md"; changelog = "https://github.com/DataDog/dd-trace-php/blob/${src.rev}/CHANGELOG.md";
description = "Datadog Tracing PHP Client"; description = "Datadog Tracing PHP Client";
homepage = "https://github.com/DataDog/dd-trace-php"; homepage = "https://github.com/DataDog/dd-trace-php";
license = with lib.licenses; [ asl20 bsd3 ]; license = with lib.licenses; [
asl20
bsd3
];
maintainers = lib.teams.php.members; maintainers = lib.teams.php.members;
}; };
} }

View File

@ -1,6 +1,7 @@
{ lib {
, fetchFromGitHub lib,
, php fetchFromGitHub,
php,
}: }:
php.buildComposerProject (finalAttrs: { php.buildComposerProject (finalAttrs: {

View File

@ -1,8 +1,15 @@
{ buildPecl, lib, pcre2, php, fetchFromGitHub }: {
buildPecl,
lib,
pcre2,
php,
fetchFromGitHub,
}:
let let
version = "1.5.0"; version = "1.5.0";
in buildPecl { in
buildPecl {
inherit version; inherit version;
pname = "ds"; pname = "ds";

View File

@ -1,4 +1,11 @@
{ buildPecl, lib, php, pkg-config, openssl, libevent }: {
buildPecl,
lib,
php,
pkg-config,
openssl,
libevent,
}:
buildPecl { buildPecl {
pname = "event"; pname = "event";
@ -19,7 +26,10 @@ buildPecl {
''; '';
nativeBuildInputs = [ pkg-config ]; nativeBuildInputs = [ pkg-config ];
buildInputs = [ openssl libevent ]; buildInputs = [
openssl
libevent
];
internalDeps = [ php.extensions.sockets ]; internalDeps = [ php.extensions.sockets ];
meta = with lib; { meta = with lib; {

View File

@ -1,8 +1,17 @@
{ buildPecl, lib, gpgme, file, gnupg, php, fetchFromGitHub }: {
buildPecl,
lib,
gpgme,
file,
gnupg,
php,
fetchFromGitHub,
}:
let let
version = "1.5.1"; version = "1.5.1";
in buildPecl { in
buildPecl {
inherit version; inherit version;
pname = "gnupg"; pname = "gnupg";

View File

@ -1,7 +1,8 @@
{ buildPecl {
, pkg-config buildPecl,
, lib pkg-config,
, grpc lib,
grpc,
}: }:
buildPecl { buildPecl {

View File

@ -1,6 +1,7 @@
{ fetchFromGitHub {
, lib fetchFromGitHub,
, php lib,
php,
}: }:
php.buildComposerProject (finalAttrs: { php.buildComposerProject (finalAttrs: {

View File

@ -7,7 +7,10 @@ buildPecl {
configureFlags = [ "--enable-igbinary" ]; configureFlags = [ "--enable-igbinary" ];
makeFlags = [ "phpincludedir=$(dev)/include" ]; makeFlags = [ "phpincludedir=$(dev)/include" ];
outputs = [ "out" "dev" ]; outputs = [
"out"
"dev"
];
meta = { meta = {
description = "Binary serialization for PHP"; description = "Binary serialization for PHP";

View File

@ -1,4 +1,10 @@
{ buildPecl, lib, imagemagick, pkg-config, pcre2 }: {
buildPecl,
lib,
imagemagick,
pkg-config,
pcre2,
}:
buildPecl { buildPecl {
pname = "imagick"; pname = "imagick";

View File

@ -1,6 +1,4 @@
{ buildPecl { buildPecl, lib }:
, lib
}:
buildPecl { buildPecl {
pname = "inotify"; pname = "inotify";

View File

@ -1,7 +1,8 @@
{ stdenv {
, lib stdenv,
, fetchzip lib,
, php fetchzip,
php,
}: }:
let let
@ -42,7 +43,9 @@ stdenv.mkDerivation {
installPhase = '' installPhase = ''
mkdir -p $out/lib/php/extensions mkdir -p $out/lib/php/extensions
cp $src/ioncube_loader_${variant.${stdenv.hostPlatform.system}.prefix}_${phpVersion}.so $out/lib/php/extensions/ioncube-loader.so cp $src/ioncube_loader_${
variant.${stdenv.hostPlatform.system}.prefix
}_${phpVersion}.so $out/lib/php/extensions/ioncube-loader.so
''; '';
meta = with lib; { meta = with lib; {
@ -52,6 +55,11 @@ stdenv.mkDerivation {
sourceProvenance = [ sourceTypes.binaryNativeCode ]; sourceProvenance = [ sourceTypes.binaryNativeCode ];
license = licenses.unfree; license = licenses.unfree;
maintainers = with maintainers; [ neverbehave ]; maintainers = with maintainers; [ neverbehave ];
platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; platforms = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
}; };
} }

View File

@ -1,4 +1,8 @@
{ buildPecl, lib, php }: {
buildPecl,
lib,
php,
}:
buildPecl { buildPecl {
pname = "mailparse"; pname = "mailparse";

View File

@ -1,4 +1,9 @@
{ buildPecl, lib, fetchFromGitHub, libmaxminddb }: {
buildPecl,
lib,
fetchFromGitHub,
libmaxminddb,
}:
let let
pname = "maxminddb"; pname = "maxminddb";
version = "1.11.1"; version = "1.11.1";

View File

@ -1,4 +1,11 @@
{ buildPecl, lib, fetchFromGitHub, php, zlib, pkg-config }: {
buildPecl,
lib,
fetchFromGitHub,
php,
zlib,
pkg-config,
}:
buildPecl rec { buildPecl rec {
pname = "memcache"; pname = "memcache";
@ -11,13 +18,9 @@ buildPecl rec {
hash = "sha256-77GvQ59XUpIZmdYZP6IhtjdkYwXKuNBSG+LBScz2BtI="; hash = "sha256-77GvQ59XUpIZmdYZP6IhtjdkYwXKuNBSG+LBScz2BtI=";
}; };
internalDeps = [ internalDeps = [ php.extensions.session ];
php.extensions.session
];
configureFlags = [ configureFlags = [ "--with-zlib-dir=${zlib.dev}" ];
"--with-zlib-dir=${zlib.dev}"
];
nativeBuildInputs = [ pkg-config ]; nativeBuildInputs = [ pkg-config ];
buildInputs = [ zlib ]; buildInputs = [ zlib ];

View File

@ -1,4 +1,13 @@
{ buildPecl, lib, fetchFromGitHub, php, cyrus_sasl, zlib, pkg-config, libmemcached }: {
buildPecl,
lib,
fetchFromGitHub,
php,
cyrus_sasl,
zlib,
pkg-config,
libmemcached,
}:
buildPecl rec { buildPecl rec {
pname = "memcached"; pname = "memcached";
@ -11,9 +20,7 @@ buildPecl rec {
sha256 = "sha256-g9IzGSZUxLlOE32o9ZJOa3erb5Qs1ntR8nzS3kRd/EU="; sha256 = "sha256-g9IzGSZUxLlOE32o9ZJOa3erb5Qs1ntR8nzS3kRd/EU=";
}; };
internalDeps = [ internalDeps = [ php.extensions.session ];
php.extensions.session
];
configureFlags = [ configureFlags = [
"--with-zlib-dir=${zlib.dev}" "--with-zlib-dir=${zlib.dev}"
@ -21,7 +28,10 @@ buildPecl rec {
]; ];
nativeBuildInputs = [ pkg-config ]; nativeBuildInputs = [ pkg-config ];
buildInputs = [ cyrus_sasl zlib ]; buildInputs = [
cyrus_sasl
zlib
];
meta = with lib; { meta = with lib; {
description = "PHP extension for interfacing with memcached via libmemcached library"; description = "PHP extension for interfacing with memcached via libmemcached library";

View File

@ -1,4 +1,8 @@
{ buildPecl, lib, fetchFromGitHub }: {
buildPecl,
lib,
fetchFromGitHub,
}:
buildPecl rec { buildPecl rec {
version = "unstable-2022-03-25"; version = "unstable-2022-03-25";

View File

@ -1,12 +1,14 @@
{ buildPecl {
, lib buildPecl,
, fetchFromGitHub lib,
, judy fetchFromGitHub,
judy,
}: }:
let let
version = "3.0.2"; version = "3.0.2";
in buildPecl { in
buildPecl {
inherit version; inherit version;
pname = "memprof"; pname = "memprof";
@ -17,9 +19,7 @@ in buildPecl {
hash = "sha256-K8YcvCobErBkaWFTkVGLXXguQPOLIgQuRGWJF+HAIRA="; hash = "sha256-K8YcvCobErBkaWFTkVGLXXguQPOLIgQuRGWJF+HAIRA=";
}; };
configureFlags = [ configureFlags = [ "--with-judy-dir=${judy}" ];
"--with-judy-dir=${judy}"
];
doCheck = true; doCheck = true;

View File

@ -1,16 +1,17 @@
{ stdenv {
, buildPecl stdenv,
, fetchFromGitHub buildPecl,
, lib fetchFromGitHub,
, libiconv lib,
, pcre2 libiconv,
, pkg-config pcre2,
, cyrus_sasl pkg-config,
, icu64 cyrus_sasl,
, openssl icu64,
, snappy openssl,
, zlib snappy,
, darwin zlib,
darwin,
}: }:
buildPecl rec { buildPecl rec {
@ -26,14 +27,16 @@ buildPecl rec {
}; };
nativeBuildInputs = [ pkg-config ]; nativeBuildInputs = [ pkg-config ];
buildInputs = [ buildInputs =
[
cyrus_sasl cyrus_sasl
icu64 icu64
openssl openssl
snappy snappy
zlib zlib
pcre2 pcre2
] ++ lib.optionals stdenv.isDarwin [ ]
++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk_11_0.frameworks.Security darwin.apple_sdk_11_0.frameworks.Security
darwin.apple_sdk_11_0.Libsystem darwin.apple_sdk_11_0.Libsystem
libiconv libiconv

View File

@ -1,13 +1,24 @@
{ buildPecl, lib, oracle-instantclient, php }: {
buildPecl,
lib,
oracle-instantclient,
php,
}:
let let
versionData = if (lib.versionOlder php.version "8.1") then { versionData =
if (lib.versionOlder php.version "8.1") then
{
version = "3.0.1"; version = "3.0.1";
sha256 = "108ds92620dih5768z19hi0jxfa7wfg5hdvyyvpapir87c0ap914"; sha256 = "108ds92620dih5768z19hi0jxfa7wfg5hdvyyvpapir87c0ap914";
} else if (lib.versionOlder php.version "8.2") then { }
else if (lib.versionOlder php.version "8.2") then
{
version = "3.2.1"; version = "3.2.1";
sha256 = "sha256-zyF703DzRZDBhlNFFt/dknmZ7layqhgjG1/ZDN+PEsg="; sha256 = "sha256-zyF703DzRZDBhlNFFt/dknmZ7layqhgjG1/ZDN+PEsg=";
} else { }
else
{
version = "3.3.0"; version = "3.3.0";
sha256 = "sha256-0y5VnRKspJYE6xWeBcX2OG2pJTNbB+27GMywDv4gzwQ="; sha256 = "sha256-0y5VnRKspJYE6xWeBcX2OG2pJTNbB+27GMywDv4gzwQ=";
}; };

View File

@ -1,8 +1,16 @@
{ lib, stdenv, buildPecl, valgrind, pcre2, fetchFromGitHub }: {
lib,
stdenv,
buildPecl,
valgrind,
pcre2,
fetchFromGitHub,
}:
let let
version = "22.1.2"; version = "22.1.2";
in buildPecl { in
buildPecl {
inherit version; inherit version;
pname = "openswoole"; pname = "openswoole";

View File

@ -1,8 +1,13 @@
{ lib, buildPecl, fetchFromGitHub }: {
lib,
buildPecl,
fetchFromGitHub,
}:
let let
version = "1.0.2"; version = "1.0.2";
in buildPecl rec { in
buildPecl rec {
inherit version; inherit version;
pname = "opentelemetry"; pname = "opentelemetry";

View File

@ -1,8 +1,15 @@
{ buildPecl, lib, php, pcre2, fetchFromGitHub }: {
buildPecl,
lib,
php,
pcre2,
fetchFromGitHub,
}:
let let
version = "1.0.11"; version = "1.0.11";
in buildPecl { in
buildPecl {
inherit version; inherit version;
pname = "pcov"; pname = "pcov";

View File

@ -1,4 +1,10 @@
{ buildPecl, fetchFromGitHub, lib, pkg-config, dlib }: {
buildPecl,
fetchFromGitHub,
lib,
pkg-config,
dlib,
}:
let let
pname = "pdlib"; pname = "pdlib";
version = "1.1.0"; version = "1.1.0";

View File

@ -1,4 +1,11 @@
{ stdenv, buildPecl, lib, libiconv, unixODBC, php }: {
stdenv,
buildPecl,
lib,
libiconv,
unixODBC,
php,
}:
buildPecl { buildPecl {
pname = "pdo_sqlsrv"; pname = "pdo_sqlsrv";

View File

@ -1,4 +1,11 @@
{ buildPecl, lib, pcre2, fetchFromGitHub, php, pkg-config }: {
buildPecl,
lib,
pcre2,
fetchFromGitHub,
php,
pkg-config,
}:
buildPecl rec { buildPecl rec {
pname = "phalcon"; pname = "phalcon";
@ -11,7 +18,10 @@ buildPecl rec {
hash = "sha256-AgyV9pxyXcXuhrRgozN2p67u8xZMepbWrzYaBZMFn6k="; hash = "sha256-AgyV9pxyXcXuhrRgozN2p67u8xZMepbWrzYaBZMFn6k=";
}; };
internalDeps = [ php.extensions.session php.extensions.pdo ]; internalDeps = [
php.extensions.session
php.extensions.pdo
];
nativeBuildInputs = [ pkg-config ]; nativeBuildInputs = [ pkg-config ];
buildInputs = [ pcre2 ]; buildInputs = [ pcre2 ];

View File

@ -1,9 +1,11 @@
{ lib {
, fetchFromGitHub lib,
, php fetchFromGitHub,
php,
}: }:
(php.withExtensions({ enabled, all }: enabled ++ (with all; [ ast ]))).buildComposerProject (finalAttrs: { (php.withExtensions ({ enabled, all }: enabled ++ (with all; [ ast ]))).buildComposerProject
(finalAttrs: {
pname = "phan"; pname = "phan";
version = "5.4.3"; version = "5.4.3";

View File

@ -1,9 +1,11 @@
{ lib {
, fetchFromGitHub lib,
, php fetchFromGitHub,
php,
}: }:
(php.withExtensions({ enabled, all }: enabled ++ (with all; [ xsl ]))).buildComposerProject (finalAttrs: { (php.withExtensions ({ enabled, all }: enabled ++ (with all; [ xsl ]))).buildComposerProject
(finalAttrs: {
pname = "phing"; pname = "phing";
version = "3.0.0-rc6"; version = "3.0.0-rc6";

View File

@ -1,6 +1,7 @@
{ lib {
, fetchFromGitHub lib,
, php fetchFromGitHub,
php,
}: }:
php.buildComposerProject (finalAttrs: { php.buildComposerProject (finalAttrs: {

View File

@ -1,6 +1,7 @@
{ fetchFromGitHub {
, lib fetchFromGitHub,
, php lib,
php,
}: }:
php.buildComposerProject (finalAttrs: { php.buildComposerProject (finalAttrs: {

View File

@ -1,6 +1,7 @@
{ lib {
, fetchFromGitHub lib,
, php fetchFromGitHub,
php,
}: }:
php.buildComposerProject (finalAttrs: { php.buildComposerProject (finalAttrs: {

View File

@ -1,6 +1,7 @@
{ fetchFromGitHub {
, lib fetchFromGitHub,
, php lib,
php,
}: }:
php.buildComposerProject (finalAttrs: { php.buildComposerProject (finalAttrs: {

View File

@ -1,6 +1,7 @@
{ lib {
, fetchFromGitHub lib,
, php fetchFromGitHub,
php,
}: }:
php.buildComposerProject (finalAttrs: { php.buildComposerProject (finalAttrs: {

View File

@ -1,6 +1,7 @@
{ lib {
, fetchFromGitHub lib,
, php fetchFromGitHub,
php,
}: }:
php.buildComposerProject (finalAttrs: { php.buildComposerProject (finalAttrs: {

View File

@ -1,9 +1,10 @@
{ lib {
, stdenv lib,
, fetchFromGitHub stdenv,
, php fetchFromGitHub,
, testers php,
, phpPackages testers,
phpPackages,
}: }:
stdenv.mkDerivation (finalAttrs: { stdenv.mkDerivation (finalAttrs: {

View File

@ -1,4 +1,8 @@
{ fetchFromGitHub, lib, php }: {
fetchFromGitHub,
lib,
php,
}:
php.buildComposerProject (finalAttrs: { php.buildComposerProject (finalAttrs: {
pname = "phpstan"; pname = "phpstan";

View File

@ -1,4 +1,8 @@
{ buildPecl, lib, fetchFromGitHub }: {
buildPecl,
lib,
fetchFromGitHub,
}:
buildPecl rec { buildPecl rec {
pname = "pinba"; pname = "pinba";

View File

@ -1,4 +1,8 @@
{ buildPecl, lib, pcre2 }: {
buildPecl,
lib,
pcre2,
}:
buildPecl { buildPecl {
pname = "protobuf"; pname = "protobuf";

View File

@ -1,6 +1,7 @@
{ lib {
, fetchFromGitHub lib,
, php fetchFromGitHub,
php,
}: }:
php.buildComposerProject (finalAttrs: { php.buildComposerProject (finalAttrs: {

View File

@ -1,4 +1,8 @@
{ fetchFromGitHub, lib, php }: {
fetchFromGitHub,
lib,
php,
}:
php.buildComposerProject (finalAttrs: { php.buildComposerProject (finalAttrs: {
pname = "psysh"; pname = "psysh";

View File

@ -1,4 +1,9 @@
{ buildPecl, lib, rdkafka, pcre2 }: {
buildPecl,
lib,
rdkafka,
pcre2,
}:
buildPecl { buildPecl {
pname = "rdkafka"; pname = "rdkafka";
@ -6,7 +11,10 @@ buildPecl {
version = "6.0.3"; version = "6.0.3";
sha256 = "sha256-Euqrl21JaX4x8WOLR4ietexhrbdYcIlBESsVf47H3Ug="; sha256 = "sha256-Euqrl21JaX4x8WOLR4ietexhrbdYcIlBESsVf47H3Ug=";
buildInputs = [ rdkafka pcre2 ]; buildInputs = [
rdkafka
pcre2
];
postPhpize = '' postPhpize = ''
substituteInPlace configure \ substituteInPlace configure \

View File

@ -1,8 +1,14 @@
{ buildPecl, lib, php, fetchFromGitHub }: {
buildPecl,
lib,
php,
fetchFromGitHub,
}:
let let
version = "6.0.2"; version = "6.0.2";
in buildPecl { in
buildPecl {
inherit version; inherit version;
pname = "redis"; pname = "redis";
@ -13,9 +19,7 @@ in buildPecl {
hash = "sha256-Ie31zak6Rqxm2+jGXWg6KN4czHe9e+190jZRQ5VoB+M="; hash = "sha256-Ie31zak6Rqxm2+jGXWg6KN4czHe9e+190jZRQ5VoB+M=";
}; };
internalDeps = with php.extensions; [ internalDeps = with php.extensions; [ session ];
session
];
meta = with lib; { meta = with lib; {
changelog = "https://github.com/phpredis/phpredis/releases/tag/${version}"; changelog = "https://github.com/phpredis/phpredis/releases/tag/${version}";

View File

@ -1,15 +1,16 @@
{ stdenv {
, lib stdenv,
, fetchurl lib,
, php fetchurl,
, openssl php,
, hiredis openssl,
, zstd hiredis,
, lz4 zstd,
, autoPatchelfHook lz4,
, writeShellScript autoPatchelfHook,
, curl writeShellScript,
, common-updater-scripts curl,
common-updater-scripts,
}: }:
let let
@ -53,10 +54,18 @@ let
}; };
}; };
makeSource = { system, phpMajor }: fetchurl { makeSource =
url = "https://builds.r2.relay.so/v${version}/relay-v${version}-php" { system, phpMajor }:
+ phpMajor + "-" + hashes.${system}.platform + ".tar.gz"; fetchurl {
sha256 = hashes.${system}.hash.${phpMajor} or (throw "Unsupported PHP version for relay ${phpMajor} on ${system}"); url =
"https://builds.r2.relay.so/v${version}/relay-v${version}-php"
+ phpMajor
+ "-"
+ hashes.${system}.platform
+ ".tar.gz";
sha256 =
hashes.${system}.hash.${phpMajor}
or (throw "Unsupported PHP version for relay ${phpMajor} on ${system}");
}; };
in in
stdenv.mkDerivation (finalAttrs: { stdenv.mkDerivation (finalAttrs: {
@ -68,39 +77,49 @@ stdenv.mkDerivation (finalAttrs: {
system = stdenv.hostPlatform.system; system = stdenv.hostPlatform.system;
phpMajor = lib.versions.majorMinor php.version; phpMajor = lib.versions.majorMinor php.version;
}; };
nativeBuildInputs = lib.optionals (!stdenv.isDarwin) [ nativeBuildInputs = lib.optionals (!stdenv.isDarwin) [ autoPatchelfHook ];
autoPatchelfHook
];
buildInputs = lib.optionals (!stdenv.isDarwin) [ buildInputs = lib.optionals (!stdenv.isDarwin) [
openssl openssl
zstd zstd
lz4 lz4
]; ];
installPhase = '' installPhase =
''
runHook preInstall runHook preInstall
mkdir -p $out/lib/php/extensions mkdir -p $out/lib/php/extensions
cp relay-pkg.so $out/lib/php/extensions/relay.so cp relay-pkg.so $out/lib/php/extensions/relay.so
chmod +w $out/lib/php/extensions/relay.so chmod +w $out/lib/php/extensions/relay.so
'' + (if stdenv.isDarwin then ''
+ (
if stdenv.isDarwin then
let let
args = lib.strings.concatMapStrings args =
(v: " -change ${v.name}" + " ${lib.strings.makeLibraryPath [ v.value ]}/${builtins.baseNameOf v.name}") lib.strings.concatMapStrings
(with lib.attrsets; [ (
v:
" -change ${v.name}" + " ${lib.strings.makeLibraryPath [ v.value ]}/${builtins.baseNameOf v.name}"
)
(
with lib.attrsets;
[
(nameValuePair "/opt/homebrew/opt/hiredis/lib/libhiredis.1.1.0.dylib" hiredis) (nameValuePair "/opt/homebrew/opt/hiredis/lib/libhiredis.1.1.0.dylib" hiredis)
(nameValuePair "/opt/homebrew/opt/hiredis/lib/libhiredis_ssl.dylib.1.1.0" hiredis) (nameValuePair "/opt/homebrew/opt/hiredis/lib/libhiredis_ssl.dylib.1.1.0" hiredis)
(nameValuePair "/opt/homebrew/opt/openssl@3/lib/libssl.3.dylib" openssl) (nameValuePair "/opt/homebrew/opt/openssl@3/lib/libssl.3.dylib" openssl)
(nameValuePair "/opt/homebrew/opt/openssl@3/lib/libcrypto.3.dylib" openssl) (nameValuePair "/opt/homebrew/opt/openssl@3/lib/libcrypto.3.dylib" openssl)
(nameValuePair "/opt/homebrew/opt/zstd/lib/libzstd.1.dylib" zstd) (nameValuePair "/opt/homebrew/opt/zstd/lib/libzstd.1.dylib" zstd)
(nameValuePair "/opt/homebrew/opt/lz4/lib/liblz4.1.dylib" lz4) (nameValuePair "/opt/homebrew/opt/lz4/lib/liblz4.1.dylib" lz4)
]); ]
);
in in
# fixDarwinDylibNames can't be used here because we need to completely remap .dylibs, not just add absolute paths # fixDarwinDylibNames can't be used here because we need to completely remap .dylibs, not just add absolute paths
'' ''
install_name_tool${args} $out/lib/php/extensions/relay.so install_name_tool${args} $out/lib/php/extensions/relay.so
'' ''
else else
"") + '' ""
)
+ ''
# Random UUID that's required by the extension. Can be anything, but must be different from default. # Random UUID that's required by the extension. Can be anything, but must be different from default.
sed -i "s/00000000-0000-0000-0000-000000000000/aced680f-30e9-40cc-a868-390ead14ba0c/" $out/lib/php/extensions/relay.so sed -i "s/00000000-0000-0000-0000-000000000000/aced680f-30e9-40cc-a868-390ead14ba0c/" $out/lib/php/extensions/relay.so
chmod -w $out/lib/php/extensions/relay.so chmod -w $out/lib/php/extensions/relay.so
@ -111,7 +130,12 @@ stdenv.mkDerivation (finalAttrs: {
passthru = { passthru = {
updateScript = writeShellScript "update-${finalAttrs.pname}" '' updateScript = writeShellScript "update-${finalAttrs.pname}" ''
set -o errexit set -o errexit
export PATH="$PATH:${lib.makeBinPath [ curl common-updater-scripts ]}" export PATH="$PATH:${
lib.makeBinPath [
curl
common-updater-scripts
]
}"
NEW_VERSION=$(curl --silent https://builds.r2.relay.so/meta/builds | tail -n1 | cut -c2-) NEW_VERSION=$(curl --silent https://builds.r2.relay.so/meta/builds | tail -n1 | cut -c2-)
if [[ "${version}" = "$NEW_VERSION" ]]; then if [[ "${version}" = "$NEW_VERSION" ]]; then
@ -129,22 +153,21 @@ stdenv.mkDerivation (finalAttrs: {
updateables = updateables =
builtins.listToAttrs builtins.listToAttrs
# Collect all leaf attributes (containing hashes). # Collect all leaf attributes (containing hashes).
(lib.collect
(attrs: attrs ? name)
# create an attr containing
(lib.mapAttrsRecursive
( (
lib.collect (attrs: attrs ? name)
# create an attr containing
(
lib.mapAttrsRecursive (
path: _value: path: _value:
lib.nameValuePair lib.nameValuePair (builtins.replaceStrings [ "." ] [ "_" ] (lib.concatStringsSep "_" path)) (
(builtins.replaceStrings [ "." ] [ "_" ] (lib.concatStringsSep "_" path)) finalAttrs.finalPackage.overrideAttrs (attrs: {
(finalAttrs.finalPackage.overrideAttrs (attrs: {
src = makeSource { src = makeSource {
system = builtins.head path; system = builtins.head path;
phpMajor = builtins.head (builtins.tail (builtins.tail path)); phpMajor = builtins.head (builtins.tail (builtins.tail path));
}; };
})) })
) )
(lib.filterAttrsRecursive (name: _value: name != "platform") hashes) ) (lib.filterAttrsRecursive (name: _value: name != "platform") hashes)
) )
); );
}; };
@ -155,7 +178,15 @@ stdenv.mkDerivation (finalAttrs: {
homepage = "https://relay.so/"; homepage = "https://relay.so/";
sourceProvenance = [ sourceTypes.binaryNativeCode ]; sourceProvenance = [ sourceTypes.binaryNativeCode ];
license = licenses.unfree; license = licenses.unfree;
maintainers = with maintainers; [ tillkruss ostrolucky ]; maintainers = with maintainers; [
platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; tillkruss
ostrolucky
];
platforms = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
}; };
}) })

View File

@ -1,4 +1,9 @@
{ buildPecl, lib, pkg-config, rrdtool }: {
buildPecl,
lib,
pkg-config,
rrdtool,
}:
buildPecl { buildPecl {
pname = "rrd"; pname = "rrd";
@ -6,7 +11,10 @@ buildPecl {
version = "2.0.3"; version = "2.0.3";
hash = "sha256-pCFh5YzcioU7cs/ymJidy96CsPdkVt1ZzgKFTJK3MPc="; hash = "sha256-pCFh5YzcioU7cs/ymJidy96CsPdkVt1ZzgKFTJK3MPc=";
nativeBuildInputs = [ pkg-config rrdtool ]; nativeBuildInputs = [
pkg-config
rrdtool
];
meta = { meta = {
description = "PHP bindings to RRD tool system"; description = "PHP bindings to RRD tool system";

View File

@ -1,4 +1,9 @@
{ buildPecl, lib, samba, pkg-config }: {
buildPecl,
lib,
samba,
pkg-config,
}:
buildPecl { buildPecl {
pname = "smbclient"; pname = "smbclient";
version = "1.0.6"; version = "1.0.6";

View File

@ -1,11 +1,12 @@
{ stdenv {
, buildPecl stdenv,
, lib buildPecl,
, libiconv lib,
, php libiconv,
, fetchFromGitHub php,
, pcre2 fetchFromGitHub,
, darwin pcre2,
darwin,
}: }:
buildPecl rec { buildPecl rec {
@ -19,23 +20,19 @@ buildPecl rec {
hash = "sha256-NwG8gBaToBaJGrZoCD7bDym7hQidWU0ArckoQCHN81o="; hash = "sha256-NwG8gBaToBaJGrZoCD7bDym7hQidWU0ArckoQCHN81o=";
}; };
buildInputs = [ buildInputs =
pcre2 [ pcre2 ]
] ++ lib.optionals stdenv.isDarwin [ ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk_11_0.frameworks.CoreFoundation darwin.apple_sdk_11_0.frameworks.CoreFoundation
darwin.apple_sdk_11_0.Libsystem darwin.apple_sdk_11_0.Libsystem
libiconv libiconv
]; ];
internalDeps = with php.extensions; [ internalDeps = with php.extensions; [ session ];
session
];
sourceRoot = "${src.name}/src"; sourceRoot = "${src.name}/src";
configureFlags = [ configureFlags = [ "--enable-snuffleupagus" ];
"--enable-snuffleupagus"
];
postPhpize = '' postPhpize = ''
./configure --enable-snuffleupagus ./configure --enable-snuffleupagus

View File

@ -1,8 +1,14 @@
{ buildPecl, lib, fetchFromGitHub, zlib }: {
buildPecl,
lib,
fetchFromGitHub,
zlib,
}:
let let
version = "0.4.15"; version = "0.4.15";
in buildPecl { in
buildPecl {
inherit version; inherit version;
pname = "spx"; pname = "spx";
@ -13,9 +19,7 @@ in buildPecl {
hash = "sha256-gw6wbPt1Qy0vNfT0flq7bxpnGU3SgJvPVhk8H0Imvx4="; hash = "sha256-gw6wbPt1Qy0vNfT0flq7bxpnGU3SgJvPVhk8H0Imvx4=";
}; };
configureFlags = [ configureFlags = [ "--with-zlib-dir=${zlib.dev}" ];
"--with-zlib-dir=${zlib.dev}"
];
preConfigure = '' preConfigure = ''
substituteInPlace Makefile.frag \ substituteInPlace Makefile.frag \

View File

@ -1,4 +1,10 @@
{ stdenv, buildPecl, lib, unixODBC, libiconv }: {
stdenv,
buildPecl,
lib,
unixODBC,
libiconv,
}:
buildPecl { buildPecl {
pname = "sqlsrv"; pname = "sqlsrv";
@ -6,9 +12,7 @@ buildPecl {
version = "5.10.1"; version = "5.10.1";
sha256 = "sha256-XNrttNiihjQ+azuZmS2fy0So+2ndAqpde8IOsupeWdI="; sha256 = "sha256-XNrttNiihjQ+azuZmS2fy0So+2ndAqpde8IOsupeWdI=";
buildInputs = [ buildInputs = [ unixODBC ] ++ lib.optionals stdenv.isDarwin [ libiconv ];
unixODBC
] ++ lib.optionals stdenv.isDarwin [ libiconv ];
meta = with lib; { meta = with lib; {
description = "Microsoft Drivers for PHP for SQL Server"; description = "Microsoft Drivers for PHP for SQL Server";

View File

@ -1,4 +1,8 @@
{ buildPecl, lib, libssh2 }: {
buildPecl,
lib,
libssh2,
}:
buildPecl rec { buildPecl rec {
version = "1.3.1"; version = "1.3.1";

View File

@ -1,15 +1,17 @@
{ lib {
, stdenv lib,
, buildPecl stdenv,
, php buildPecl,
, valgrind php,
, pcre2 valgrind,
, fetchFromGitHub pcre2,
fetchFromGitHub,
}: }:
let let
version = "5.1.2"; version = "5.1.2";
in buildPecl { in
buildPecl {
inherit version; inherit version;
pname = "swoole"; pname = "swoole";

View File

@ -1,4 +1,9 @@
{ buildPecl, lib, fetchFromGitHub, libuv }: {
buildPecl,
lib,
fetchFromGitHub,
libuv,
}:
buildPecl rec { buildPecl rec {
pname = "uv"; pname = "uv";

View File

@ -1,11 +1,13 @@
{ lib {
, buildPecl lib,
, fetchFromGitHub buildPecl,
fetchFromGitHub,
}: }:
let let
version = "0.18.0"; version = "0.18.0";
in buildPecl { in
buildPecl {
inherit version; inherit version;
pname = "vld"; pname = "vld";

View File

@ -1,8 +1,13 @@
{ buildPecl, lib, fetchFromGitHub }: {
buildPecl,
lib,
fetchFromGitHub,
}:
let let
version = "3.3.2"; version = "3.3.2";
in buildPecl { in
buildPecl {
inherit version; inherit version;
pname = "xdebug"; pname = "xdebug";

View File

@ -1,4 +1,9 @@
{ buildPecl, lib, pkg-config, libyaml }: {
buildPecl,
lib,
pkg-config,
libyaml,
}:
buildPecl { buildPecl {
pname = "yaml"; pname = "yaml";
@ -8,7 +13,10 @@ buildPecl {
configureFlags = [ "--with-yaml=${libyaml.dev}" ]; configureFlags = [ "--with-yaml=${libyaml.dev}" ];
nativeBuildInputs = [ pkg-config libyaml ]; nativeBuildInputs = [
pkg-config
libyaml
];
meta = { meta = {
description = "YAML-1.1 parser and emitter"; description = "YAML-1.1 parser and emitter";

View File

@ -1,8 +1,15 @@
{ buildPecl, lib, zstd, pkg-config, fetchFromGitHub }: {
buildPecl,
lib,
zstd,
pkg-config,
fetchFromGitHub,
}:
let let
version = "0.13.3"; version = "0.13.3";
in buildPecl { in
buildPecl {
inherit version; inherit version;
pname = "zstd"; pname = "zstd";
@ -13,15 +20,11 @@ in buildPecl {
hash = "sha256-jEuL93ScF0/FlfUvib6uZafOkIe0+VkWV/frpSjTkvY="; hash = "sha256-jEuL93ScF0/FlfUvib6uZafOkIe0+VkWV/frpSjTkvY=";
}; };
nativeBuildInputs = [ nativeBuildInputs = [ pkg-config ];
pkg-config
];
buildInputs = [ zstd ]; buildInputs = [ zstd ];
configureFlags = [ configureFlags = [ "--with-libzstd" ];
"--with-libzstd"
];
meta = with lib; { meta = with lib; {
description = "Zstd Extension for PHP"; description = "Zstd Extension for PHP";