Tinfoil-hat.net
A secure home for every tinfoil-hat
:: Tinfoil-hat.net - A secure home for every tinfoil-hat
Start
Blogposts
Linklists
Git Projects
Music
Posts Overview

How to Compile Pandoc in OpenBSD 6.7

If you want to read this article in Mediawiki for better formating you can do so here:
https://wiki.tinfoil-hat.net/index.php?title=Compiling-pandoc-on-openbsd

1. Install Cabal

via packagemanagement

doas pkg_add -i ghc cabal-install

2. Prepare system to compile programs via cabal

2.1 Enable wxallowed in /home and /tmp:

You can do so via editing your
/etc/fstab

like this (this is my personal fstab. don’t blindly copy paste, you have to insert the wxallowed in the right place in your own /etc/fstab.

.b none swap sw
.a / ffs rw,softdep,noatime 1 1
.k /home ffs rw,softdep,wxallowed,noatime,nodev,nosuid 1 2
.d /tmp ffs rw,softdep,wxallowed,noatime,nodev,nosuid 1 2
.f /usr ffs rw,softdep,wxallowed,noatime,nodev 1 2
.g /usr/X11R6 ffs rw,softdep,noatime,nodev 1 2
.h /usr/local ffs rw,softdep,wxallowed,noatime,nodev 1 2
.j /usr/obj ffs rw,softdep,noatime,wxallowed,nodev,nosuid 1 2
.i /usr/src ffs rw,softdep,noatime,nodev,nosuid 1 2
.e /var ffs rw,softdep,noatime,nodev,nosuid 1 2

then reboot.

2.2 (optional) enable multithreating

If you want to enable hyperthreating tempoary, do:

sysctl hw.smt=1
if you want to make it permanent edit your
/etc/sysctl.conf

and paste the following at the end:

hw.smt=1

notice: without rebooting you have once to enable it manually, after the fist reboot, it will be active

sysctl hw.smt=1

you can check that hyperthreating is active, with programs like top or htop

2.3 raise ulimit:

put the following into your ~/.profile

ulimit -d 4096*1024

If you haven’t relogged, you have to manually paste this everytime you open a terminal in which you want to compile, since it’s a command for your shell.

ulimit -d 4096*1024

2.4 correct PATH in .profile

edit this into you .profile

PATH=$HOME/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/games:$HOME/.cabal/bin/:.

3. install pandoc or pandoc-citeproc

if you want to convert LATEX you probably want pandoc-citeproc, it automatically pulls pandoc as dependency:

as a user (not root) execute:
ulimit -d 4096*1024
cabal update
cabal install pandoc-citeproc

This will need a lot of time and resources to compile, be pacient. Pandoc should now be able to be compiled.

After compilation is finished, don’t be surpised if nothing happens when you execute pandoc and / or getting an error, read clearly, you may have the binary successfully compiled and it just couldn’t symlink. you probably can find pandoc in:

~/.cabal/bin/pandoc

if nothig happens when you execute this binary, it probably does work as inteded anyways, try to give it an argument like:

~/.cabal/bin/pandoc -v

Congratulations! You have successfully compiled and installed pandoc in OpenBSD
This Article is Converted from markdown in HTML using Pandoc in Openbsd :-)


GPG-Fingerprint: 266E 4882 C2A7 279E B012 C009 0D40 CFE3 4966 ·

Git Repo ·
Wiki ·
IRC ##tinfoil-hat.net ·
Mail: mail@tinfoil-hat.net ·
RSS Feed ·
Donate ·
Imprint