oxplot / pdfrankenstein

PDF Annotator of Nightmares 🎃
BSD 3-Clause "New" or "Revised" License
188 stars 5 forks source link

Build fails on Debian 11 #11

Closed IeP4nieF closed 2 years ago

IeP4nieF commented 2 years ago

Hi there,

great project! But build fails on Debian 11:

~/pdfrankenstein$ go build
main.go:5:2: package embed is not in GOROOT (/usr/lib/go-1.15/src/embed)

inkscape, poppler-utils and qpdf are installed:

$ inkscape -V
Inkscape 1.0.2 (e86c870879, 2021-01-15)
Pango version: 1.46.2

$ apt search poppler-utils
poppler-utils/stable,now 20.09.0-3.1 amd64  [installiert]
  PDF-Werkzeuge (auf Basis von Poppler)

$ qpdf --version
qpdf version 10.1.0

Any hint on this issue?

Thanks!

oxplot commented 2 years ago

You need go 1.18 but I'm surprised you didn't get a warning about it given it's specified in go.mod.

EDIT: seems like it's not meant to enforce it: https://github.com/golang/go/issues/48571

IeP4nieF commented 2 years ago

Ok, thanks for the fast answere.

I'll go with the binary from release page then.

Perhaps you should add "go >=1.18" under "Requirements".

Nickwiz commented 1 year ago

Expect it is the same on Debian. I'm on Ubuntu 18.4 LTS.

A bit hackish, but the way I did it:

  1. Clone and enter:
git clone https://github.com/oxplot/pdfrankenstein.git
cd pdfrankenstein
  1. Download latest go: https://go.dev/dl/
    curl -LO https://go.dev/dl/go1.20.1.linux-amd64.tar.gz
    tar -xvf go1.20.1.linux-amd64.tar.gz
    export GOROOT=$PWD/go
    export PATH=$GOROOT/bin:$PATH
    go version

go version go1.20.1 linux/amd64

  1. Download latest qpdf AppImage (v11.3.0): https://github.com/qpdf/qpdf/releases and create a link in home/bin for it (under a custom name in case one want to use the standard).

    curl -LO https://github.com/qpdf/qpdf/releases/download/v11.3.0/qpdf-11.3.0-x86_64.AppImage
    ln -s $PWD/qpdf-11.3.0-x86_64.AppImage $HOME/bin/qpdf.ai

  2. Modify source of pdfrankenstein to use qpdf app image:

sed -i 's/"qpdf"/"qpdf.ai"/g' session/session.go
  1. Build (I had to specify tags):
go build --tags "pango_1_42 gtk_3_22" .

Now. I have not looked at the source yet, but for what ever reason it just hangs if one start it with a PDF file or no argument. However, by using a random non-existing file it works, i.e:

./pdfrankenstein foo

then open PDF from within the application.