LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-05-2017, 05:51 AM   #1
Launfal
Member
 
Registered: Jun 2014
Location: Ohio, USA
Posts: 39

Rep: Reputation: 15
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]

Last edited by Launfal; 03-05-2017 at 05:52 AM.
 
Old 03-05-2017, 08:03 AM   #2
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2 on Lenovo Thinkpad W520
Posts: 7,158

Rep: Reputation: 2271Reputation: 2271Reputation: 2271Reputation: 2271Reputation: 2271Reputation: 2271Reputation: 2271Reputation: 2271Reputation: 2271Reputation: 2271Reputation: 2271
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.

Last edited by Didier Spaier; 03-05-2017 at 08:39 AM.
 
1 members found this post helpful.
Old 03-05-2017, 09:53 AM   #3
a4z
Senior Member
 
Registered: Feb 2009
Posts: 1,304

Rep: Reputation: 547Reputation: 547Reputation: 547Reputation: 547Reputation: 547Reputation: 547
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

Last edited by a4z; 03-05-2017 at 09:55 AM.
 
Old 03-05-2017, 10:06 AM   #4
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2 on Lenovo Thinkpad W520
Posts: 7,158

Rep: Reputation: 2271Reputation: 2271Reputation: 2271Reputation: 2271Reputation: 2271Reputation: 2271Reputation: 2271Reputation: 2271Reputation: 2271Reputation: 2271Reputation: 2271
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.

Last edited by Didier Spaier; 03-05-2017 at 10:08 AM.
 
Old 03-08-2017, 10:52 PM   #5
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: Slackware
Posts: 7,215

Rep: Reputation: 2627Reputation: 2627Reputation: 2627Reputation: 2627Reputation: 2627Reputation: 2627Reputation: 2627Reputation: 2627Reputation: 2627Reputation: 2627Reputation: 2627
Thanks!

That's very helpful.

Last edited by dugan; 03-08-2017 at 10:56 PM.
 
Old 03-15-2017, 09:33 AM   #6
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: Slackware
Posts: 7,215

Rep: Reputation: 2627Reputation: 2627Reputation: 2627Reputation: 2627Reputation: 2627Reputation: 2627Reputation: 2627Reputation: 2627Reputation: 2627Reputation: 2627Reputation: 2627
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

Last edited by dugan; 03-15-2017 at 09:35 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
pandoc (a universal document converter) vonbiber Slackware 4 11-27-2016 09:16 AM
pandoc for pdf generation a4z Slackware 7 07-17-2014 01:40 AM
single 8K process stack vs 4K process stack and a seperate 4K interrupt stack charvak Linux - Kernel 1 03-17-2010 06:58 PM
Help installing 16K stack. ishcoleobo Linux - Software 3 07-28-2006 02:40 PM
kernel stack error installing... artofluke Linux - General 1 03-04-2005 09:21 PM


All times are GMT -5. The time now is 12:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration