libgpgerror: fix cross-compilation

Fixes e.g. pkgsCross.aarch64-multiplatform.libgpgerror
This commit is contained in:
Ryan Burns 2021-08-14 22:38:08 -07:00
parent 000973d1a1
commit 909558eb27

View file

@ -1,4 +1,5 @@
{ stdenv, lib, buildPackages, fetchurl, gettext
, fetchpatch
, genPosixLockObjOnly ? false
}: let
genPosixLockObjOnlyAttrs = lib.optionalAttrs genPosixLockObjOnly {
@ -24,6 +25,15 @@ in stdenv.mkDerivation (rec {
sha256 = "sha256-/AfnD2xhX4xPWQqON6m43S4soelAj45gRZxnRSuSXiM=";
};
patches = lib.optionals (with stdenv; buildPlatform != hostPlatform) [
# Fix cross-compilation, remove in next release
# TODO apply unconditionally
(fetchpatch {
url = "https://github.com/gpg/libgpg-error/commit/33593864cd54143db594c4237bba41e14179061c.patch";
sha256 = "1jnd7flaj5nlc7spa6mwwygmh5fajw1n8js8f23jpw4pbgvgdv4r";
})
];
postPatch = ''
sed '/BUILD_TIMESTAMP=/s/=.*/=1970-01-01T00:01+0000/' -i ./configure
'' + lib.optionalString (stdenv.hostPlatform.isAarch32 && stdenv.buildPlatform != stdenv.hostPlatform) ''