depot/third_party/nixpkgs/pkgs/development/tools/misc/cwebbin/default.nix
Default email 5c370c0b2a Project import generated by Copybara.
GitOrigin-RevId: 33d1e753c82ffc557b4a585c77de43d4c922ebb5
2024-05-15 17:35:15 +02:00

67 lines
1.7 KiB
Nix

{ lib, stdenv, fetchFromGitHub, fetchurl, tie }:
let
cweb = fetchurl {
url = "https://www.ctan.org/tex-archive/web/c_cpp/cweb/cweb-3.64ah.tgz";
sha256 = "1hdzxfzaibnjxjzgp6d2zay8nsarnfy9hfq55hz1bxzzl23n35aj";
};
in
stdenv.mkDerivation rec {
pname = "cwebbin";
version = "22p";
__structuredAttrs = true;
src = fetchFromGitHub {
owner = "ascherer";
repo = "cwebbin";
rev = "2016-05-20-22p";
sha256 = "0zf93016hm9i74i2v384rwzcw16y3hg5vc2mibzkx1rzvqa50yfr";
};
prePatch = ''
tar xf ${cweb}
'';
# Remove references to __DATE__ and __TIME__
postPatch = ''
substituteInPlace wmerg-patch.ch --replace ' ("__DATE__", "__TIME__")' ""
substituteInPlace ctang-patch.ch --replace ' ("__DATE__", "__TIME__")' ""
substituteInPlace ctangle.cxx --replace ' ("__DATE__", "__TIME__")' ""
substituteInPlace cweav-patch.ch --replace ' ("__DATE__", "__TIME__")' ""
'';
nativeBuildInputs = [ tie ];
makefile = "Makefile.unix";
makeFlags = [
"MACROSDIR=$(out)/share/texmf/tex/generic/cweb"
"CWEBINPUTS=$(out)/lib/cweb"
"DESTDIR=$(out)/bin/"
"MANDIR=$(out)/share/man/man1"
"EMACSDIR=$(out)/share/emacs/site-lisp"
"CP=cp"
"RM=rm"
"PDFTEX=echo"
# requires __structuredAttrs = true
"CC=$(CXX) -std=c++14"
];
buildFlags = [
"boot"
"cautiously"
];
preInstall = ''
mkdir -p $out/share/man/man1 $out/share/texmf/tex/generic $out/share/emacs $out/lib
'';
meta = with lib; {
inherit (src.meta) homepage;
description = "Literate Programming in C/C++";
platforms = with platforms; unix;
maintainers = with maintainers; [ vrthra ];
license = licenses.abstyles;
};
}