Pandoc on arm64

pandoc is a fundamental package for many academics. I am trying to get it packaged (or maybe just installed) on arm64, which would be great. I got the pandoc bin installed (and it runs fine) by unpacking a few deb packages. You can find a shell script that does this in the arm64 / technical assistance forum (I can’t post links; search there for pandoc).

But pandoc-citeproc is a different story. With well over 40 dependencies, and with my lack of experience with arch/aur, I don’t know where to begin. Without pandoc-citeproc, pandoc is fairly useless to me (and many others). Are there any suggestions, insights, or even help with how to go about tackling this package on arm64? Wow, Haskell must really suck for packagers.

I can’t say anything other than it might be better/easier if you switch to a distribution that supports pandoc/haskell on aarch64. I believe Debian does.

I don’t touch haskell, and neither does Arch Linux ARM it seems, so I’m afraid we can’t help you much.

I have successfully gotten pandoc-citeproc to run. I was able to find a deb’d version compiled with all the haskell includes, so this made the task much much simpler. I have three remaining issues that I am hoping I could get some help with.

Apologies for the long post. Here are the 3 pkgbuild files:

libbibutils7 (a dependency of pandoc-citeproc-bin):

# Generated by debtap
# Maintainer: codebreaker
# Contributor: codebreaker
pkgname=libbibutils7
pkgver=6.10
pkgrel=1
pkgdesc="Bibliography file converter, shared library. COPAC, EndNote refer, EndNote XML, Pubmed XML, ISI web of science, US Library of Congress MODS, RIS, and Word 2007 bibliography. This package contains the shared library doing most of the work"
arch=('aarch64')
url="https://sourceforge.net/projects/bibutils"
license=('GPL')
groups=('')
depends=('glibc>=2.17')
options=('!strip' '!emptydirs')
source=("http://ftp.br.debian.org/debian/pool/main/b/bibutils/libbibutils7_6.10-2_arm64.deb")
sha512sums=('2893c39edfffb75efc3dfabb5d679006ca7d660ba42ce10ca47cc91d9cd12e8af48f12ac9b7e79e42e5e8f156c55523402c596a35f94ae13877f40e11632ac7a')

package(){

	# Extract package data
	tar xf data.tar.xz -C "${pkgdir}"

	install -D -m644 "/usr/share/doc/libbibutils7/copyright" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"

}

pandoc-citeproc-data (a dependency of pandoc-citeproc-bin)

# Generated by debtap
# Maintainer: codebreaker
# Contributor: codebreaker
pkgname=libghc-pandoc-citeproc-data
pkgver=0.16.4.1
pkgrel=1
pkgdesc="Pandoc support for Citation Style Language - data files. Pandoc-citeproc is a Haskell implementation of the Citation Style Language (CSL). Pandoc-citeproc adds to pandoc, the famous Haskell text processing tool, a Bibtex like citation and bibliographic formatting and generation facility. CSL is an XML language for specifying citation and bibliographic style files in commercial products like Endnote or Reference Manager. This package contains the data files needed to use the library."
arch=('any')
url="https://github.com/jgm/pandoc-citeproc"
license=('GPL')
groups=('')
options=('!strip' '!emptydirs')
source=("http://ftp.br.debian.org/debian/pool/main/h/haskell-pandoc-citeproc/libghc-pandoc-citeproc-data_0.16.4.1-1_all.deb")
sha512sums=('c8542a2c62133acef391110c573bf8d378f598217d5cc3b19970832ed7b9f154eacfe1a460d792cb8810a40680635a33fad35a2152f91ee1cc5f219073127b7f')

package(){

	# Extract package data
	tar xf data.tar.xz -C "${pkgdir}"

	# error on install saying the copyright file is not found, even though it is there
	# install -D -m644 "/usr/share/doc/libghc-pandoc-citeproc-data/copyright" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"

}

pandoc-citeproc-bin:

