Unverified Commit 614182f9 authored by Pol Dellaiera's avatar Pol Dellaiera Committed by GitHub
Browse files

Merge pull request #261582 from NixOS/php/build-support/fix-diff-and-env-vars

php/build-support: fix `diff` command and env. variables
parents 92a73e8b 839498d5
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -71,6 +71,10 @@ let
        composerNoScripts = previousAttrs.composerNoScripts or true;
      };

      COMPOSER_CACHE_DIR="/dev/null";
      COMPOSER_DISABLE_NETWORK="1";
      COMPOSER_MIRROR_PATH_REPOS="1";

      meta = previousAttrs.meta or { } // {
        platforms = lib.platforms.all;
      };
+1 −5
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ composerInstallConfigureHook() {
    fi

    echo "Validating consistency between composer.lock and ${composerRepository}/composer.lock"
    if [[! @diff@ composer.lock "${composerRepository}/composer.lock"]]; then
    if ! @cmp@ -s "composer.lock" "${composerRepository}/composer.lock"; then
        echo
        echo "ERROR: vendorHash is out of date"
        echo
@@ -88,7 +88,6 @@ composerInstallBuildHook() {

    # Since the composer.json file has been modified in the previous step, the
    # composer.lock file needs to be updated.
    COMPOSER_DISABLE_NETWORK=1 \
    COMPOSER_ROOT_VERSION="${version}" \
    composer \
      --lock \
@@ -118,10 +117,7 @@ composerInstallInstallHook() {
    # the autoloader.
    # The COMPOSER_ROOT_VERSION environment variable is needed only for
    # vimeo/psalm.
    COMPOSER_CACHE_DIR=/dev/null \
    COMPOSER_DISABLE_NETWORK=1 \
    COMPOSER_ROOT_VERSION="${version}" \
    COMPOSER_MIRROR_PATH_REPOS="1" \
    composer \
      --no-ansi \
      --no-interaction \
+0 −1
Original line number Diff line number Diff line
@@ -55,7 +55,6 @@ composerRepositoryBuildHook() {
    # Build the local composer repository
    # The command 'build-local-repo' is provided by the Composer plugin
    # nix-community/composer-local-repo-plugin.
    COMPOSER_CACHE_DIR=/dev/null \
    composer-local-repo-plugin --no-ansi build-local-repo ${composerNoDev:+--no-dev} -r repository

    echo "Finished composerRepositoryBuildHook"
+2 −1
Original line number Diff line number Diff line
{ lib
, makeSetupHook
, diffutils
, jq
, moreutils
, makeBinaryWrapper
@@ -22,7 +23,7 @@
      substitutions = {
        # Specify the stdenv's `diff` by abspath to ensure that the user's build
        # inputs do not cause us to find the wrong `diff`.
        diff = "${lib.getBin buildPackages.diffutils}/bin/diff";
        cmp = "${lib.getBin buildPackages.diffutils}/bin/cmp";
      };
    } ./composer-install-hook.sh;
}