1{
2 lib,
3 stdenv,
4 fetchurl,
5 cmake,
6}:
7
8stdenv.mkDerivation rec {
9 pname = "libunarr";
10 version = "1.1.1";
11
12 src = fetchurl {
13 url = "https://github.com/selmf/unarr/releases/download/v${version}/unarr-${version}.tar.xz";
14 hash = "sha256-Mo76BOqZbdOJFrEkeozxdqwpuFyvkhdONNMZmN5BdNI=";
15 };
16
17 postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
18 substituteInPlace CMakeLists.txt \
19 --replace "-flto" "" \
20 --replace "AppleClang" "Clang"
21 '';
22
23 nativeBuildInputs = [
24 cmake
25 ];
26
27 meta = with lib; {
28 homepage = "https://github.com/selmf/unarr";
29 description = "Lightweight decompression library with support for rar, tar and zip archives";
30 license = licenses.lgpl3Plus;
31 maintainers = with maintainers; [ wegank ];
32 platforms = platforms.unix;
33 };
34}