# Generated by debtap
# Maintainer: codebreaker
# Contributor: codebreaker
pkgname=pandoc-citeproc-bin
pkgver=0.16.4.1
pkgrel=1
pkgdesc="Pandoc support for Citation Style Language - tools. Pandoc-citeproc is a Haskell implementation of the Citation Style Language (CSL). Pandoc filter (pandoc >= 1.12), and also has a mode for converting bibliographic databases a YAML format suitable for inclusion in pandoc YAML metadata."
arch=('aarch64')
url="https://github.com/jgm/pandoc-citeproc"
license=('GPL')
groups=('')
depends=('bibutils>=6.10' 'glibc>=2.29' 'gmp' 'icu>=67.1' 'libffi>=3.3' 'libghc-pandoc-citeproc-data>=0.16.4.1' 'libyaml' 'pcre' 'zlib>=1.1.4')
options=('!strip' '!emptydirs')
source=("http://ftp.br.debian.org/debian/pool/main/h/haskell-pandoc-citeproc/pandoc-citeproc_0.16.4.1-1+b1_arm64.deb")
sha512sums=('ffc730fa4fe23dee55c85b5302a8bb027e6a357094ee0fa24e8e9cdbe340a1a3431d024600e128746f247c1b13b32da05153a5ceab3bd6c10a44169b2309d489')

package(){

	# Extract package data
	tar xf data.tar.xz -C "${pkgdir}"

	install -D -m644 "/usr/share/doc/pandoc-citeproc/copyright" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"

}

The three remaining issues are:

  1. libghc-pandoc-citeproc-data: in the pkgbuild file, the following line in the package function generates an error:

install -D -m644 “/usr/share/doc/libghc-pandoc-citeproc-data/copyright” “${pkgdir}/usr/share/licenses/${pkgname}/LICENSE”

==> Starting package()…
install: cannot stat ‘/usr/share/doc/libghc-pandoc-citeproc-data/copyright’: No such file or directory
==> ERROR: A failure occurred in package().
Aborting…

This error occurs despite the fact that the file /usr/share/doc/libghc-pandoc-citeproc-data/copyright is present

  1. libbibutils: Installation finishes successfully, but the lib is not found afterwards. Two files (well, a file and a link) are installed:

/usr/lib/aarch64-linux-gnu/libbibutils.so.7
/usr/lib/aarch64-linux-gnu/libbibutils.so.7.0

but as I said, they are not found. If I copy these two files to /usr/lib and run ldconfig, they are found by the system and are usable.

  1. pandoc-citeproc-bin: When I run makepkg I get the following error:

$ makepkg
==> Making package: pandoc-citeproc-bin 0.16.4.1-1 (Fri 04 Sep 2020 12:50:57 PM EDT)
==> Checking runtime dependencies…
==> Missing dependencies:
-> bibutils>=6.10
==> Checking buildtime dependencies…
==> ERROR: Could not resolve all dependencies.

This occurs even if I have already installed libbibutils, and copied the lib files and run ldconfig as described above.

I would be grateful for any help on any of these issues is. So close!

OK, I now have six pkgfile’s that install pandoc, pandoc-citeproc and their dependencies on arm64. The forum won’t let me add them to my post, complaining that I am not allowed to post links. And I don’t know how to use AUR. Any suggestions as to how best to proceed?

Actually it’s not.
That line is missing a ${srcdir} or cd data in the previous line, while removing the / in front of usr, I think.
I’m not certain when extracting debs. But the line as it is now, would search the location on your install system, not the chroot which it’s packaging in.

Everything installs and runs great, I just have one remaining issue. I need to install two libs as dependencies. The debs for both have a directory structure that looks like this:

/usr/lib/aarch64-linux-gnu/libname.so.7
/usr/lib/aarch64-linux-gnu/libname.so.7.0

where the .0 file is the actual lib and the .7 file is a symbolic link. If I just tar the archive without modifications in the package function, the lib is not found after installing. If I copy the libs from /usr/lib/aarch64-linux-gnu to /usr/lib and run ldconfig, they are found and work fine, but ldconfig then complains that the .7 file is not a symbolic link. Basically, the cp command copies the original file the link is pointing to and not the link, which makes sense. Install seems to do the same thing. So my question is what is the proper way to handle this? One option is to copy both the lib and the symbolic link so that the link points to the copied lib. Or as an alternative, get the system to find the libs when they are in the aarch64-linux-gnu subfolder. But I am not a packager so I don’t know how to do either of these and google searches haven’t helped.

Thanks!

So the ridiculously simple fix was cp -a. Everything now packages, installs, and runs as it should. pkgbuild files can be found here:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.