nixpkgs-suyu/pkgs/os-specific/darwin/apple-source-releases/bootstrap_cmds/default.nix
Matthew Bauer d69cc779b5 Revert "Revert "darwin 10.12 commits""
This reverts commit 8505e710e7.
2019-04-20 23:17:04 -04:00

49 lines
2 KiB
Nix

{ stdenv, appleDerivation, yacc, flex }:
appleDerivation {
nativeBuildInputs = [ yacc flex ];
buildPhase = ''
cd migcom.tproj
yacc -d parser.y
flex --header-file=lexxer.yy.h -o lexxer.yy.c lexxer.l
cc -Os -pipe -DMIG_VERSION="" -Wall -mdynamic-no-pic -I. -c -o error.o error.c
cc -Os -pipe -DMIG_VERSION="" -Wall -mdynamic-no-pic -I. -c -o global.o global.c
cc -Os -pipe -DMIG_VERSION="" -Wall -mdynamic-no-pic -I. -c -o handler.o header.c
cc -Os -pipe -DMIG_VERSION="" -Wall -mdynamic-no-pic -I. -c -o header.o header.c
cc -Os -pipe -DMIG_VERSION="" -Wall -mdynamic-no-pic -I. -c -o mig.o mig.c
cc -Os -pipe -DMIG_VERSION="" -Wall -mdynamic-no-pic -I. -c -o routine.o routine.c
cc -Os -pipe -DMIG_VERSION="" -Wall -mdynamic-no-pic -I. -c -o server.o server.c
cc -Os -pipe -DMIG_VERSION="" -Wall -mdynamic-no-pic -I. -c -o statement.o statement.c
cc -Os -pipe -DMIG_VERSION="" -Wall -mdynamic-no-pic -I. -c -o string.o string.c
cc -Os -pipe -DMIG_VERSION="" -Wall -mdynamic-no-pic -I. -c -o type.o type.c
cc -Os -pipe -DMIG_VERSION="" -Wall -mdynamic-no-pic -I. -c -o user.o user.c
cc -Os -pipe -DMIG_VERSION="" -Wall -mdynamic-no-pic -I. -c -o utils.o utils.c
cc -Os -pipe -DMIG_VERSION="" -Wall -mdynamic-no-pic -I. -c -o lexxer.yy.o lexxer.yy.c
cc -Os -pipe -DMIG_VERSION="" -Wall -mdynamic-no-pic -I. -c -o y.tab.o y.tab.c
cc -dead_strip -o migcom error.o global.o header.o mig.o routine.o server.o statement.o string.o type.o user.o utils.o lexxer.yy.o y.tab.o
'';
installPhase = ''
mkdir -p $out/bin $out/libexec $out/share/man/man1
chmod +x mig.sh
cp mig.sh $out/bin/mig
cp migcom $out/libexec
ln -s $out/libexec/migcom $out/bin/migcom
cp mig.1 $out/share/man/man1
cp migcom.1 $out/share/man/man1
substituteInPlace $out/bin/mig \
--replace 'arch=`/usr/bin/arch`' 'arch=i386' \
--replace '/usr/bin/' "" \
--replace '/bin/rmdir' "rmdir" \
--replace 'C=''${MIGCC}' "C=cc"
'';
meta = {
platforms = stdenv.lib.platforms.darwin;
};
}