termux-packages icon indicating copy to clipboard operation
termux-packages copied to clipboard

Package Request: Pandoc

Open dominicschaff opened this issue 9 years ago • 20 comments

I use pandoc on all my machines and I would really like to have it on termux, then I can use my device for almost all my computer usage.

dominicschaff avatar Jul 27 '16 11:07 dominicschaff

I second this request. Having Pandoc available on my Android devices would be a big help.

PurpleGuitar avatar Aug 23 '16 22:08 PurpleGuitar

I spent some time researching that, that is, trying to muck through building a binary. Any binary. No success so far.

The sum total of my findings is as follows:

  • There is only one GHC build kit set up for cross-compilation: docker sseefried/debian-wheezy-ghc-android which is apparently based on https://github.com/neurocyte/ghc-android/ The docker image is a bit out of date, and, building it from scratch fails, but the image works for suitably small quantities of 'works'.
  • It took me bloody hours to figure out how to invoke the cross-compiler. arm-linux-androideabi-cabal is apparently the way to go.
  • Specific pitfalls:
    • hslua trips over an android library not telling it what a decimal point is. Solution described at https://stackoverflow.com/questions/12299659/compiling-lua-lib-for-android-success-but-strange-segfaults -- hslua needs to be unpacked and built patched. The exact bug is different, but the reason is the same.
    • zlib can't be crosscompiled. patch: http://lpaste.net/8287391336118616064 works for version 0.5.4.2 but not for later versions.
    • network-2.6.3.1 can't be crosscompiled. 2.5.0.0 apparently can.

The final stumbling point was the JuicyPixels library which chokes on this:

Loading package ghc-prim ... linking ... ghc: /home/androidbuilder/.ghc/android-14/arm-linux-androideabi-4.8/lib/arm-unknown-linux-androideabi-ghc-7.8.3/ghc-prim-0.3.1.0/HSghc-prim-0.3.1.0.o: unhandled ELF relocation(Rel) type 28

ghc: unable to load package `ghc-prim'

I googled about for a while, but found no solution -- see https://github.com/neurocyte/ghc-android/issues/25

So far, it looks kinda grim, and since I don't know my way around GHC or Haskell at all, I don't have any more ideas.

Mihara avatar Sep 13 '16 14:09 Mihara

I third this request, I use emacs and org mode on termux quite a bit and having pandoc would be amazing!

brownstyler avatar Oct 19 '17 22:10 brownstyler

Indeed, pandoc would be a great way for me to make pdfs from Markdown in Termux.

bjornekstrom avatar Nov 11 '17 19:11 bjornekstrom

I was writing some stories on my phone, and wanted to convert it (markdown) to HTML for a friend to view, on the go, so i second this, pandoc is great.

ShadowJonathan avatar Dec 24 '17 12:12 ShadowJonathan

Haskel-pandoc is available https://www.archlinux.org/packages/community/x86_64/pandoc/ for x86_64 devices in Arch Linux in Termux PRoot. If you have success with pandoc in Termux on Android, Chromebook and Fire OS, post here.

SDRausty avatar Dec 24 '17 23:12 SDRausty

I'd love to be able to use pandoc, too. Has anybody successfully installed it?

borghal avatar Jul 06 '18 21:07 borghal

For anyone who's still looking for a solution for arm devices, (I did not try the Arch way cited above and don't know if it will or will not work on arm. For x86_64 it's not really worth it, since a static binary is available and should work.) pandoc is available in https://github.com/xeffyr/termux-extra-packages

There is a catch, though: This is accomplished by running an x86_64 static binary under qemu-user, which is about the brutest force solution available, slow and memory hungry. I would not call this issue settled, if only because of that.

However, it works with my emacs-based text pipeline with no changes in my makefiles at all, which is more than can be said of any prior attempts.

Mihara avatar Jul 24 '18 04:07 Mihara

Probably not the most efficient way, but if it helps anyone, I've got R, pandoc and pandoc-citeproc running fine with Termux on arm Android after installing Debian using debian_on_termux.sh. You need to get pandoc v2.2 from the debian buster testing repository, as the default installation (1.12) has segmentation fault issues. Buster also has lots of R libraries precompiled such as r-cran-tidyverse, which avoids tedious compiling issues on low RAM devices.

pricklygorse avatar Jan 31 '19 15:01 pricklygorse

For anyone who's still looking for a solution for arm devices, (I did not try the Arch way cited above and don't know if it will or will not work on arm. For x86_64 it's not really worth it, since a static binary is available and should work.) pandoc is available in https://github.com/xeffyr/termux-extra-packages

I downloaded the unstable pandoc package, and it runs miserably. Sending info in the image attached. Apparently this is an issue with the glibc library on this particular device.

Screenshot_20190809-202303 1

On the other hand, I could compile and install other packages seamlessly.

jarnowicz avatar Aug 10 '19 01:08 jarnowicz

Apparently this is an issue with the glibc library on this particular device.

It's with QEMU issue and glib (not glibc !) shows errors. We don't have native pandoc package and using official x86_64 pandoc build with QEMU which is broken for now (though, it was broken previously too in different ways on Termux for arches other than aarch64).

ghost avatar Aug 10 '19 10:08 ghost

Has anyone found a way to have pandoc on termux ?

JosiasAurel avatar Oct 15 '20 13:10 JosiasAurel

Fedora, CentOS, and OpenSUSE have Pandoc packages compiled for armv7hl, Debian and Ubunu have it built for arm64 and armhf, and ALT Linux has it for aarch64 and armh. What target architecture is needed on a typical modern Android phone? My uname -a reports aarch64. Unfortunately the ALT Linux package is not statically compiled, but it may not be that difficult to rebuilt it with static options to get a stand alone binary. Even if not the packaging should have some tips for how to get Pandoc builds going.

alerque avatar Oct 15 '20 14:10 alerque

What target architecture is needed on a typical modern Android phone?

GHC toolchain compatible with Android OS (NDK, Bionic libc). Unfortunately, none of maintainers are familiar with Haskell GHC and its build tools.

Package request labels well describe what we need: Снимок экрана от 2020-10-15 18-23-35

ghost avatar Oct 15 '20 15:10 ghost

to anyone who wants a working pandoc aarch64 static binary, I found this repo and so far it seems to work without any hiccups!

I guess it was built for a raspberry pi, but it apparently works all the same on Android in termux.

repo binary release that worked for me

hltdev8642 avatar Nov 13 '20 22:11 hltdev8642

to anyone who wants a working pandoc aarch64 static binary, I found this repo and so far it seems to work without any hiccups!

I guess it was built for a raspberry pi, but it apparently works all the same on Android in termux.

repo binary release that worked for me

How to install the package for pandoc?

iT-Boyer avatar Dec 09 '20 16:12 iT-Boyer

just extract it to a directory in your $PATH, (or just run it locally by using ./pandoc or bash ./pandoc.

Otherwise copy it into ~/bin ,/usr/bin , or somewhere else in your path :-]

hltdev8642 avatar Dec 10 '20 05:12 hltdev8642

Thanks, it can work.

iT-Boyer avatar Dec 10 '20 07:12 iT-Boyer

another solution to install pandoc

  • install https://github.com/t184256/nix-on-droid per F-Droid
  • nix-env --install pandoc

RFDAJE avatar Dec 27 '20 11:12 RFDAJE

I'm closing the issue since we already have package pandoc. (only 64 bit devices supported)

sylirre avatar Jan 12 '23 12:01 sylirre