1 { lib, stdenv, fetchurl, openssl, libbsd }:
3 stdenv.mkDerivation rec {
8 url = "http://ftp.de.debian.org/debian/pool/main/h/hfsprogs/hfsprogs_${version}-11.debian.tar.gz";
9 sha256 = "62d9b8599c66ebffbc57ce5d776e20b41341130d9b27341d63bda08460ebde7c";
12 url = "https://opensource.apple.com/tarballs/diskdev_cmds/diskdev_cmds-${version}.tar.gz";
13 sha256 = "74c9aeca899ed7f4bf155c65fc45bf0f250c0f6d57360ea953b1d536d9aa45e6";
18 sed -ie '/sys\/sysctl.h/d' newfs_hfs.tproj/makehfs.c
21 sourceRoot = "diskdev_cmds-" + version;
22 patches = [ "../debian/patches/*.patch" ];
24 buildInputs = [ openssl libbsd ];
25 makefile = "Makefile.lnx";
27 # Inspired by PKGBUILD of https://www.archlinux.org/packages/community/x86_64/hfsprogs/
29 # Create required package directories
30 install -m 755 -d "$out/bin"
31 install -m 755 -d "$out/share/hfsprogs"
32 install -m 755 -d "$out/share/man/man8/"
34 install -m 755 "newfs_hfs.tproj/newfs_hfs" "$out/bin/mkfs.hfsplus"
35 install -m 755 "fsck_hfs.tproj/fsck_hfs" "$out/bin/fsck.hfsplus"
37 install -m 644 "newfs_hfs.tproj/hfsbootdata.img" "$out/share/hfsprogs/hfsbootdata"
39 install -m 644 "newfs_hfs.tproj/newfs_hfs.8" "$out/share/man/man8/mkfs.hfsplus.8"
40 install -m 644 "fsck_hfs.tproj/fsck_hfs.8" "$out/share/man/man8/fsck.hfsplus.8"
44 description = "HFS/HFS+ user space utils";
45 license = lib.licenses.apsl20;
46 platforms = lib.platforms.linux;