summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorSpencer Whitt <sw@swhitt.me>2015-04-04 00:53:42 -0400
committerSpencer Whitt <sw@swhitt.me>2015-04-04 02:07:55 -0400
commit162f870e6faf2f71ef4bc43540588310f198e11a (patch)
tree4b40d5720078d0c3d2194fc838f87acae0cf0b4d /pkgs
parentd5225d54adbce0104c355bd420d804dfe695e163 (diff)
downloadnixlib-162f870e6faf2f71ef4bc43540588310f198e11a.tar
nixlib-162f870e6faf2f71ef4bc43540588310f198e11a.tar.gz
nixlib-162f870e6faf2f71ef4bc43540588310f198e11a.tar.bz2
nixlib-162f870e6faf2f71ef4bc43540588310f198e11a.tar.lz
nixlib-162f870e6faf2f71ef4bc43540588310f198e11a.tar.xz
nixlib-162f870e6faf2f71ef4bc43540588310f198e11a.tar.zst
nixlib-162f870e6faf2f71ef4bc43540588310f198e11a.zip
astyle: fix on Darwin
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/tools/misc/astyle/default.nix14
1 files changed, 10 insertions, 4 deletions
diff --git a/pkgs/development/tools/misc/astyle/default.nix b/pkgs/development/tools/misc/astyle/default.nix
index a4004f7cb8a3..770162c237e4 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 ];
   };
 }