2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchurl, tie }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
let
|
|
|
|
cweb = fetchurl {
|
|
|
|
url = "https://www.ctan.org/tex-archive/web/c_cpp/cweb/cweb-3.64ah.tgz";
|
|
|
|
sha256 = "1hdzxfzaibnjxjzgp6d2zay8nsarnfy9hfq55hz1bxzzl23n35aj";
|
|
|
|
};
|
|
|
|
in
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "cwebbin";
|
|
|
|
version = "22p";
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
__structuredAttrs = true;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ascherer";
|
|
|
|
repo = "cwebbin";
|
|
|
|
rev = "2016-05-20-22p";
|
|
|
|
sha256 = "0zf93016hm9i74i2v384rwzcw16y3hg5vc2mibzkx1rzvqa50yfr";
|
|
|
|
};
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
prePatch = ''
|
|
|
|
tar xf ${cweb}
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-03-19 17:17:44 +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 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
makefile = "Makefile.unix";
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
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"
|
2024-05-15 15:35:15 +00:00
|
|
|
# requires __structuredAttrs = true
|
|
|
|
"CC=$(CXX) -std=c++14"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
buildFlags = [
|
|
|
|
"boot"
|
|
|
|
"cautiously"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
preInstall = ''
|
2020-04-24 23:36:52 +00:00
|
|
|
mkdir -p $out/share/man/man1 $out/share/texmf/tex/generic $out/share/emacs $out/lib
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit (src.meta) homepage;
|
|
|
|
description = "Literate Programming in C/C++";
|
|
|
|
platforms = with platforms; unix;
|
2024-07-31 10:19:44 +00:00
|
|
|
maintainers = [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.abstyles;
|
|
|
|
};
|
|
|
|
}
|