1{
2 lib,
3 stdenv,
4 fetchFromSourcehut,
5 pkg-config,
6 fuse,
7 libarchive,
8}:
9
10stdenv.mkDerivation (finalAttrs: {
11 pname = "archivemount";
12 version = "1b";
13
14 src = fetchFromSourcehut {
15 owner = "~nabijaczleweli";
16 repo = "archivemount-ng";
17 rev = finalAttrs.version;
18 hash = "sha256-QQeVr3kPLVX543PwM2jtMnVQgkEfiQd09hG9VQvqLng=";
19 };
20
21 nativeBuildInputs = [ pkg-config ];
22 buildInputs = [
23 fuse
24 libarchive
25 ];
26
27 makeFlags = [
28 "PREFIX=${placeholder "out"}"
29 "VERSION=${finalAttrs.version}"
30 ];
31
32 dontConfigure = true;
33
34 # Fix cross-compilation
35 postPatch = ''
36 substituteInPlace Makefile --replace-fail pkg-config "$PKG_CONFIG"
37 '';
38
39 meta = {
40 description = "Gateway between FUSE and libarchive: allows mounting of cpio, .tar.gz, .tar.bz2 archives";
41 changelog = "https://git.sr.ht/~nabijaczleweli/archivemount-ng/refs/${finalAttrs.version}";
42 mainProgram = "archivemount";
43 license = [
44 lib.licenses.lgpl2Plus
45 lib.licenses.bsd0
46 ];
47 platforms = lib.platforms.unix;
48 };
49})