Commit 8242d315 authored by K900's avatar K900
Browse files

astyle: support building as a library

This has to be a separate package, because it can't do both.
parent 1a9be389
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
{ stdenv, lib, fetchurl, cmake }:
{ stdenv, lib, fetchurl, cmake, asLibrary ? false }:

stdenv.mkDerivation rec {
  pname = "astyle";
@@ -11,6 +11,17 @@ stdenv.mkDerivation rec {

  nativeBuildInputs = [ cmake ];

  # 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
  '';

  meta = with lib; {
    description = "Source code indenter, formatter, and beautifier for C, C++, C# and Java";
    mainProgram = "astyle";
+1 −0
Original line number Diff line number Diff line
@@ -17416,6 +17416,7 @@ with pkgs;
  asn2quickder = python3Packages.callPackage ../development/tools/asn2quickder { };
  astyle = callPackage ../development/tools/misc/astyle { };
  libastyle = astyle.override { asLibrary = true; };
  automaticcomponenttoolkit = callPackage ../development/tools/misc/automaticcomponenttoolkit { };