LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Installing Pandoc in Slackware with Stack (https://www.linuxquestions.org/questions/slackware-14/installing-pandoc-in-slackware-with-stack-4175601111/)

reclusivewriter 03-05-2017 05:51 AM

Installing Pandoc in Slackware with Stack
 
OK, I saw the recent thread on Pandoc and since I write books for a hobby, I wanted to install it. I used it a lot on Debian, and the one on SBo is like 3 versions old. I saw a comment in passing about using Stack to install it, so that was the way I went. For posterity, here's the workflow I used:

1. Downloaded Stack https://docs.haskellstack.org/en/sta...upgrade/#linux This pretty much amounted to downloading the source file, unpacking it, then moving the stack executable to a directory in my path. (/data/bin in my case)

2. Download the Pandoc source code https://hackage.haskell.org/package/pandoc I tried to use the source package directly from the Pandoc website, but for some reason that didn't compile. This version did. I never did figure out why.

3.Uncompress Pandoc source and change to that directory
1.stack setup
2.stack install --test

4. At this point, the install fails, as there is no libtinfo.so.5 I suspect this is what caused the failure to compile GHC 8 when I tried modifying the GHC slackbuild earlier. The fix for this is:

/lib/64 - > ln -s libncurses.so.5.9 libtinfo.so.5

5. Change back to Pandoc source directory, and stack install --test works a treat. Wait a while, and the latest Pandoc is sitting in ~/.local/bin, which I then moved to /data/bin, and Bob was my uncle.

The only step that needs to be done as root is setting the symlink. Everything else is done as user, with the .stack directory in the home folder. It's about 2 gigs of stuff, but the important thing is that it works and now I have the latest Pandoc to convert my markdown into PDF's and EPUB's.

For a lighter weight solution, there's always text2pdf, or a markdown compiler -> html -> wkhtmltopdf, but I like Pandoc, I'm used to its quirks, so this solution worked for me.

Oh, that reminds me. Pandoc requires texlive. I couldn't get it to work with the standard tex in Slack, so remove tetex and tetex-doc, install texlive (I used the medium profile, about 1.3 gigs, but I may try again someday with basic which is about on par with tetex at 400 megs or so.) and call pandoc with the command

pandoc [infile] --latex-engine=xelatex -o [outfile]

So, I hope this helps anyone else looking for an easy way of installing the latest Pandoc on Slack. Needs a ton of diskspace with all the Haskell and Texlive, but it still beats the dickens out of trying to get LO or OO to do what I want it to.

[edit: readability]

Didier Spaier 03-05-2017 08:03 AM

Thanks for the info Launfal.

For the lazy Slackers among us, pandoc packages are available in the Salix repos, 64-bit and 32-bit, rebuilt by George Vlahavas from Arch binaries.

These packages are currently at version 1.17.0.1, but downloading the source directory and editing the SLKBUILD this way:
Code:

pkgver=1.19.2.1
_archrel=18
_citeprocver=0.10.4.1
_citeprocrel=8

I just built a package for pandoc version 1.19.2.1 (this needs the slkbuild app from Salix or to convert the SLKBUILD to a SlackBuild). Running it after installation it complained about a missing shared library libcmark.so.0.27.1, easily found, built and installed from the cmark git repo.

A word of caution: before downloading an Arch binary found @ http://ftp5.gwdg.de/pub/linux/archli...ity/os/x86_64/, be aware that usually you will find only the most recent versions there.

a4z 03-05-2017 09:53 AM

Pandoc is great, but the absolute insane installation and dependencies made me switch to
Code:

gem install asciidoctor
, a decisions I never have regret. Because after all, a markdown language where I can not easily generate the documents I need from simple text is imho nearly the same like depending on some binary only big platform restricted text editing program.


but for Slackware there is
https://slackbuilds.org/repository/14.2/office/pandoc/
which it pretty complete and customizable

Didier Spaier 03-05-2017 10:06 AM

Well, pandoc is shipped in the Slint ISOs (as well as doclifter and txt2tags). And our old website is written in Asciidoc so I am used to that too... But you are comparing apples with oranges here, as the features of these software are completely different.

dugan 03-08-2017 10:52 PM

Thanks!

That's very helpful.

dugan 03-15-2017 09:33 AM

Again: great work!

It's certainly not as cool an alternative, but an alternative way of dealing with annoying dependencies is to just repackage the .deb or RPM.

I wrote a shellcheck SlackBuild last night. Normally, shellcheck is built with Cabal. This is what I did...

https://github.com/duganchen/my_slac...eck.SlackBuild


All times are GMT -5. The time now is 06:57 PM.