Skip to content

Commit

Permalink
php: update svanderburg/composer2nix and php-amqplib/php-amqplib
Browse files Browse the repository at this point in the history
  • Loading branch information
cole-h committed May 19, 2024
1 parent 0cd3543 commit 1d74f57
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 68 deletions.
11 changes: 8 additions & 3 deletions php/composer-env.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@

let
inherit (phpPackages) composer;

filterSrc = src:
builtins.filterSource (path: type: type != "directory" || (baseNameOf path != ".git" && baseNameOf path != ".git" && baseNameOf path != ".svn")) src;

buildZipPackage = { name, src }:
stdenv.mkDerivation {
inherit name src;
buildInputs = [ unzip ];
nativeBuildInputs = [ unzip ];
buildCommand = ''
shopt -s dotglob
unzip $src
baseDir=$(find . -type d -mindepth 1 -maxdepth 1)
cd $baseDir
Expand Down Expand Up @@ -133,10 +138,9 @@ let
''}
'') (builtins.attrNames dependencies);

extraArgs = removeAttrs args [ "name" "packages" "devPackages" "buildInputs" ];
extraArgs = removeAttrs args [ "packages" "devPackages" "buildInputs" ];
in
stdenv.mkDerivation ({
name = "composer-${name}";
buildInputs = [ php composer ] ++ buildInputs;

inherit unpackPhase buildPhase;
Expand Down Expand Up @@ -233,6 +237,7 @@ let
} // extraArgs);
in
{
inherit filterSrc;
composer = lib.makeOverridable composer;
buildZipPackage = lib.makeOverridable buildZipPackage;
buildPackage = lib.makeOverridable buildPackage;
Expand Down
4 changes: 2 additions & 2 deletions php/composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "nixos/ofborg-webhook",
"require": {
"php-amqplib/php-amqplib": ">=2.6.1",
"svanderburg/composer2nix": ">=0.0.3"
"php-amqplib/php-amqplib": ">=3.6.2",
"svanderburg/composer2nix": ">=0.0.6"
}
}
81 changes: 37 additions & 44 deletions php/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions php/default.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{pkgs ? import <nixpkgs> {
inherit system;
}, system ? builtins.currentSystem, noDev ? false}:
}, system ? builtins.currentSystem, noDev ? false, php ? pkgs.php, phpPackages ? pkgs.phpPackages}:

let
composerEnv = import ./composer-env.nix {
inherit (pkgs) stdenv lib writeTextFile fetchurl unzip phpPackages;
php = pkgs.php74;
inherit (pkgs) stdenv lib writeTextFile fetchurl unzip;
inherit php phpPackages;
};
in
import ./php-packages.nix {
Expand Down
32 changes: 16 additions & 16 deletions php/php-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ let
"paragonie/constant_time_encoding" = {
targetDir = "";
src = composerEnv.buildZipPackage {
name = "paragonie-constant_time_encoding-f34c2b11eb9d2c9318e13540a1dbc2a3afbd939c";
name = "paragonie-constant_time_encoding-52a0d99e69f56b9ec27ace92ba56897fe6993105";
src = fetchurl {
url = "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/f34c2b11eb9d2c9318e13540a1dbc2a3afbd939c";
sha256 = "1r1xj3j7s5mskw5gh3ars4dfhvcn7d252gdqgpif80026kj5fvrp";
url = "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/52a0d99e69f56b9ec27ace92ba56897fe6993105";
sha256 = "1ja5b3fm5v665igrd37vs28zdipbh1xgh57lil2iaggvh1b8kh4x";
};
};
};
Expand All @@ -25,40 +25,40 @@ let
"php-amqplib/php-amqplib" = {
targetDir = "";
src = composerEnv.buildZipPackage {
name = "php-amqplib-php-amqplib-c0a8eade209b7e43d6a405303d8de716dfd02749";
name = "php-amqplib-php-amqplib-cb514530ce45a6d2f636be5196010c47c3bcf6e0";
src = fetchurl {
url = "https://api.github.com/repos/php-amqplib/php-amqplib/zipball/c0a8eade209b7e43d6a405303d8de716dfd02749";
sha256 = "1lck5hpraxi4w3831lfzz6l7c82118b56aghdz0dr4r92366j3xf";
url = "https://api.github.com/repos/php-amqplib/php-amqplib/zipball/cb514530ce45a6d2f636be5196010c47c3bcf6e0";
sha256 = "0mjca0m9960m8xgi22azwk8v1lgg8yznxscw10sqfzgp4wj4sfv0";
};
};
};
"phpseclib/phpseclib" = {
targetDir = "";
src = composerEnv.buildZipPackage {
name = "phpseclib-phpseclib-d9615a6fb970d9933866ca8b4036ec3407b020b6";
name = "phpseclib-phpseclib-cfa2013d0f68c062055180dd4328cc8b9d1f30b8";
src = fetchurl {
url = "https://api.github.com/repos/phpseclib/phpseclib/zipball/d9615a6fb970d9933866ca8b4036ec3407b020b6";
sha256 = "1xyymb11qdx8rn6c9bx9js8yq405bmjq8ar8phvpji9a3fdd6z4v";
url = "https://api.github.com/repos/phpseclib/phpseclib/zipball/cfa2013d0f68c062055180dd4328cc8b9d1f30b8";
sha256 = "1wgzy4fbj565czpn9xasr8lnd9ilh1x3bsalrpx5bskvqr4zspgj";
};
};
};
"svanderburg/composer2nix" = {
targetDir = "";
src = composerEnv.buildZipPackage {
name = "svanderburg-composer2nix-9983c6fafb277f6b305edf232c2690d6d28ec092";
name = "svanderburg-composer2nix-299caca4aac42d7639a42eb4dde951c010f6e91c";
src = fetchurl {
url = "https://api.github.com/repos/svanderburg/composer2nix/zipball/9983c6fafb277f6b305edf232c2690d6d28ec092";
sha256 = "1s1gv2b4y9pjv56mif8fgch56sssdmrcwb1gk3gksxc0jq2w2zbv";
url = "https://api.github.com/repos/svanderburg/composer2nix/zipball/299caca4aac42d7639a42eb4dde951c010f6e91c";
sha256 = "0vb7q4za6z89azz4c5v7hgcv9gblcpk7hffl6va7q5f27fyyhwy0";
};
};
};
"svanderburg/pndp" = {
targetDir = "";
src = composerEnv.buildZipPackage {
name = "svanderburg-pndp-4bfe9c4120c23354ab8dc295957dc3009a39bff0";
name = "svanderburg-pndp-bc795b341d95c24bb577e0d7a4a37fde98b1cce8";
src = fetchurl {
url = "https://api.github.com/repos/svanderburg/pndp/zipball/4bfe9c4120c23354ab8dc295957dc3009a39bff0";
sha256 = "0n2vwpwshv16bhb7a6j95m664zh4lpfa7dqmcyhmn89nxpgvg91y";
url = "https://api.github.com/repos/svanderburg/pndp/zipball/bc795b341d95c24bb577e0d7a4a37fde98b1cce8";
sha256 = "1y46wsccjwdkvs1c1bklwbp7crsg0axyr7ncdibbny1sr54xb24i";
};
};
};
Expand All @@ -68,7 +68,7 @@ in
composerEnv.buildPackage {
inherit packages devPackages noDev;
name = "nixos-ofborg-webhook";
src = ./.;
src = composerEnv.filterSrc ./.;
executable = false;
symlinkDependencies = false;
meta = {};
Expand Down

0 comments on commit 1d74f57

Please sign in to comment.