about summary refs log tree commit diff
path: root/pkgs/development/libraries/libmd
diff options
context:
space:
mode:
authorNikolay Korotkiy <sikmir@disroot.org>2022-07-09 15:35:17 +0300
committerNikolay Korotkiy <sikmir@disroot.org>2022-07-09 18:54:44 +0300
commitefa78245a3dbb7b06872fdc6d80902fde70342ca (patch)
tree4206abcf8c60093dfe13a356ea0ca11195abb266 /pkgs/development/libraries/libmd
parent089504d5a02ed283f06cdea4623a6114a44b2270 (diff)
libmd: enable on darwin
Diffstat (limited to 'pkgs/development/libraries/libmd')
-rw-r--r--pkgs/development/libraries/libmd/default.nix18
1 files changed, 15 insertions, 3 deletions
diff --git a/pkgs/development/libraries/libmd/default.nix b/pkgs/development/libraries/libmd/default.nix
index a429cb219d582..ad3d8f0cce406 100644
--- a/pkgs/development/libraries/libmd/default.nix
+++ b/pkgs/development/libraries/libmd/default.nix
@@ -1,14 +1,26 @@
-{ lib, stdenv, fetchurl, autoreconfHook }:
+{ lib, stdenv, fetchurl, fetchpatch, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   pname = "libmd";
   version = "1.0.4";
 
   src = fetchurl {
-    url = "https://archive.hadrons.org/software/${pname}/${pname}-${version}.tar.xz";
+    urls = [
+      "https://archive.hadrons.org/software/libmd/libmd-${version}.tar.xz"
+      "https://libbsd.freedesktop.org/releases/libmd-${version}.tar.xz"
+    ];
     sha256 = "sha256-9RySEELjS+3e3tS3VVdlZVnPWx8kSAM7TB7sEcB+Uw8=";
   };
 
+  patches = [
+    # Drop aliases for SHA384 functions, because such aliases are not supported on Darwin.
+    (fetchpatch {
+      url = "https://github.com/macports/macports-ports/raw/8332f5dbcaf05a02bc31fbd4ccf735e7d5c9a5b0/devel/libmd/files/patch-symbol-alias.diff";
+      sha256 = "sha256-py5hMpKYKwtBzhWn01lFc2a6+OZN72YCYXyhg1qe6rg=";
+      extraPrefix = "";
+    })
+  ];
+
   nativeBuildInputs = [ autoreconfHook ];
 
   meta = with lib; {
@@ -18,6 +30,6 @@ stdenv.mkDerivation rec {
     description = "Message Digest functions from BSD systems";
     license = with licenses; [ bsd3 bsd2 isc beerware publicDomain ];
     maintainers = with maintainers; [ primeos ];
-    platforms = platforms.linux;
+    platforms = platforms.unix;
   };
 }