1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-09-11 15:08:33 +01:00

cwebbin: -std=c++14 due to register keyword

- fix build with clang
- refactor to use default buildPhase and installPhase
This commit is contained in:
annalee 2024-05-07 10:49:49 +00:00
parent b8b3be7098
commit 629e81236d
No known key found for this signature in database

View file

@ -1,9 +1,17 @@
{ 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";
@ -11,10 +19,9 @@ stdenv.mkDerivation rec {
sha256 = "0zf93016hm9i74i2v384rwzcw16y3hg5vc2mibzkx1rzvqa50yfr";
};
cweb = fetchurl {
url = "https://www.ctan.org/tex-archive/web/c_cpp/cweb/cweb-3.64ah.tgz";
sha256 = "1hdzxfzaibnjxjzgp6d2zay8nsarnfy9hfq55hz1bxzzl23n35aj";
};
prePatch = ''
tar xf ${cweb}
'';
# Remove references to __DATE__ and __TIME__
postPatch = ''
@ -26,6 +33,8 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ tie ];
makefile = "Makefile.unix";
makeFlags = [
"MACROSDIR=$(out)/share/texmf/tex/generic/cweb"
"CWEBINPUTS=$(out)/lib/cweb"
@ -35,18 +44,17 @@ stdenv.mkDerivation rec {
"CP=cp"
"RM=rm"
"PDFTEX=echo"
"CC=${stdenv.cc.targetPrefix}c++"
# requires __structuredAttrs = true
"CC=$(CXX) -std=c++14"
];
buildPhase = ''
zcat ${cweb} | tar -xvpf -
make -f Makefile.unix boot $makeFlags
make -f Makefile.unix cautiously $makeFlags
'';
buildFlags = [
"boot"
"cautiously"
];
installPhase = ''
preInstall = ''
mkdir -p $out/share/man/man1 $out/share/texmf/tex/generic $out/share/emacs $out/lib
make -f Makefile.unix install $makeFlags
'';
meta = with lib; {