summary refs log tree commit diff
path: root/pkgs/development/libraries/libgpg-error/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries/libgpg-error/default.nix')
-rw-r--r--pkgs/development/libraries/libgpg-error/default.nix23
1 files changed, 20 insertions, 3 deletions
diff --git a/pkgs/development/libraries/libgpg-error/default.nix b/pkgs/development/libraries/libgpg-error/default.nix
index e6cb62330c4..5c5824a9930 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
+, hostPlatform, 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";
 
@@ -9,6 +24,8 @@ stdenv.mkDerivation rec {
     sha256 = "1li95ni122fzinzlmxbln63nmgij63irxfvi52ws4zfbzv3am4sg";
   };
 
+  patches = if hostPlatform.isRiscV then ./riscv.patch else null;
+
   postPatch = ''
     sed '/BUILD_TIMESTAMP=/s/=.*/=1970-01-01T00:01+0000/' -i ./configure
   '' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
@@ -49,4 +66,4 @@ stdenv.mkDerivation rec {
     platforms = platforms.all;
     maintainers = [ maintainers.fuuzetsu maintainers.vrthra ];
   };
-}
+} // genPosixLockObjOnlyAttrs)