@@ -0,0 +1,33 @@
1+{ stdenv, appleDerivation, xcbuild, zlib, bzip2, lzma }:
2+
3+appleDerivation rec {
4+ buildInputs = [ xcbuild zlib bzip2 lzma ];
5+
6+ # some commands not working:
7+ # mtree: _simple.h not found
8+ # ipcs: sys/ipcs.h not found
9+ # so remove their targets from the project
10+ patchPhase = ''
11+ substituteInPlace file_cmds.xcodeproj/project.pbxproj \
12+ --replace "FC8A8CAA14B655FD001B97AD /* PBXTargetDependency */," "" \
13+ --replace "FC8A8C9C14B655FD001B97AD /* PBXTargetDependency */," "" \
14+ --replace "productName = file_cmds;" ""
15+ sed -i -re "s/name = ([a-zA-Z]+);/name = \1; productName = \1;/" file_cmds.xcodeproj/project.pbxproj
16+ '';
17+
18+ # temporary install phase until xcodebuild has "install" support
19+ installPhase = ''
20+ mkdir -p $out/bin/
21+ install file_cmds-*/Build/Products/Release/* $out/bin/
22+
23+ for n in 1; do
24+ mkdir -p $out/share/man/man$n
25+ install */*.$n $out/share/man/man$n
26+ done
27+ '';
28+
29+ meta = {
30+ platforms = stdenv.lib.platforms.darwin;
31+ maintainers = with stdenv.lib.maintainers; [ matthewbauer ];
32+ };
33+}