Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Building pdftk without gcj?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
musv
Advocate
Advocate


Joined: 01 Dec 2002
Posts: 3254
Location: de

PostPosted: Mon Oct 16, 2017 1:17 pm    Post subject: Building pdftk without gcj? Reply with quote

Hi there,

regarding to the topics Remove old gcc versions and pdftk gcc6 gjar I stumbled into the same problem. I removed gcc-5.4.0, because everything built fine with gcc-6.4.0.

Now pdfk is the only package, which needs gcj and therefore gcc-5.4.0.

Is there a way to build pdfk somehow else, e.g. with javac of openjdk?
Back to top
View user's profile Send private message
fedeliallalinea
Bodhisattva
Bodhisattva


Joined: 08 Mar 2003
Posts: 22326
Location: here

PostPosted: Mon Oct 16, 2017 1:58 pm    Post subject: Re: Building pdftk without gcj? Reply with quote

musv wrote:
Is there a way to build pdfk somehow else, e.g. with javac of openjdk?

Probably yes but you should change Makefile (here an old incomplete example)
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
musv
Advocate
Advocate


Joined: 01 Dec 2002
Posts: 3254
Location: de

PostPosted: Mon Oct 16, 2017 4:27 pm    Post subject: Reply with quote

The last version ist from 2013. I dropped it and replaced it with qpdf.

Unfortunately Impressive has pdftk as a mandatory dependency. But in the next time I don't have the need of any presentations. So I dropped this tool too.
Back to top
View user's profile Send private message
dilfridge
Developer
Developer


Joined: 18 Sep 2010
Posts: 111
Location: Regensburg, Germany

PostPosted: Mon Oct 16, 2017 9:01 pm    Post subject: Re: Building pdftk without gcj? Reply with quote

musv wrote:
Hi there,

regarding to the topics Remove old gcc versions and pdftk gcc6 gjar I stumbled into the same problem. I removed gcc-5.4.0, because everything built fine with gcc-6.4.0.

Now pdfk is the only package, which needs gcj and therefore gcc-5.4.0.

Is there a way to build pdfk somehow else, e.g. with javac of openjdk?



Nope. Many people have tried, unsuccessfully.
Back to top
View user's profile Send private message
monsieurp
Developer
Developer


Joined: 22 Apr 2015
Posts: 4

PostPosted: Tue Nov 21, 2017 9:20 am    Post subject: Reply with quote

Please have a look at https://bugs.gentoo.org/562568 to find out what we intend to do with pdftk. There's really nothing we can do at the moment. As James writes in the bug report, upstream promised to deliver a gcj-free version 2 years ago and haven't delivered yet. Unless this happens or someone decides to rewrite pdftk in pure Java (i.e. using the JDK), we will most likely mask and punt this package from Portage at some point. :(
Back to top
View user's profile Send private message
nmel
n00b
n00b


Joined: 12 Mar 2017
Posts: 17

PostPosted: Mon Jan 01, 2018 11:12 pm    Post subject: Reply with quote

I'm curious if it possible to build pdftk statically. In this case we can compile once and then remove gcc-5.
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 2538
Location: Canada

PostPosted: Tue Jan 02, 2018 6:25 am    Post subject: Reply with quote

musv wrote:
The last version ist from 2013. I dropped it and replaced it with qpdf.

Unfortunately Impressive has pdftk as a mandatory dependency. But in the next time I don't have the need of any presentations. So I dropped this tool too.


Well, if you look at the timestamp of qpdf tarball, it is Jan 14, 2014, barely out of 2013 either :) Actually oldest tarball on my installation is from 2001, so what ? As long as the code works, its age is irrelevant. In my work I run my some of my own codes from 1987.
Back to top
View user's profile Send private message
kite14
Apprentice
Apprentice


Joined: 07 Nov 2006
Posts: 199
Location: Pordenone/Italy

PostPosted: Tue Jan 02, 2018 9:06 am    Post subject: Reply with quote

musv wrote:
Unfortunately Impressive has pdftk as a mandatory dependency. But in the next time I don't have the need of any presentations. So I dropped this tool too.


Reading the manual of Impressive, looks like pdftk is just a recommended package, used to fetch PDF metadata; it becomes mandatory only if muPDF is not available (in my systems mupdf is pulled in as a dependency of nel-print/cups-filters with pdf USE flag enabled)

I've tried to install it, and portage doesn't complain about pdftk being masked:
Code:
~ $ emerge -pv impressive

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  N     ] media-libs/sdl-mixer-1.2.12-r4::gentoo  USE="flac mad mp3 vorbis wav -fluidsynth -midi -mikmod -mod -modplug -playtools -smpeg -static-libs -timidity" ABI_X86="(64) -32 (-x32)" 3621 KiB
[ebuild  N     ] media-libs/sdl-ttf-2.0.11-r1::gentoo  USE="X -static-libs" ABI_X86="(64) -32 (-x32)" 3959 KiB
[ebuild  N     ] x11-apps/xrandr-1.5.0::gentoo  179 KiB
[ebuild  N     ] media-libs/smpeg-0.4.4-r10::gentoo  USE="X opengl -debug -static-libs" ABI_X86="(64) -32 (-x32)" CPU_FLAGS_X86="(-mmx)" 312 KiB
[ebuild  N     ] dev-python/pygame-1.9.2_pre20120101-r2::gentoo  USE="X -doc -examples {-test}" PYTHON_TARGETS="python2_7 python3_5 -python3_4" 2210 KiB
[ebuild  N    ~] app-office/impressive-0.11.2::gentoo  PYTHON_TARGETS="python2_7" 194 KiB

