about summary refs log tree commit diff
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2018-02-24 20:51:04 -0500
committerShea Levy <shea@shealevy.com>2018-02-24 20:51:04 -0500
commit7d7b7a03fa4b2d226b8c4122c2329a4dffffc019 (patch)
tree0925f26091469c4151d2091c803c595058b8ff96
parent3d8a664729c5311a76fb6ef8e75c65118bfee2f8 (diff)
downloadnixlib-7d7b7a03fa4b2d226b8c4122c2329a4dffffc019.tar
nixlib-7d7b7a03fa4b2d226b8c4122c2329a4dffffc019.tar.gz
nixlib-7d7b7a03fa4b2d226b8c4122c2329a4dffffc019.tar.bz2
nixlib-7d7b7a03fa4b2d226b8c4122c2329a4dffffc019.tar.lz
nixlib-7d7b7a03fa4b2d226b8c4122c2329a4dffffc019.tar.xz
nixlib-7d7b7a03fa4b2d226b8c4122c2329a4dffffc019.tar.zst
nixlib-7d7b7a03fa4b2d226b8c4122c2329a4dffffc019.zip
libgpgperror: Add derivation for gen-posix-lock-obj to help in cross-compilation
-rw-r--r--pkgs/development/libraries/libgpg-error/default.nix21
-rw-r--r--pkgs/top-level/all-packages.nix5
2 files changed, 23 insertions, 3 deletions
diff --git a/pkgs/development/libraries/libgpg-error/default.nix b/pkgs/development/libraries/libgpg-error/default.nix
index e6cb62330c4e..9511d2314249 100644
--- a/pkgs/development/libraries/libgpg-error/default.nix
+++ b/pkgs/development/libraries/libgpg-error/default.nix
@@ -1,6 +1,21 @@
-{ stdenv, buildPackages, fetchurl, gettext }:
+{ stdenv, buildPackages, fetchurl, gettext
+, genPosixLockObjOnly ? false
+}: let
+  genPosixLockObjOnlyAttrs = stdenv.lib.optionalAttrs genPosixLockObjOnly {
+    buildPhase = ''
+      cd src
+      make gen-posix-lock-obj
+    '';
+
+    installPhase = ''
+      mkdir -p $out/bin
+      install -m755 gen-posix-lock-obj $out/bin
+    '';
 
-stdenv.mkDerivation rec {
+    outputs = [ "out" ];
+    outputBin = "out";
+  };
+in stdenv.mkDerivation (rec {
   name = "libgpg-error-${version}";
   version = "1.27";
 
@@ -49,4 +64,4 @@ stdenv.mkDerivation rec {
     platforms = platforms.all;
     maintainers = [ maintainers.fuuzetsu maintainers.vrthra ];
   };
-}
+} // genPosixLockObjOnlyAttrs)
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 3e8158ec3a47..675ad092a30f 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -9714,6 +9714,11 @@ with pkgs;
 
   libgpgerror = callPackage ../development/libraries/libgpg-error { };
 
+  # https://github.com/gpg/libgpg-error/blob/70058cd9f944d620764e57c838209afae8a58c78/README#L118-L140
+  libgpgerror-gen-posix-lock-obj = libgpgerror.override {
+    genPosixLockObjOnly = true;
+  };
+
   libgphoto2 = callPackage ../development/libraries/libgphoto2 { };
 
   libgpod = callPackage ../development/libraries/libgpod {