1 { lib, stdenv, fetchurl, cpio, xar, undmg, libtapi, DiskArbitration }:
3 stdenv.mkDerivation rec {
4 pname = "macfuse-stubs";
8 url = "https://github.com/osxfuse/osxfuse/releases/download/macfuse-${version}/macfuse-${version}.dmg";
9 hash = "sha256-ucTzO2qdN4QkowMVvC3+4pjEVjbwMsB0xFk+bvQxwtQ=";
12 nativeBuildInputs = [ cpio xar undmg libtapi ];
13 propagatedBuildInputs = [ DiskArbitration ];
16 xar -xf 'Install macFUSE.pkg'
18 gunzip -dc Payload | cpio -i
26 tapi stubify --filetype=tbd-v2 "$f" -o "''${f%%.dylib}.tbd"
28 sed -i "s|^prefix=.*|prefix=$out|" pkgconfig/fuse.pc
32 # NOTE: Keep in mind that different parts of macFUSE are distributed under a
35 mkdir -p $out/include $out/lib/pkgconfig
36 cp usr/local/lib/*.tbd $out/lib
37 cp usr/local/lib/pkgconfig/*.pc $out/lib/pkgconfig
38 cp -R usr/local/include/* $out/include
42 homepage = "https://osxfuse.github.io";
43 description = "Build time stubs for FUSE on macOS";
45 macFUSE is required for this package to work on macOS. To install macFUSE,
46 use the installer from the <link xlink:href="https://osxfuse.github.io/">
47 project website</link>.
49 platforms = platforms.darwin;
50 maintainers = with maintainers; [ midchildan ];
52 # macFUSE as a whole includes code with restrictions on commercial
53 # redistribution. However, the build artifacts that we actually touch for
54 # this derivation are distributed under a free license.
55 license = with licenses; [
61 macFUSE is required for this package to work on macOS. To install macFUSE,
62 use the installer from the <link xlink:href="https://osxfuse.github.io/">
63 project website</link>.