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