about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/misc/bibutils
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-06-22 15:01:47 +0000
committerAlyssa Ross <hi@alyssa.is>2021-06-22 16:57:59 +0000
commit633cab0ecb07627706c6b523e219490f019eaab5 (patch)
tree4fb472bdfe2723037dad53dc1b8a87c939015f5e /nixpkgs/pkgs/tools/misc/bibutils
parentffb691c199e7e0cbc4e45e5310779c9e3f7c2a73 (diff)
parent432fc2d9a67f92e05438dff5fdc2b39d33f77997 (diff)
downloadnixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar
nixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar.gz
nixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar.bz2
nixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar.lz
nixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar.xz
nixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar.zst
nixlib-633cab0ecb07627706c6b523e219490f019eaab5.zip
Merge commit '432fc2d9a67f92e05438dff5fdc2b39d33f77997'
# Conflicts:
#	nixpkgs/pkgs/applications/editors/emacs/elisp-packages/elpa-generated.nix
#	nixpkgs/pkgs/applications/networking/mailreaders/thunderbird/default.nix
#	nixpkgs/pkgs/applications/window-managers/sway/default.nix
#	nixpkgs/pkgs/build-support/rust/default.nix
#	nixpkgs/pkgs/development/go-modules/generic/default.nix
Diffstat (limited to 'nixpkgs/pkgs/tools/misc/bibutils')
-rw-r--r--nixpkgs/pkgs/tools/misc/bibutils/default.nix22
1 files changed, 19 insertions, 3 deletions
diff --git a/nixpkgs/pkgs/tools/misc/bibutils/default.nix b/nixpkgs/pkgs/tools/misc/bibutils/default.nix
index cf42e56b5717..03b35811bc5b 100644
--- a/nixpkgs/pkgs/tools/misc/bibutils/default.nix
+++ b/nixpkgs/pkgs/tools/misc/bibutils/default.nix
@@ -1,4 +1,8 @@
-{ lib, stdenv, fetchurl }:
+{ lib
+, stdenv
+, fetchurl
+, static ? stdenv.hostPlatform.isStatic
+}:
 
 stdenv.mkDerivation rec {
   pname = "bibutils";
@@ -9,11 +13,23 @@ stdenv.mkDerivation rec {
     sha256 = "15p4av74ihsg03j854dkdqihpspwnp58p9g1lhx48w8kz91c0ml6";
   };
 
-  configureFlags = [ "--dynamic" "--install-dir" "$(out)/bin" "--install-lib" "$(out)/lib" ];
+  preConfigure = lib.optionalString stdenv.isDarwin ''
+    substituteInPlace lib/Makefile.dynamic \
+      --replace '-Wl,-soname,$(SONAME)' ""
+  '';
+
+  configureFlags = [
+    (if static then "--static" else "--dynamic")
+    "--install-dir" "$(out)/bin"
+    "--install-lib" "$(out)/lib"
+  ];
   dontAddPrefix = true;
 
   doCheck = true;
   checkTarget = "test";
+  preCheck = lib.optionalString stdenv.isDarwin ''
+    export DYLD_LIBRARY_PATH=`pwd`/lib
+  '';
 
   meta = with lib; {
     description = "Bibliography format interconversion";
@@ -21,6 +37,6 @@ stdenv.mkDerivation rec {
     homepage = "https://sourceforge.net/p/bibutils/home/Bibutils/";
     license = licenses.gpl2;
     maintainers = [ maintainers.garrison ];
-    platforms = platforms.linux;
+    platforms = platforms.unix;
   };
 }