2023-01-30 22:30:04 +00:00
|
|
|
{ lib, stdenv, fetchurl, fetchFromGitHub, openssl, libbsd }:
|
2018-05-02 01:15:51 +00:00
|
|
|
|
treewide: noop: refer to `src.name` or similar where appropriate, part 3: more use cases
This continues where d8f7f6a5cee067b81bfaaa3aa079adb94ed7c01e left off. Similarly
to that commit, this commit this also points `sourceRoot`s to `src.name` and similar
instead of keeping hardcoded names, and edits other derivation attrs do do the same,
where appropriate.
Also, similarly to d8f7f6a5cee067b81bfaaa3aa079adb94ed7c01e some of expressions this
edits use `srcs` attribute with customly-named sources, so they have to be moved
into `let` blocks to keep evaluation efficient (the other, worse, way to do this
would to recurcively refer to `elemAt n finalAttrs.srcs` or, similarly, with `rec`).
2023-08-08 17:18:01 +00:00
|
|
|
let
|
2021-12-01 12:46:39 +00:00
|
|
|
version = "332.25";
|
treewide: noop: refer to `src.name` or similar where appropriate, part 3: more use cases
This continues where d8f7f6a5cee067b81bfaaa3aa079adb94ed7c01e left off. Similarly
to that commit, this commit this also points `sourceRoot`s to `src.name` and similar
instead of keeping hardcoded names, and edits other derivation attrs do do the same,
where appropriate.
Also, similarly to d8f7f6a5cee067b81bfaaa3aa079adb94ed7c01e some of expressions this
edits use `srcs` attribute with customly-named sources, so they have to be moved
into `let` blocks to keep evaluation efficient (the other, worse, way to do this
would to recurcively refer to `elemAt n finalAttrs.srcs` or, similarly, with `rec`).
2023-08-08 17:18:01 +00:00
|
|
|
|
|
|
|
apple_src = fetchFromGitHub {
|
|
|
|
owner = "apple-oss-distributions";
|
|
|
|
repo = "diskdev_cmds";
|
|
|
|
rev = "diskdev_cmds-${version}";
|
|
|
|
hash = "sha256-cycPGPx2Gbjn4FKGKuQKJkh+dWGbJfy6C+LTz8rrs0A=";
|
|
|
|
name = "diskdev_cmds-${version}";
|
|
|
|
};
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-12-01 12:46:39 +00:00
|
|
|
pname = "hfsprogs";
|
treewide: noop: refer to `src.name` or similar where appropriate, part 3: more use cases
This continues where d8f7f6a5cee067b81bfaaa3aa079adb94ed7c01e left off. Similarly
to that commit, this commit this also points `sourceRoot`s to `src.name` and similar
instead of keeping hardcoded names, and edits other derivation attrs do do the same,
where appropriate.
Also, similarly to d8f7f6a5cee067b81bfaaa3aa079adb94ed7c01e some of expressions this
edits use `srcs` attribute with customly-named sources, so they have to be moved
into `let` blocks to keep evaluation efficient (the other, worse, way to do this
would to recurcively refer to `elemAt n finalAttrs.srcs` or, similarly, with `rec`).
2023-08-08 17:18:01 +00:00
|
|
|
inherit version;
|
|
|
|
|
2018-05-02 01:15:51 +00:00
|
|
|
srcs = [
|
|
|
|
(fetchurl {
|
2021-12-01 12:46:39 +00:00
|
|
|
url = "http://ftp.de.debian.org/debian/pool/main/h/hfsprogs/hfsprogs_${version}-11.debian.tar.gz";
|
2018-05-02 01:15:51 +00:00
|
|
|
sha256 = "62d9b8599c66ebffbc57ce5d776e20b41341130d9b27341d63bda08460ebde7c";
|
|
|
|
})
|
treewide: noop: refer to `src.name` or similar where appropriate, part 3: more use cases
This continues where d8f7f6a5cee067b81bfaaa3aa079adb94ed7c01e left off. Similarly
to that commit, this commit this also points `sourceRoot`s to `src.name` and similar
instead of keeping hardcoded names, and edits other derivation attrs do do the same,
where appropriate.
Also, similarly to d8f7f6a5cee067b81bfaaa3aa079adb94ed7c01e some of expressions this
edits use `srcs` attribute with customly-named sources, so they have to be moved
into `let` blocks to keep evaluation efficient (the other, worse, way to do this
would to recurcively refer to `elemAt n finalAttrs.srcs` or, similarly, with `rec`).
2023-08-08 17:18:01 +00:00
|
|
|
apple_src
|
2018-05-02 01:15:51 +00:00
|
|
|
];
|
|
|
|
|
2020-08-16 12:29:23 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -ie '/sys\/sysctl.h/d' newfs_hfs.tproj/makehfs.c
|
|
|
|
'';
|
|
|
|
|
treewide: noop: refer to `src.name` or similar where appropriate, part 3: more use cases
This continues where d8f7f6a5cee067b81bfaaa3aa079adb94ed7c01e left off. Similarly
to that commit, this commit this also points `sourceRoot`s to `src.name` and similar
instead of keeping hardcoded names, and edits other derivation attrs do do the same,
where appropriate.
Also, similarly to d8f7f6a5cee067b81bfaaa3aa079adb94ed7c01e some of expressions this
edits use `srcs` attribute with customly-named sources, so they have to be moved
into `let` blocks to keep evaluation efficient (the other, worse, way to do this
would to recurcively refer to `elemAt n finalAttrs.srcs` or, similarly, with `rec`).
2023-08-08 17:18:01 +00:00
|
|
|
sourceRoot = apple_src.name;
|
2018-05-02 01:15:51 +00:00
|
|
|
patches = [ "../debian/patches/*.patch" ];
|
|
|
|
|
|
|
|
buildInputs = [ openssl libbsd ];
|
|
|
|
makefile = "Makefile.lnx";
|
|
|
|
|
|
|
|
# Inspired by PKGBUILD of https://www.archlinux.org/packages/community/x86_64/hfsprogs/
|
|
|
|
installPhase = ''
|
|
|
|
# Create required package directories
|
|
|
|
install -m 755 -d "$out/bin"
|
2021-12-01 12:46:39 +00:00
|
|
|
install -m 755 -d "$out/share/hfsprogs"
|
2018-05-02 01:15:51 +00:00
|
|
|
install -m 755 -d "$out/share/man/man8/"
|
|
|
|
# Copy executables
|
|
|
|
install -m 755 "newfs_hfs.tproj/newfs_hfs" "$out/bin/mkfs.hfsplus"
|
|
|
|
install -m 755 "fsck_hfs.tproj/fsck_hfs" "$out/bin/fsck.hfsplus"
|
|
|
|
# Copy shared data
|
2021-12-01 12:46:39 +00:00
|
|
|
install -m 644 "newfs_hfs.tproj/hfsbootdata.img" "$out/share/hfsprogs/hfsbootdata"
|
2018-05-02 01:15:51 +00:00
|
|
|
# Copy man pages
|
|
|
|
install -m 644 "newfs_hfs.tproj/newfs_hfs.8" "$out/share/man/man8/mkfs.hfsplus.8"
|
|
|
|
install -m 644 "fsck_hfs.tproj/fsck_hfs.8" "$out/share/man/man8/fsck.hfsplus.8"
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "HFS/HFS+ user space utils";
|
2024-04-05 20:18:41 +00:00
|
|
|
license = lib.licenses.apple-psl20;
|
2021-01-15 09:19:50 +00:00
|
|
|
platforms = lib.platforms.linux;
|
2018-05-02 01:15:51 +00:00
|
|
|
};
|
|
|
|
}
|