depot/third_party/nixpkgs/pkgs/tools/text/source-highlight/default.nix
Default email d419639f9c Project import generated by Copybara.
GitOrigin-RevId: 6b1057b452c55bb3b463f0d7055bc4ec3fd1f381
2021-02-17 18:02:09 +01:00

39 lines
1.2 KiB
Nix

{ lib, stdenv, fetchurl, boost }:
stdenv.mkDerivation rec {
pname = "source-highlight";
version = "3.1.9";
src = fetchurl {
url = "mirror://gnu/src-highlite/${pname}-${version}.tar.gz";
sha256 = "148w47k3zswbxvhg83z38ifi85f9dqcpg7icvvw1cm6bg21x4zrs";
};
# source-highlight uses it's own binary to generate documentation.
# During cross-compilation, that binary was built for the target
# platform architecture, so it can't run on the build host.
patchPhase = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
substituteInPlace Makefile.in --replace "src doc tests" "src tests"
'';
strictDeps = true;
buildInputs = [ boost ];
configureFlags = [ "--with-boost=${boost.out}" ];
enableParallelBuilding = false;
outputs = [ "out" "doc" "dev" ];
meta = with lib; {
description = "Source code renderer with syntax highlighting";
longDescription = ''
GNU Source-highlight, given a source file, produces a document
with syntax highlighting.
'';
homepage = "https://www.gnu.org/software/src-highlite/";
license = licenses.gpl3Plus;
platforms = platforms.unix;
maintainers = with maintainers; [ SuperSandro2000 ];
};
}