55 fetchpatch ,
66 installShellFiles ,
77 libbsd ,
8- CoreFoundation ,
9- IOKit ,
108} :
119
12- stdenv . mkDerivation rec {
10+ stdenv . mkDerivation ( finalAttrs : {
1311 pname = "pdisk" ;
14- version = "0.9 " ;
12+ version = "0.10 " ;
1513
1614 src = fetchFromGitHub {
1715 owner = "apple-oss-distributions" ;
18- repo = pname ;
19- rev = "${ pname } -${ lib . versions . minor version } " ;
16+ repo = "pdisk" ;
17+ tag = "pdisk -${ lib . versions . minor finalAttrs . version } " ;
2018 hash = "sha256-+gBgnk/1juEHE0nXaz7laUaH7sxrX5SzsLGr0PHsdHs=" ;
2119 } ;
2220
@@ -41,30 +39,30 @@ stdenv.mkDerivation rec {
4139 url = "https://aur.archlinux.org/cgit/aur.git/plain/linux_strerror.patch?h=pdisk&id=d0c930ea8bcac008bbd0ade1811133a625caea54" ;
4240 sha256 = "sha256-HGJIS+vTn6456KtaETutIgTPPBm2C9OHf1anG8yaJPo=" ;
4341 } )
42+
43+ # Fix missing includes on Linux
44+ ./cmdline.patch
4445 ] ;
4546
4647 postPatch =
4748 ''
4849 substituteInPlace makefile \
49- --replace 'cc' '${ stdenv . cc . targetPrefix } cc'
50+ --replace-fail 'cc' '${ stdenv . cc . targetPrefix } cc'
5051 ''
5152 + lib . optionalString stdenv . hostPlatform . isDarwin ''
5253 substituteInPlace makefile \
53- --replace '-lbsd' '-framework CoreFoundation -framework IOKit'
54+ --replace-fail '-lbsd' '-framework CoreFoundation -framework IOKit'
5455 '' ;
5556
57+ strictDeps = true ;
58+
5659 nativeBuildInputs = [
5760 installShellFiles
5861 ] ;
5962
60- buildInputs =
61- lib . optionals ( ! stdenv . hostPlatform . isDarwin ) [
62- libbsd
63- ]
64- ++ lib . optionals ( stdenv . hostPlatform . isDarwin ) [
65- CoreFoundation
66- IOKit
67- ] ;
63+ buildInputs = lib . optionals ( ! stdenv . hostPlatform . isDarwin ) [
64+ libbsd
65+ ] ;
6866
6967 env . NIX_CFLAGS_COMPILE = "-D_GNU_SOURCE" ;
7068
@@ -73,23 +71,25 @@ stdenv.mkDerivation rec {
7371 installPhase = ''
7472 runHook preInstall
7573
76- install -Dm755 cvt_pt $out/bin/cvt_pt
77- install -Dm755 pdisk $out/bin/pdisk
74+ for exe in pdisk cvt_pt; do
75+ install -Dm755 -t $out/bin $exe
76+ done
7877
7978 installManPage pdisk.8
8079 install -Dm644 pdisk.html $out/share/doc/pdisk/pdisk.html
8180
8281 runHook postInstall
8382 '' ;
8483
85- meta = with lib ; {
84+ meta = {
8685 description = "Low-level Apple partition table editor for Linux, OSS Apple version" ;
8786 homepage = "https://github.com/apple-oss-distributions/pdisk" ;
88- license = with licenses ; [
87+ license = with lib . licenses ; [
8988 hpnd # original license statements seems to match this (in files that are shared with mac-fdisk)
9089 apple-psl10 # new files
9190 ] ;
92- maintainers = with maintainers ; [ OPNA2608 ] ;
93- platforms = platforms . unix ;
91+ mainProgram = "pdisk" ;
92+ maintainers = with lib . maintainers ; [ OPNA2608 ] ;
93+ platforms = lib . platforms . unix ;
9494 } ;
95- }
95+ } )
0 commit comments