Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

latex2html: init at 2016 #21802

Merged
merged 1 commit into from Mar 13, 2017
Merged

Conversation

yurrriq
Copy link
Member

@yurrriq yurrriq commented Jan 11, 2017

Motivation for this change

Add latex2html.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

version = "2016";

src = fetchurl {
url = http://mirrors.ctan.org/support/latex2html/latex2html-2016.tar.gz;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick:

url = "http://mirrors.ctan.org/support/latex2html/latex2html-${version}.tar.gz;"

@yurrriq
Copy link
Member Author

yurrriq commented Jan 11, 2017

Good call! Thank you.

@yurrriq yurrriq force-pushed the add/pkgs/tools/misc/latex2html branch from 200ab53 to 0b63253 Compare January 11, 2017 18:00
@yurrriq
Copy link
Member Author

yurrriq commented Jan 11, 2017

Force pushed with the amended src.url.

@Mic92
Copy link
Member

Mic92 commented Jan 11, 2017

The build contains spurious leftover to the build directory. Compiling a document to html results in the following error:

$ latex2html main.tex
Error: '/tmp/nix-build-latex2html-2016.drv-0' not usable as temporary directory.
$ grep /tmp/nix-build-latex2html-2016.drv-0 $(which latex2html)                                                                                                        
    $TEXEXPAND = "$PERL /tmp/nix-build-latex2html-2016.drv-0/latex2html-2016${dd}texexpand";
    $PSTOIMG   = "$PERL /tmp/nix-build-latex2html-2016.drv-0/latex2html-2016${dd}pstoimg";
    $ICONSERVER = L2hos->path2URL("/tmp/nix-build-latex2html-2016.drv-0/latex2html-2016${dd}icons");
    $RGBCOLORFILE = "/tmp/nix-build-latex2html-2016.drv-0/latex2html-2016${dd}styles${dd}rgb.txt";
    $CRAYOLAFILE = "/tmp/nix-build-latex2html-2016.drv-0/latex2html-2016${dd}styles${dd}crayola.txt";

@yurrriq
Copy link
Member Author

yurrriq commented Jan 11, 2017

@Mic92: I've ticked the "Allow edits from maintainers" box, so feel free to make any changes you see fit. I don't have the time for now.

@yurrriq yurrriq force-pushed the add/pkgs/tools/misc/latex2html branch from 69a928c to 0f40d2d Compare March 6, 2017 10:01
@yurrriq
Copy link
Member Author

yurrriq commented Mar 6, 2017

I've rebased and force pushed, attempting to address the error @Mic92 mentioned above.
diff --git a/pkgs/tools/misc/latex2html/default.nix b/pkgs/tools/misc/latex2html/default.nix
index 48976275cb..596a72ee5a 100644
--- a/pkgs/tools/misc/latex2html/default.nix
+++ b/pkgs/tools/misc/latex2html/default.nix
@@ -1,4 +1,5 @@
-{ stdenv, fetchurl, ghostscript, netpbm, texLive, perl }:
+{ stdenv, fetchurl, makeWrapper
+, ghostscript, netpbm, perl }:
 # TODO: withTex
 
 # Ported from Homebrew.
@@ -13,7 +14,9 @@ stdenv.mkDerivation rec {
     sha256 = "028k0ypbq94mlhydf1sbqlphlfl2fhmlzhgqq5jjzihfmccbq7db";
   };
 
-  buildInputs = [ ghostscript netpbm texLive perl ];
+  buildInputs = [ ghostscript netpbm perl ];
+
+  nativeBuildInputs = [ makeWrapper ];
 
   configurePhase = ''
     ./configure \
@@ -22,6 +25,12 @@ stdenv.mkDerivation rec {
       --with-texpath=$out/share/texmf/tex/latex/html
   '';
 
+  postInstall = ''
+    for p in $out/bin/{latex2html,pstoimg}; do \
+      wrapProgram $p --add-flags '--tmp="''${TMPDIR:-/tmp}"'
+    done
+  '';
+
   meta = with stdenv.lib; {
     description = "LaTeX-to-HTML translator";
     longDescription = ''
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 0a27f47a38..7600887e71 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -2646,9 +2646,7 @@ with pkgs;
 
   kindlegen = callPackage ../tools/typesetting/kindlegen { };
 
-  latex2html = callPackage ../tools/misc/latex2html {
-    texLive = texlive.combined.scheme-basic;
-  };
+  latex2html = callPackage ../tools/misc/latex2html { };
 
   ldapvi = callPackage ../tools/misc/ldapvi { };
 

Edit: I've also dropped the texLive dependency since I wasn't doing anything with it anyway.

@yurrriq
Copy link
Member Author

yurrriq commented Mar 6, 2017

/ping @Mic92, @fpletz, @pSub

This should be good to go now.

homepage = "https://www.ctan.org/pkg/latex2html";

license = licenses.gpl2;
platforms = with platforms; linux ++ darwin;
Copy link
Member Author

@yurrriq yurrriq Mar 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be platforms.all or inherit (perl.meta) platforms?

netpbm.meta.platforms = with stdenv.lib.platforms; linux ++ darwin;

@pSub pSub merged commit d124722 into NixOS:master Mar 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants