public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Magnus Therning <magnus-prvltyMypuNg9hUCZPvPmw@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: ANN: pandoc 1.14.1
Date: Thu, 2 Jul 2015 01:03:52 +0200	[thread overview]
Message-ID: <20150701230352.GA5047@tatooine> (raw)
In-Reply-To: <20150701164457.GD61054-bi+AKbBUZKbivNSvqvJHCtPlBySK3R6THiGdP5j34PU@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 3103 bytes --]

On Wed, Jul 01, 2015 at 09:44:57AM -0700, John MacFarlane wrote:
> +++ Magnus Therning [Jul 01 15 09:14 ]:
> >Is there a way to run these commands at build time, i.e. without first
> >installing `pandoc`?
> >
> >Just running `pandoc --man1` fails since it doesn't find `README`, and
> >it seems to look for it in its final destination
> >(`/usr/share/x86_64-linux-ghc-7.10.1/pandoc-1.14.1/` in my case).
> >Using `--data-dir` seems to have no effect on this behaviour.
> 
> Yes, you need to install (unless you've used `-fembed_data_files`).
> Is this a problem?  I figured distribution packagers would simply
> install into a sandbox or use a fakeroot or something.

Well, sure, the package building does use `fakeroot` (inside a docker
instance in my case), but that's only to be able to build as a
non-root user and still set the files to be owned by `root`.  Anyway,
this is sort beside the point :)

The steps I use for packaging are (somewhat shortened):

~~~ { .sh }
    runhaskell Setup configure -O --enable-library-profiling --enable-shared \
        --prefix=/usr --docdir="/usr/share/doc/${pkgname}" \
        --libsubdir=\$compiler/site-local/\$pkgid \
            -f-old-locale -fnetwork-uri -fhttps -f-trypandoc -f-embed_data_files

    runhaskell Setup build

    runhaskell Setup copy --destdir="${pkgdir}"
~~~

As you see the configuration uses `--prefix` while the copying uses
`--destdir` to get all files into the correct hierarchy, but rooted at
`${pkgdir}/` rather than at `/`.  This is where the hardcoded path to
the README causes problems -- I'd have to pollute the build system by
copying the README into `/usr/share/...` in order to create the man
pages.  This would require that I build the package as root, something
that I explicitly *don't* want (in fact, the package building tools in
Arch Linux recently removed the option to build as root!)

> >Is it possible to build them manually?
> >
> >I tried using
> >
> >   ./dist/build/pandoc/pandoc -t man \
> >   --template=data/pandoc.1.template -s README \
> >   > pandoc.1
> >
> >but that doesn't produce the same output as `pandoc --man1`.
> 
> Correct.  The man page construction involves some
> transformations of the README (including dividing it into
> two parts, for man 1 and man5).
> 
> You can do this, though.  Create the following Haskell
> program in the pandoc source directory:
> 
> ``` manpages.hs
> import Text.Pandoc.ManPages
> 
> main = do
>  manPandoc1 >>= writeFile "pandoc.1"
>    manPandocMarkdown5 >>= writeFile "pandoc_markdown.5"
> ```
> 
> Run it with the interpreter:
> 
> ```
> runghc -Isrc manpages.hs
> ```

Yes, I might have to do something like this... but as you realise it's
bit of a hassle to have package building steps that depend on the
pandoc API.  I'd rather avoid it if possible.

/M

-- 
Magnus Therning                      OpenPGP: 0xAB4DFBA4 
email: magnus-prvltyMypuNg9hUCZPvPmw@public.gmane.org   jabber: magnus-prvltyMypuNg9hUCZPvPmw@public.gmane.org
twitter: magthe               http://therning.org/magnus

McBryan's Law: You can't make it better until you make it work.

  parent reply	other threads:[~2015-07-01 23:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-01  5:54 John MacFarlane
     [not found] ` <20150701055418.GA60820-bi+AKbBUZKbivNSvqvJHCtPlBySK3R6THiGdP5j34PU@public.gmane.org>
2015-07-01  7:14   ` Magnus Therning
2015-07-01 16:44     ` John MacFarlane
     [not found]       ` <20150701164457.GD61054-bi+AKbBUZKbivNSvqvJHCtPlBySK3R6THiGdP5j34PU@public.gmane.org>
2015-07-01 17:20         ` John MacFarlane
     [not found]           ` <20150701172006.GA61328-bi+AKbBUZKbivNSvqvJHCtPlBySK3R6THiGdP5j34PU@public.gmane.org>
2015-07-01 23:06             ` Magnus Therning
2015-07-01 23:42               ` John MacFarlane
2015-07-01 23:03         ` Magnus Therning [this message]
2015-07-01 14:32   ` Manolo Martínez
2015-07-01 16:49     ` John MacFarlane

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150701230352.GA5047@tatooine \
    --to=magnus-prvltymypung9huczpvpmw@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).