nixpkgs/pkgs/development/tools/misc/astyle/default.nix

33 lines
861 B
Nix
Raw Normal View History

{ stdenv, fetchurl }:
let
name = "astyle";
2018-02-03 20:47:18 +01:00
version = "3.1";
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";
};
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;
installFlags = "INSTALL=install prefix=$$out";
meta = {
homepage = http://astyle.sourceforge.net/;
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;
};
}