[SOLVED] Building pdftk on Slackware 15.0 ( -current )
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
4. Invoke the pdftk.SlackBuild as root ( via su - ) as follows:
Code:
sh # start a sub-shell to preserve your env
. /etc/profile.d/gcc5.sh # source Alien Bob's gcc5 Environment
SLACKVER=15 ./pdftk.SlackBuild # force a Slackware-current build
exit # return to your standard shell
Note: you will see all the usual 'problems' with the source that were reported on my Slackware 14.2 SlackBuild session.
After all the wordy output, you should end up with the usual /tmp/pdftk-2.02-x86_64-1_SBo.tgz package.
Install as usual ( installpkg /tmp/pdftk-2.02-x86_64-1_SBo.tgz ).
I built and installed pdftk on a 'fairly clean' Slackware64-current and it works as expected for all our use-cases.
For the record, these are the SBo and alien packages on that particular box:
Code:
# ls -la /var/log/packages/*{SBo,alien}
-rw-r--r-- 1 root root 474644 Mar 2 05:51 /var/log/packages/gcc5-5.5.0-x86_64-1SBo
-rw-r--r-- 1 root root 4206 Feb 11 07:18 /var/log/packages/intel-microcode-20171117-noarch-1_SBo
-rw-r--r-- 1 root root 1251 Feb 11 07:13 /var/log/packages/iucode_tool-2.3.1-x86_64-1_SBo
-rw-r--r-- 1 root root 786719 Feb 22 07:00 /var/log/packages/libreoffice-6.0.1-x86_64-1alien
-rw-r--r-- 1 root root 8477 Feb 22 07:00 /var/log/packages/libreoffice-dict-en-6.0.1-x86_64-1alien
-rw-r--r-- 1 root root 1084 Feb 22 07:00 /var/log/packages/libreoffice-kde-integration-6.0.1-x86_64-1alien
-rw-r--r-- 1 root root 2030119 Feb 22 07:00 /var/log/packages/libreoffice-sdkdoc-6.0.1-noarch-1alien
-rw-r--r-- 1 root root 18370 Feb 4 10:14 /var/log/packages/logwatch-7.4.3-noarch-1alien
-rw-r--r-- 1 root root 2623 Mar 4 07:21 /var/log/packages/pdftk-2.02-x86_64-1_SBo
-rw-r--r-- 1 root root 540881 Feb 28 06:53 /var/log/packages/qt5-5.9.4-x86_64-2alien
Thanks to Alien Bob for the gcc5.SlackBuild and to 55020 and qunying for the head's up !
This preliminary work saved a surprise when I switch over to Slackware 15.0
thanks! I pushed the modifications together with Alien Bob's gcc5 to the unofficial repository for current (they will be available at the next global update).
as i am trying to compile pdftk on a Slack150 machine (not -current as folks below but a true 15.0) i am getting some error messages after which things stop compiling :
Code:
/bin/sh: line 1: gjar: command not found
make[1]: [Makefile:51: java_lib.o] Error 127 (ignored)
gcj -O2 -fPIC -Wall -fsource=1.3 --encoding=UTF-8 --classpath="/usr/share/java:/tmp/SBo/pdftk-2.02-dist/java:." -c java_lib.jar
/bin/sh: line 1: gcj: command not found
make[1]: [Makefile:52: java_lib.o] Error 127 (ignored)
make[1]: Leaving directory '/tmp/SBo/pdftk-2.02-dist/java'
make: *** No rule to make target '/tmp/SBo/pdftk-2.02-dist/pdftk/../java/java_lib.o', needed by 'pdftk.o'. Stop.
yes, i obviously already installed Alien's :
Code:
openjre-8u312_b07-x86_64-1alien.txz
what is today the best method, on a Slack150 machine, to get pdftk back to work ?
I believe you need to install the SBo Current gcc5 Package first followed by the SBo Current pdftk Package.
Check the SBo pdftk.README:
Code:
If PDF is electronic paper, then pdftk is an electronic staple-remover,
hole-punch, binder, secret-decoder-ring, and X-Ray-glasses. Pdftk is a
command-line tool for doing everyday things with PDF documents. Keep one
in the top drawer of your desktop and use it to merge PDF documents,
split PDF documents, apply watermarks, repair corrupt PDF, update PDF
metadata, and more. pdftk does not require Acrobat and is free software.
NOTE: Starting with Slackware 15.0 pdftk compilation requires SBo gcc-5
because gcc-java was dropped from the GNU Compiler Collection as of gcc-7:
don't forget to source /etc/profile.d/gcc5.sh before starting to build
this, like
. /etc/profile.d/gcc5.sh
It worked fine on my Slackware Current -> Slackware 15.0 System
HTH
-- kjh
p.s. The SlackBuilds you need are in Ponce's Repo, not in the 14.2 Repo:
my (currently) only remaining, perhaps naïve question is how to get hold of the complete gcc5 SBo package, or the necessary usual three gcc5 SBo files ? the same for PDFTK's case ? i never owned a GITHUB account which meanwhile has anyway closed its doors to the public so that wget doesn't work anymore. moreover i don't know how to get hold of '-current' or '15.0' files on SlackBuilds in case they are found there at all at this early Slack150 stage ?
what a cookbook recipe ! thank you for that, kjhambrick ! i will try it in minute ! yes, the https route is the way to go with github, a colleague at work just told me so too !
sorry to get back to you, dear kjhambrick, with new questions - instead of a hurrah...
how the heck do i use or do i install this gcc5 thing ? it appears to me (by entirely following your instructions below) that gcc5.SlackBuild does not finish its job as i don't find an output file to install with installpkg and nothing like gcc5.sh under /etc/profile.d/ either. prior to compiling i located three files on the web such as ecj-4.9.jar , fastjar-0.98.tar.gz and gcc-5.5.0.tar.xz in order to make SlackBuild run... what do i do wrong ? all my slack150 boxes are pretty virgin still, btw.
by the way, i played with all [y/n/etc] options under :
...
fastjar-0.98/depcomp
fastjar-0.98/acinclude.m4
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|2009-01-14 Jakub Jelinek <jakub@redhat.com>
|
| * jartool.c (make_manifest): Initialize current_time before
| calling unix2dostime on it.
|
|--- fastjar-0.97/jartool.c.jj 2008-10-15 18:35:37.000000000 +0200
|+++ fastjar-0.97/jartool.c 2009-01-14 15:40:50.000000000 +0100
--------------------------
patching file jartool.c
Using Plan A...
Reversed (or previously applied) patch detected! Assume -R? [n]
Apply anyway? [n]
Skipping patch.
Hunk #1 ignored at 820.
Hunk #2 ignored at 828.
2 out of 2 hunks ignored -- saving rejects to file jartool.c.rej
done
pwd
/tmp/sbo-current/development/gcc5
ls
README c99.sh ecj.sh fastjar-patches/ gcc5.SlackBuild* libgcj-5.pc profile.d/
c89.sh ecj-4.9.jar fastjar-0.98.tar.gz gcc-5.5.0.tar.xz gcc5.info patches/ slack-desc.gcc5
uff, difficult birth...i remember that in the past our SBo's included a few more commands like config, make, etc - but here i am a bit lost, sorry about that !
cd /tmp/sbo-current/development/gcc5/ and use wget ( for example ) to download the source into your working directory.
One way to do it:
Code:
cd /tmp/sbo-current/development/gcc5
source ./gcc5.info
for s in $DOWNLOAD
do
wget $s || ( echo "wget $s did not work" >&2 ; exit 1 ; )
done
# be sure to check the md5sums listed in the MD5SUM Variable too !
#
# one way to do that:
echo '0f70424213b4a1113c04ba66ddda0c1f gcc-5.5.0.tar.xz
0e0318be407e51fdf7ba6777eabfdf73 antlr-runtime-3.4.jar
7339f199ba11c941890031fd9981d7be ecj-4.9.jar
2659f09c2e43ef8b7d4406321753f1b2 fastjar-0.97.tar.gz' | md5sum -c -
You should end up with four Downloads in your directory in addition to the original content above.
gosh, kjhambrick, thank you again for your help ! i wasn't familiar with the *.info file although i use SBo frequently, for years, but perhaps always in the comfort zone of just running smooth *.SlackBuild rides. i am also not really a programmer, just a scientist who uses Slackware for 28½ years...
now, i removed fastjar-0.98.tar.gz in order to use the .97 version as indicated - but that didn't do good :
Code:
patching file Makefile.in
Using Plan A...
Hunk #1 succeeded at 515.
done
checking for a BSD-compatible install... /usr/bin/ginstall -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc-5
checking for C compiler default output file name...
configure: error: C compiler cannot create executables
See `config.log' for more details.
make: *** No targets specified and no makefile found. Stop.
while by re-including fastjar-0.98.tar.gz again we progressed a little bit further - though playing with 'y' or 'n' under "Assume -R? [n] y" didn't really make a difference to finish the job - which it didn't :
Code:
fastjar-0.98/acinclude.m4
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|2009-01-14 Jakub Jelinek <jakub@redhat.com>
|
| * jartool.c (make_manifest): Initialize current_time before
| calling unix2dostime on it.
|
|--- fastjar-0.97/jartool.c.jj 2008-10-15 18:35:37.000000000 +0200
|+++ fastjar-0.97/jartool.c 2009-01-14 15:40:50.000000000 +0100
--------------------------
patching file jartool.c
Using Plan A...
Reversed (or previously applied) patch detected! Assume -R? [n] y
Hunk #1 succeeded at 820.
Hunk #2 succeeded at 828.
done
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|2009-12-21 Chris Ball <cjb@laptop.org>
|
| * jartool.c (add_file_to_jar): Test write return value against -1
| instead of 1.
|
|--- fastjar-0.97/jartool.c.jj 2008-10-15 12:35:37.000000000 -0400
|+++ fastjar-0.97/jartool.c 2009-12-22 06:48:09.309530000 -0500
--------------------------
patching file jartool.c
Using Plan A...
Hunk #1 succeeded at 1257.
done
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|2010-03-01 Richard Guenther <rguenther@suse.de>
|
| * jartool.c (read_entries): Properly zero-terminate filename.
|
|--- fastjar-0.97/jartool.c 6 Sep 2009 22:16:00 -0000 1.59
|+++ fastjar-0.97/jartool.c 1 Mar 2010 15:38:43 -0000 1.60
--------------------------
patching file jartool.c
Using Plan A...
Hunk #1 succeeded at 790.
done
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|2010-06-10 Jakub Jelinek <jakub@redhat.com>
| Dan Rosenberg <dan.j.rosenberg@gmail.com>
|
| * jartool.c (extract_jar): Fix up checks for traversal to parent
| directories, disallow absolute paths, make the code slightly more
| efficient.
|
|--- fastjar-0.97/jartool.c.jj 2009-09-07 00:10:47.000000000 +0200
|+++ fastjar-0.97/jartool.c 2010-06-08 20:00:29.000000000 +0200
--------------------------
patching file jartool.c
Using Plan A...
Hunk #1 succeeded at 1731 (offset 1 line).
Hunk #2 succeeded at 1749 (offset 1 line).
Hunk #3 succeeded at 1779 (offset 1 line).
Hunk #4 succeeded at 1796 (offset 1 line).
Hunk #5 succeeded at 1808 (offset 1 line).
Hunk #6 succeeded at 1892 (offset 1 line).
done
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|2010-03-24 Jan Kratochvil <jan.kratochvil@redhat.com>
|
| * Makefile.am (POD2MAN): Provide --date from ChangeLog.
| * Makefile.in: Regenerate.
|
|--- fastjar-0.97/Makefile.am.jj 2008-10-16 04:24:55.000000000 -0400
|+++ fastjar-0.97/Makefile.am 2010-06-21 09:29:41.021398000 -0400
--------------------------
patching file Makefile.am
Using Plan A...
Hunk #1 succeeded at 39.
Hmm... The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- fastjar-0.97/Makefile.in.jj 2008-10-16 04:15:16.000000000 -0400
|+++ fastjar-0.97/Makefile.in 2010-06-21 09:30:15.882810000 -0400
--------------------------
patching file Makefile.in
Using Plan A...
Hunk #1 FAILED at 515.
1 out of 1 hunk FAILED -- saving rejects to file Makefile.in.rej
done
i must be missing something else in my pretty new Slack150 setup, or missing some run variable(s) unknown to me ?
Code:
root@MyMachine:/tmp/sbo-current/development/gcc5# ls -la
total 74224
drwxr-xr-x 5 root root 4096 Feb 23 10:35 ./
drwxr-xr-x 607 root root 16384 Feb 22 14:27 ../
-rw-r--r-- 1 root root 2087 Feb 22 14:27 README
-rw-r--r-- 1 root root 164368 Jul 7 2017 antlr-runtime-3.4.jar
-rw-r--r-- 1 root root 240 Feb 22 14:27 c89.sh
-rw-r--r-- 1 root root 231 Feb 22 14:27 c99.sh
-rw-r--r-- 1 root root 1619429 Feb 22 14:39 ecj-4.9.jar
-rw-r--r-- 1 root root 1619429 Dec 10 2013 ecj-4.9.jar.1
-rw-r--r-- 1 root root 124 Feb 22 14:27 ecj.sh
-rw-r--r-- 1 root root 676393 Oct 16 2008 fastjar-0.97.tar.gz
-rw-r----- 1 root root 717984 Feb 23 10:35 fastjar-0.98.tar.gz
drwxr-xr-x 2 root root 193 Feb 22 14:27 fastjar-patches/
-rw-r----- 1 root root 71096120 Oct 10 2017 gcc-5.5.0.tar.xz
-rwxr-xr-x 1 root root 20733 Feb 22 14:27 gcc5.SlackBuild*
-rw-r--r-- 1 root root 608 Feb 22 14:27 gcc5.info
-rw-r--r-- 1 root root 218 Feb 22 14:27 libgcj-5.pc
drwxr-xr-x 2 root root 4096 Feb 22 14:27 patches/
drwxr-xr-x 2 root root 37 Feb 22 14:27 profile.d/
-rw-r--r-- 1 root root 852 Feb 22 14:27 slack-desc.gcc5
i could try again on another Slack150 box but that wouldn't change much i guess...
i am also wondering if it's worth all the effort of all parties involved here - in case something like the python-based stapler seems to do the same job as pdftk has done in the past ? in general i like to finish things and not give up easily but in the case of pdftk we may deal with the ancient java genes of a dinosaur...?
This is odd: The output from configure from your SlackBuild Session says you've already got gcc5 but that it cannot make executables ????
Quote:
Code:
checking whether make sets $(MAKE)... yes
checking for gcc... gcc-5
checking for C compiler default output file name...
configure: error: C compiler cannot create executables
What's up with that ?
Are you running a Pure-D, Full-Install Slackware 15.0 System ?
Is it a new install or did you upgrade an older version of Slackware ?
What does this `ls -la |grep -i gcc` command show ?
Code:
ls -la /var/lib/pkgtools/packages |grep -i gcc
Just to be sure nothing has broken recently, I reran the gcc5.SlackBuild in a freshly populated gcc5 SlackBuild directory
It worked.
However, I have MultiLib installed and Alien Bob says in the gcc5 README that if the gcc5.SlackBuild detects MultiLib installation then it will build a MultiLib gcc5.
Digging around in Eric's gcc5.SlackBuild script a bit, I saw how to disable MultiLib, so ...
I backed up gcc5.SlackBuild as gcc5~01.SlackBuild and I turned off MULTILIB and set GCC_ARCHOPTS="--disable-multilib"
These are the diffs:
Code:
[root@kjhlt7 gcc5-SBo]# diff -Naur gcc5~01.SlackBuild gcc5.SlackBuild
--- gcc5~01.SlackBuild 2022-02-12 09:33:11.049135347 -0600
+++ gcc5.SlackBuild 2022-02-23 12:33:53.767891795 -0600
@@ -75,9 +75,15 @@
if [ "$ARCH" = "x86_64" ]; then
if [ -f /usr/lib/libc.a ]; then
- # If we find a 32bit C library on 64bit Slackware, assume multilib:
- GCC_ARCHOPTS="--enable-multilib"
- MULTILIB="YES"
+ # # If we find a 32bit C library on 64bit Slackware, assume multilib:
+ # GCC_ARCHOPTS="--enable-multilib"
+ # MULTILIB="YES"
+
+ # kjh was here
+
+ GCC_ARCHOPTS="--disable-multilib"
+ MULTILIB="NO"
+
else
GCC_ARCHOPTS="--disable-multilib"
MULTILIB="NO"
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.