Total: 6 packages (6 new), Size of downloads: 10473 KiB

The following keyword changes are necessary to proceed:
 (see "package.accept_keywords" in the portage(5) man page for more details)
# required by impressive (argument)
=app-office/impressive-0.11.2 ~amd64

So, as far as I can tell, no need to drop this tool :D
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1564
Location: Germany

PostPosted: Thu Jan 04, 2018 1:47 pm    Post subject: Reply with quote

I ran into this and the currently last comment on the bugreport, is that it really seems dead.
Too bad, pdftk always was a central important tool for me. I used it to split and merge PDFs, this could be replaced by pdfseparate from poppler.

Additionally I created a script pdfshrink [1] that uses pdftk, qpdf and gs in multiple steps for compression as I noticed that the compression results are very different between those 3. Most efficient compression however was gs with -dPDFSETTINGS ebook. Take care, some but very rare pdfs get broken by that script. But mosty PDFs are compressed to 50% and better, lossy but good enough to read.

[1] https://bitbucket.org/massimo/tools/src/

I tried building pdftk, it pulled gcc-5.4.0-r4 which I unmasked but that failed with
Code:
error: invalid use of incomplete type ‘struct _Jv_catch_fpe(int, siginfo_t*, void*)::ucontext

Is there any way to get a gcc usable for pdftk compiled? Is there any chance to add at least some pdftk-bin?
_________________
ppc:PowerBook5,8 15"(1440)-G4/1.67,2G|amd64:HP EliteBook 8560w,i7-2620M,16G|Acer Z5610 (Core2QuadQ8200),8G|amd64-prefix:OpenSuse|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770
Lila-Theme
Back to top
View user's profile Send private message
proteusx
Apprentice
Apprentice


Joined: 21 Jan 2008
Posts: 247

PostPosted: Thu Jan 04, 2018 2:36 pm    Post subject: Reply with quote

Massimo

Has your gcc-5.4.0 set +gcj?

pdftk, for me too, is an absolutely necessary tool.
I care not if it is dead or alive as long as it works and it does what I want.

Here is what I did to migrate to profile 17
and keep pdftk.
Back to top
View user's profile Send private message
R0b0t1
Apprentice
Apprentice


Joined: 05 Jun 2008
Posts: 255

PostPosted: Fri Jan 05, 2018 5:33 am    Post subject: Reply with quote

Massimo B. wrote:
I tried building pdftk, it pulled gcc-5.4.0-r4 which I unmasked but that failed with
Code:
error: invalid use of incomplete type ‘struct _Jv_catch_fpe(int, siginfo_t*, void*)::ucontext

Is there any way to get a gcc usable for pdftk compiled? Is there any chance to add at least some pdftk-bin?
It looks like this is related to a change in linux-unwind.h, where struct ucontext was changed to ucontext_t so as to comply with POSIX naming conventions. It seems like the error is nonexistent with GCC 7.2; the fix was added in commit 14c2f22a1877f6b60a2f7c2f83ffb032759456a6 to GCC 7.1.

I'm having some other issues with the gcc-5.4.0-r4 ebuild (xattr on tmpfs?), but I may be able to get it working tomorrow. If you do get very stuck there are some people interested in keeping GCJ usable, even if you have to compile an old version of GCC. You may want to check their mailing list.
Back to top
View user's profile Send private message
marcv
n00b
n00b


Joined: 25 Feb 2006
Posts: 16
Location: Catalonia

PostPosted: Wed Feb 21, 2018 6:24 pm    Post subject: Reply with quote

I got tired of waiting for upstream to publish a java version of pdftk and I did it myself. If somebody wants to play with it, you can find it at http://gitlab.com/marcvinyals/pdftk. There is even a live ebuild at http://repo.or.cz/marcv-overlay.git/blob_plain/HEAD:/app-text/pdftk/pdftk-9999.ebuild.
_________________
blah.


Last edited by marcv on Fri Mar 16, 2018 9:23 am; edited 1 time in total
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1753
Location: United Kingdom

PostPosted: Thu Feb 22, 2018 8:34 am    Post subject: Reply with quote

Nice one, marcv. I've taken the liberty of mentioning your re-write in the Gentoo bug report mentioned earlier in this thread.
_________________
Clevo W230SS: amd64 OpenRC elogind nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 OpenRC elogind xf86-video-ati. Dual boot Win 7 Pro 64-bit.
KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
Joseph_sys
Advocate
Advocate


Joined: 08 Jun 2004
Posts: 2571
Location: Edmonton, AB

PostPosted: Thu Mar 15, 2018 5:39 pm    Post subject: Reply with quote

marcv wrote:
I got tired of waiting for upstream to publish a java version of pdftk and I did it myself. If somebody wants to play with it, you can find it at http://gitlab.com/marcvinyals/pdftk. There is even a live ebuild at http://repo.or.cz/marcv-overlay.git/blob_plain/HEAD:/app-text/pdftk/pdftk-9999.ebuild.


I've install "pdftk-9999" and it is working as it should, thanks.
gcc-5.4.0 is gone as well.
_________________
#Thelma
Back to top
View user's profile Send private message
Melf
n00b
n00b


Joined: 18 Oct 2006
Posts: 44

PostPosted: Fri Mar 30, 2018 10:30 am    Post subject: Reply with quote

Awesome, the pdftk-9999.ebuild works for me as well. Thank you!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum