2024-11-10 11:15:35 +00:00
|
|
|
{
|
|
|
|
stdenv,
|
|
|
|
lib,
|
|
|
|
fetchurl,
|
|
|
|
cmake,
|
|
|
|
versionCheckHook,
|
|
|
|
asLibrary ? false,
|
|
|
|
}:
|
2012-01-25 13:52:18 +00:00
|
|
|
|
2019-08-26 08:40:04 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "astyle";
|
2024-11-10 11:15:35 +00:00
|
|
|
version = "3.6.4";
|
2012-01-25 13:52:18 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2023-11-11 23:07:49 +00:00
|
|
|
url = "mirror://sourceforge/${pname}/${pname}-${version}.tar.bz2";
|
2024-11-10 11:15:35 +00:00
|
|
|
hash = "sha256-HpS2T08GRh+QOdCUrv6dSyjGbTSRayekVgVefWLXNwI=";
|
2012-01-25 13:52:18 +00:00
|
|
|
};
|
|
|
|
|
2019-08-26 08:40:04 +00:00
|
|
|
nativeBuildInputs = [ cmake ];
|
2012-01-25 13:52:18 +00:00
|
|
|
|
2024-08-22 13:50:11 +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
|
|
|
|
'';
|
|
|
|
|
2024-11-10 11:15:35 +00:00
|
|
|
nativeInstallCheckInputs = [ versionCheckHook ];
|
|
|
|
versionCheckProgramArg = "--version";
|
|
|
|
doInstallCheck = !asLibrary;
|
|
|
|
|
2019-08-26 08:40:04 +00:00
|
|
|
meta = with lib; {
|
2013-10-05 14:22:46 +00:00
|
|
|
description = "Source code indenter, formatter, and beautifier for C, C++, C# and Java";
|
2024-03-19 02:14:51 +00:00
|
|
|
mainProgram = "astyle";
|
2023-01-21 21:41:12 +00:00
|
|
|
homepage = "https://astyle.sourceforge.net/";
|
2019-08-26 08:40:04 +00:00
|
|
|
license = licenses.lgpl3;
|
2023-11-18 08:28:18 +00:00
|
|
|
maintainers = with maintainers; [ carlossless ];
|
2019-08-26 08:40:04 +00:00
|
|
|
platforms = platforms.unix;
|
2012-01-25 13:52:18 +00:00
|
|
|
};
|
|
|
|
}
|