2012-01-25 13:52:18 +00:00
|
|
|
{ stdenv, fetchurl }:
|
|
|
|
|
|
|
|
let
|
|
|
|
name = "astyle";
|
2018-02-03 19:47:18 +00:00
|
|
|
version = "3.1";
|
2012-01-25 13:52:18 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "${name}-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/${name}/${name}_${version}_linux.tar.gz";
|
2018-02-03 19:47:18 +00:00
|
|
|
sha256 = "1ms54wcs7hg1bsywqwf2lhdfizgbk7qxc9ghasxk8i99jvwlrk6b";
|
2012-01-25 13:52:18 +00:00
|
|
|
};
|
|
|
|
|
2015-05-11 22:37:53 +01:00
|
|
|
sourceRoot = if stdenv.cc.isClang
|
2015-04-04 05:53:42 +01:00
|
|
|
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;
|
2012-01-25 13:52:18 +00:00
|
|
|
|
|
|
|
installFlags = "INSTALL=install prefix=$$out";
|
|
|
|
|
|
|
|
meta = {
|
2017-08-01 21:03:30 +01:00
|
|
|
homepage = http://astyle.sourceforge.net/;
|
2013-10-05 15:22:46 +01:00
|
|
|
description = "Source code indenter, formatter, and beautifier for C, C++, C# and Java";
|
2015-04-04 05:53:42 +01:00
|
|
|
license = stdenv.lib.licenses.lgpl3;
|
|
|
|
platforms = stdenv.lib.platforms.unix;
|
2012-01-25 13:52:18 +00:00
|
|
|
};
|
|
|
|
}
|