<commit_before>{lib, stdenv, fetchurl, tex}:

stdenv.mkDerivation rec {

  pname = "nuweb";
  version = "1.60";

  src = fetchurl {
    url = "mirror://sourceforge/project/nuweb/${pname}-${version}.tar.gz";
    sha256 = "08xmwq48biy2c1fr8wnyknyvqs9jfsj42cb7fw638xqv35f0xxvl";
  };

  buildInputs = [ tex ];

  patchPhase = ''
    sed -ie 's|nuweb -r|./nuweb -r|' Makefile
  '';
  buildPhase = ''
    make nuweb
    make nuweb.pdf nuwebdoc.pdf all
  '';
  installPhase = ''
    install -d $out/bin $out/share/man/man1 $out/share/doc/${pname}-${version} $out/share/emacs/site-lisp
    cp nuweb $out/bin
    cp nuweb.el $out/share/emacs/site-lisp
    gzip -c nuweb.1 > $out/share/man/man1/nuweb.1.gz
    cp htdocs/index.html nuweb.w nuweb.pdf nuwebdoc.pdf README $out/share/doc/${pname}-${version}
  '';

  meta = with lib; {
    description = "A simple literate programming tool";
    homepage = "http://nuweb.sourceforge.net";
    license = licenses.free;
    maintainers = [ maintainers.AndersonTorres ];
    platforms = platforms.unix;<commit_msg>nuweb: add -fcommon workaround<commit_after>{lib, stdenv, fetchurl, tex}:

stdenv.mkDerivation rec {

  pname = "nuweb";
  version = "1.60";

  src = fetchurl {
    url = "mirror://sourceforge/project/nuweb/${pname}-${version}.tar.gz";
    sha256 = "08xmwq48biy2c1fr8wnyknyvqs9jfsj42cb7fw638xqv35f0xxvl";
  };

  buildInputs = [ tex ];

  patchPhase = ''
    sed -ie 's|nuweb -r|./nuweb -r|' Makefile
  '';

  # Workaround build failure on -fno-common toolchains like upstream
  # gcc-10. Otherwise build fails as:
  #   ld: global.o:/build/nuweb-1.60/global.h:91: multiple definition of
  #     `current_sector'; main.o:/build/nuweb-1.60/global.h:91: first defined here
  NIX_CFLAGS_COMPILE = "-fcommon";

  buildPhase = ''
    make nuweb
    make nuweb.pdf nuwebdoc.pdf all
  '';
  installPhase = ''
    install -d $out/bin $out/share/man/man1 $out/share/doc/${pname}-${version} $out/share/emacs/site-lisp
    cp nuweb $out/bin
    cp nuweb.el $out/share/emacs/site-lisp
    gzip -c nuweb.1 > $out/share/man/man1/nuweb.1.gz
    cp htdocs/index.html nuweb.w nuweb.pdf nuwebdoc.pdf README $out/share/doc/${pname}-${version}
  '';

  meta = with lib; {
    description = "A simple literate programming tool";
    homepage = "http://nuweb.sourceforge.net";
    license = licenses.free;
    maintainers = [ maintainers.AndersonTorres ];
    platforms = platforms.unix;
{'fraction_non_alphanumeric': 0.1533360961458765, 'fraction_numerical': 0.027351844177372565, 'mean_word_length': 3.1909722222222223, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5904730', 'n_tokens_mistral': 968, 'n_tokens_neox': 932, 'n_words': 173}