2024-09-19 14:19:46 +00:00
|
|
|
{ stdenv, lib, fetchurl, cmake, asLibrary ? false }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "astyle";
|
2024-10-11 05:15:48 +00:00
|
|
|
version = "3.6.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2024-01-02 11:29:13 +00:00
|
|
|
url = "mirror://sourceforge/${pname}/${pname}-${version}.tar.bz2";
|
2024-10-11 05:15:48 +00:00
|
|
|
hash = "sha256-EO18j5dOzONcF3jxYW8EypPD07/BoBeqJROWBBtnDvw=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
# upstream repo includes a build/ directory
|
|
|
|
cmakeBuildDir = "_build";
|
|
|
|
|
|
|
|
cmakeFlags = lib.optional asLibrary [
|
|
|
|
"-DBUILD_SHARED_LIBS=ON"
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = lib.optionalString asLibrary ''
|
|
|
|
install -Dm444 ../src/astyle.h $out/include/astyle.h
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Source code indenter, formatter, and beautifier for C, C++, C# and Java";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "astyle";
|
2023-02-02 18:25:31 +00:00
|
|
|
homepage = "https://astyle.sourceforge.net/";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.lgpl3;
|
2024-01-02 11:29:13 +00:00
|
|
|
maintainers = with maintainers; [ carlossless ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|