2022-10-26 19:10:02 +02:00
|
|
|
{ lib, stdenv, fetchurl, fetchpatch, cmake }:
|
2018-11-04 11:22:56 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "libunarr";
|
2018-11-04 11:22:56 +01:00
|
|
|
version = "1.0.1";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/selmf/unarr/releases/download/v${version}/unarr-${version}.tar.xz";
|
|
|
|
sha256 = "1db500k6w90qn6qb4j3zcczailmmv81q9lv4bwq516hbncg5p4sl";
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
2022-05-18 13:47:10 +02:00
|
|
|
# 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@
|
2022-10-26 19:10:02 +02:00
|
|
|
''
|
|
|
|
# ld: unknown option: --no-undefined
|
|
|
|
+ lib.optionalString stdenv.isDarwin ''
|
|
|
|
substituteInPlace CMakeLists.txt \
|
|
|
|
--replace '-Wl,--no-undefined -Wl,--as-needed' '-Wl,-undefined,error'
|
2022-05-18 13:47:10 +02:00
|
|
|
'';
|
|
|
|
|
2021-01-21 18:00:13 +01:00
|
|
|
meta = with lib; {
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://github.com/selmf/unarr";
|
2018-11-04 11:22:56 +01:00
|
|
|
description = "A lightweight decompression library with support for rar, tar and zip archives";
|
2022-10-26 19:10:02 +02:00
|
|
|
license = licenses.lgpl3Plus;
|
2018-11-04 11:22:56 +01:00
|
|
|
};
|
|
|
|
}
|