libgpg-error: fix patch no longer applying, refactor

This commit is contained in:
Vladimír Čunát 2014-11-01 20:18:45 +01:00
parent b3d36b0098
commit aa3d54e644
2 changed files with 13 additions and 27 deletions

View file

@ -1,6 +1,6 @@
{ stdenv, fetchurl, bash, gettext }:
{ stdenv, fetchurl, gettext }:
stdenv.mkDerivation (rec {
stdenv.mkDerivation rec {
name = "libgpg-error-1.17";
src = fetchurl {
@ -8,13 +8,22 @@ stdenv.mkDerivation (rec {
sha256 = "1dapxzxl1naghf342fwfc2w2f2c5hb9gr1a1s4n8dsqn26kybx1z";
};
postPatch = "sed '/BUILD_TIMESTAMP=/s/=.*/=1970-01-01T00:00+0000/' -i ./configure";
# If architecture-dependent MO files aren't available, they're generated
# during build, so we need gettext for cross-builds.
crossAttrs.buildInputs = [ gettext ];
doCheck = true;
postConfigure =
stdenv.lib.optionalString stdenv.isSunOS
# For some reason, /bin/sh on OpenIndiana leads to this at the end of the
# `config.status' run:
# ./config.status[1401]: shift: (null): bad number
# (See <http://hydra.nixos.org/build/2931046/nixlog/1/raw>.)
# Thus, re-run it with Bash.
"${stdenv.shell} config.status";
patches = [ ./no-build-timestamp.patch ];
doCheck = true;
meta = {
homepage = "https://www.gnupg.org/related_software/libgpg-error/index.html";
@ -33,15 +42,3 @@ stdenv.mkDerivation (rec {
};
}
//
(stdenv.lib.optionalAttrs stdenv.isSunOS {
# For some reason, /bin/sh on OpenIndiana leads to this at the end of the
# `config.status' run:
# ./config.status[1401]: shift: (null): bad number
# (See <http://hydra.nixos.org/build/2931046/nixlog/1/raw>.)
# Thus, re-run it with Bash.
postConfigure =
'' ${bash}/bin/sh config.status
'';
}))

View file

@ -1,11 +0,0 @@
diff -ur libgpg-error-1.12.orig/configure libgpg-error-1.12/configure
--- libgpg-error-1.12.orig/configure 2013-06-24 06:42:28.000000000 +0200
+++ libgpg-error-1.12/configure 2014-04-09 00:12:47.867856520 +0200
@@ -14585,6 +14585,7 @@
BUILD_TIMESTAMP=`date -u +%Y-%m-%dT%H:%M+0000 2>/dev/null || date`
+BUILD_TIMESTAMP=1970-01-01T00:00+0000
cat >>confdefs.h <<_ACEOF