nixpkgs/pkgs/by-name/cw/cwebbin/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

68 lines
1.6 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 = [ ];
license = licenses.abstyles;
};
}