From 162f870e6faf2f71ef4bc43540588310f198e11a Mon Sep 17 00:00:00 2001 From: Spencer Whitt Date: Sat, 4 Apr 2015 00:53:42 -0400 Subject: [PATCH] astyle: fix on Darwin --- pkgs/development/tools/misc/astyle/default.nix | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/pkgs/development/tools/misc/astyle/default.nix b/pkgs/development/tools/misc/astyle/default.nix index a4004f7cb8a..770162c237e 100644 --- a/pkgs/development/tools/misc/astyle/default.nix +++ b/pkgs/development/tools/misc/astyle/default.nix @@ -12,16 +12,22 @@ stdenv.mkDerivation { sha256 = "1b0f4wm1qmgcswmixv9mwbp86hbdqxk754hml8cjv5vajvqwdpzv"; }; - sourceRoot = "astyle/build/gcc"; + sourceRoot = if (stdenv.cc.cc.isClang or false) + then "astyle/build/clang" + else "astyle/build/gcc"; + + # -s option is obsolete on Darwin and breaks build + postPatch = if stdenv.isDarwin then '' + substituteInPlace Makefile --replace "LDFLAGSr = -s" "LDFLAGSr =" + '' else null; installFlags = "INSTALL=install prefix=$$out"; meta = { homepage = "http://astyle.sourceforge.net/"; description = "Source code indenter, formatter, and beautifier for C, C++, C# and Java"; - license = "LGPL"; - - platforms = stdenv.lib.platforms.linux; + license = stdenv.lib.licenses.lgpl3; + platforms = stdenv.lib.platforms.unix; maintainers = [ stdenv.lib.maintainers.simons ]; }; }