libunarr: fix build on darwin

This commit is contained in:
Weijia Wang 2022-10-26 19:10:02 +02:00
parent b3c0c4979e
commit 26962c8787

View file

@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl, cmake }:
{ lib, stdenv, fetchurl, fetchpatch, cmake }:
stdenv.mkDerivation rec {
pname = "libunarr";
@ -16,11 +16,16 @@ stdenv.mkDerivation rec {
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;
};
}