about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/libunarr
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/libunarr')
-rw-r--r--nixpkgs/pkgs/development/libraries/libunarr/default.nix16
1 files changed, 14 insertions, 2 deletions
diff --git a/nixpkgs/pkgs/development/libraries/libunarr/default.nix b/nixpkgs/pkgs/development/libraries/libunarr/default.nix
index 523ce82ce22d..ccf65e64d293 100644
--- a/nixpkgs/pkgs/development/libraries/libunarr/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libunarr/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchurl, cmake }:
+{ lib, stdenv, fetchurl, fetchpatch, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "libunarr";
@@ -11,9 +11,21 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
+  # https://github.com/selmf/unarr/issues/23
+  postPatch = ''
+    substituteInPlace pkg-config.pc.cmake \
+      --replace '$'{prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \
+      --replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@
+  ''
+  # ld: unknown option: --no-undefined
+  + lib.optionalString stdenv.isDarwin ''
+    substituteInPlace CMakeLists.txt \
+      --replace '-Wl,--no-undefined -Wl,--as-needed' '-Wl,-undefined,error'
+  '';
+
   meta = with lib; {
     homepage = "https://github.com/selmf/unarr";
     description = "A lightweight decompression library with support for rar, tar and zip archives";
-    license = licenses.lgpl3;
+    license = licenses.lgpl3Plus;
   };
 }