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 ]; }; }