Unverified Commit 1476e32c authored by Lin Jian's avatar Lin Jian
Browse files

emacs: handle preUnpack and postUnpack correctly for melpaBuild

Without this patch, if there are preUnpack or postUnpack in the
arguments of melpaBuild, they will override the value set by
melpaBuild.  With this patch applied, the argument and the value set
by melpaBuild are merged instead.
parent 647bee1f
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@
{ lib, stdenv, fetchFromGitHub, emacs, texinfo, writeText, gcc }:

let
  handledArgs = [ "meta" ];
  handledArgs = [ "meta" "preUnpack" "postUnpack" ];
  genericBuild = import ./generic.nix { inherit lib stdenv emacs texinfo writeText gcc; };

  packageBuild = stdenv.mkDerivation {
@@ -66,6 +66,8 @@ in
    (${ename} :fetcher git :url ""
              ${lib.optionalString (files != null) ":files ${files}"})
  '')
, preUnpack ? ""
, postUnpack ? ""
, meta ? {}
, ...
}@args:
@@ -99,12 +101,12 @@ genericBuild ({
    ln -s "$packageBuild" "$NIX_BUILD_TOP/package-build"

    mkdir -p "$NIX_BUILD_TOP/packages"
  '';
  '' + preUnpack;

  postUnpack = ''
    mkdir -p "$NIX_BUILD_TOP/working"
    ln -s "$NIX_BUILD_TOP/$sourceRoot" "$NIX_BUILD_TOP/working/$ename"
  '';
  '' + postUnpack;

  buildPhase = ''
    runHook preBuild