Browse Source

updates

master
Lucian Pricop 2 years ago
parent
commit
8f62cc8e16
  1. 20
      pkgs/composer-env.nix
  2. 14
      pkgs/default.nix
  3. 4
      pkgs/sandd-main.nix
  4. 38
      pkgs/testing.nix

20
pkgs/composer-env.nix

@ -57,7 +57,7 @@ let
else
$allPackages = array();
${stdenv.lib.optionalString (!noDev) ''
${lib.optionalString (!noDev) ''
if(array_key_exists("packages-dev", $config))
$allPackages = array_merge($allPackages, $config["packages-dev"]);
''}
@ -108,7 +108,7 @@ let
};
bundleDependencies = dependencies:
stdenv.lib.concatMapStrings (dependencyName:
lib.concatMapStrings (dependencyName:
let
dependency = dependencies.${dependencyName};
in
@ -179,24 +179,24 @@ let
# Copy or symlink the provided dependencies
cd vendor
${bundleDependencies packages}
${stdenv.lib.optionalString (!noDev) (bundleDependencies devPackages)}
${lib.optionalString (!noDev) (bundleDependencies devPackages)}
cd ..
# Reconstruct autoload scripts
# We use the optimize feature because Nix packages cannot change after they have been built
# Using the dynamic loader for a Nix package is useless since there is nothing to dynamically reload.
composer dump-autoload --optimize ${stdenv.lib.optionalString noDev "--no-dev"}
composer dump-autoload --optimize ${lib.optionalString noDev "--no-dev"}
# Run the install step as a validation to confirm that everything works out as expected
composer install --optimize-autoloader ${stdenv.lib.optionalString noDev "--no-dev"}
composer install --optimize-autoloader ${lib.optionalString noDev "--no-dev"}
${stdenv.lib.optionalString executable ''
${lib.optionalString executable ''
# Reconstruct the bin/ folder if we deploy an executable project
${constructBin} composer.json
ln -s $(pwd)/vendor/bin $out/bin
''}
${stdenv.lib.optionalString (!symlinkDependencies) ''
${lib.optionalString (!symlinkDependencies) ''
# Patch the shebangs if possible
if [ -d $(pwd)/vendor/bin ]
then
@ -232,7 +232,7 @@ let
} // extraArgs);
in
{
composer = stdenv.lib.makeOverridable composer;
buildZipPackage = stdenv.lib.makeOverridable buildZipPackage;
buildPackage = stdenv.lib.makeOverridable buildPackage;
composer = lib.makeOverridable composer;
buildZipPackage = lib.makeOverridable buildZipPackage;
buildPackage = lib.makeOverridable buildPackage;
}

14
pkgs/earlier.nix → pkgs/default.nix

@ -4,14 +4,14 @@
}:
let
name = "search-and-displace";
# gitStore = builtins.fetchGit {
# url = "https://github.com/searchanddisplace/searchanddisplace.git";
# ref = "master";
# };
gitStore = builtins.fetchGit {
url = "https://git.law/newroco/searchanddisplace-ingest.git";
ref = "master";
};
# builtins.filterSource
# (path: type: baseNameOf path != "sandd-php-packages.nix" || baseNameOf path != "earlier.nix" || baseNameOf path != "composer-env.nix")
# (path: type: baseNameOf path != "sandd-php-packages.nix" || baseNameOf path != "testing.nix" || baseNameOf path != "composer-env.nix")
# (builtins.fetchGit {
# url = "https://github.com/searchanddisplace/searchanddisplace.git";
# url = "https://git.law/newroco/searchanddisplace-ingest.git";
# ref = "master";
# });
@ -23,7 +23,7 @@ let
phpPackage = import ./sandd-php-packages.nix {
inherit composerEnv;
inherit (pkgs) fetchurl fetchgit fetchhg fetchsvn;
#src = gitStore;
src = gitStore;
noDev = true; # Disable development dependencies
inherit name;
};

4
pkgs/sandd-main.nix

@ -1,9 +1,9 @@
with import <nixpkgs>{};
{ stdenv, fetchGit, sbcl, unzip, curl, git, openssl, php, phpPackages, nodejs}:
let
name = "search-and-displace";
gitStore = builtins.fetchGit {
url = "https://github.com/searchanddisplace/searchanddisplace.git";
#url = "https://github.com/newroco/rocket_integration.git";
url = "https://git.law/newroco/searchanddisplace.git";
ref = "master";
};
inherit (phpPackages) composer;

38
pkgs/testing.nix

@ -0,0 +1,38 @@
{ pkgs ? import <nixpkgs> {
inherit system;
}, system ? builtins.currentSystem
}:
let
name = "search-and-displace";
gitStore = builtins.fetchGit {
url = "https://git.law/newroco/searchanddisplace-ingest.git";
ref = "master";
};
# builtins.filterSource
# (path: type: baseNameOf path != "sandd-php-packages.nix" || baseNameOf path != "testing.nix" || baseNameOf path != "composer-env.nix")
# (builtins.fetchGit {
# url = "https://git.law/newroco/searchanddisplace-ingest.git";
# ref = "master";
# });
inherit (pkgs) stdenv;
composerEnv = import ./composer-env.nix {
inherit (pkgs) stdenv writeTextFile fetchurl php unzip phpPackages;
};
phpPackage = import ./sandd-php-packages.nix {
inherit composerEnv;
inherit (pkgs) fetchurl fetchgit fetchhg fetchsvn;
src = gitStore;
noDev = true; # Disable development dependencies
inherit name;
};
in
phpPackage.override {
removeComposerArtifacts = true; # Remove composer configuration files
buildInputs = [ pkgs.git ]; # Add here any environment dependency
# Add below all lines of post installation instructions e.g ''npm install'' ?
postInstall = ''
ll ./
'';
}
Loading…
Cancel
Save