2021-01-23 12:26:19 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchurl, tie }:
|
2016-07-03 18:14:46 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "cwebbin";
|
2016-07-03 18:14:46 +00:00
|
|
|
version = "22p";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ascherer";
|
|
|
|
repo = "cwebbin";
|
2017-04-09 20:47:55 +00:00
|
|
|
rev = "2016-05-20-22p";
|
2016-07-03 18:14:46 +00:00
|
|
|
sha256 = "0zf93016hm9i74i2v384rwzcw16y3hg5vc2mibzkx1rzvqa50yfr";
|
|
|
|
};
|
|
|
|
|
|
|
|
cweb = fetchurl {
|
2020-04-01 01:11:51 +00:00
|
|
|
url = "https://www.ctan.org/tex-archive/web/c_cpp/cweb/cweb-3.64ah.tgz";
|
2016-07-03 18:14:46 +00:00
|
|
|
sha256 = "1hdzxfzaibnjxjzgp6d2zay8nsarnfy9hfq55hz1bxzzl23n35aj";
|
|
|
|
};
|
|
|
|
|
2021-03-02 15:22:06 +00:00
|
|
|
# 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 ];
|
2016-07-03 18:14:46 +00:00
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"MACROSDIR=$(out)/share/texmf/tex/generic/cweb"
|
|
|
|
"CWEBINPUTS=$(out)/lib/cweb"
|
2016-07-04 16:55:36 +00:00
|
|
|
"DESTDIR=$(out)/bin/"
|
2016-07-03 18:14:46 +00:00
|
|
|
"MANDIR=$(out)/share/man/man1"
|
|
|
|
"EMACSDIR=$(out)/share/emacs/site-lisp"
|
|
|
|
"CP=cp"
|
|
|
|
"RM=rm"
|
|
|
|
"PDFTEX=echo"
|
2021-03-02 15:22:06 +00:00
|
|
|
"CC=${stdenv.cc.targetPrefix}c++"
|
2016-07-03 18:14:46 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
zcat ${cweb} | tar -xvpf -
|
|
|
|
make -f Makefile.unix boot $makeFlags
|
|
|
|
make -f Makefile.unix cautiously $makeFlags
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/share/man/man1 $out/share/texmf/tex/generic $out/share/emacs $out/lib
|
|
|
|
make -f Makefile.unix install $makeFlags
|
|
|
|
'';
|
|
|
|
|
2021-01-23 12:26:19 +00:00
|
|
|
meta = with lib; {
|
2016-07-03 18:14:46 +00:00
|
|
|
inherit (src.meta) homepage;
|
|
|
|
description = "Literate Programming in C/C++";
|
|
|
|
platforms = with platforms; unix;
|
|
|
|
maintainers = with maintainers; [ vrthra ];
|
2018-11-08 19:29:09 +00:00
|
|
|
license = licenses.abstyles;
|
2016-07-03 18:14:46 +00:00
|
|
|
};
|
|
|
|
}
|