Ghostscript

Before switching to the version of Haiku using packaging and a protected packaged folder, I used ghostscript, and it worked well. Now I tried installing ghostscript from HaikuDepot, and it doesn’t work. It won’t run. So I tried installing it into non-packaged. It quits because it can’t find gs.init.
I found that in the folder 5.50, and tried running gs from there, but it invariably quits with some error code. It can’t do any of the examples that come in the package. It used to work before packaging. Any ideas on how to get it to run ?

Are you running the ancient one from my repo? Perhaps the script in /boot/system/boot/post-install malfunctioned. just track that down and run it in a Terminal.

That version of GS had hard-coded paths that I had to circumvent with some symlink-fu. Someone with better skills should really take a shot at compiling a more up-to-date version.

@KantosKan: However you can find Ghostscript in HaikuDepot, it isn’t a part of the Haiku project. It comes from the HaikuPorts repository. HaikuPorts is an independant project, so a “bugreport” on a Haiku OS general forum won’t help you much.

Please, create an issue at the HaikuPorts github page here:

Please,remember to provide all the required information:
haiku version, architecture, ghostscript version, correct error message, and if you can, please tell us what do you try to accomplish.

Without it we cannot help, as it works nicely for me:

Umm, this is actually a current ghostscript, already in haikuports, but not in haikudepot yet. So i suppose you talking about the old port from Clasqm. I have nothing to do with that.
If you want to test the current ghostscript, you have to install it with haikuporter.

I downloaded ghostscript from HaikuDepot, and tried installing it. It wouldn’t run. Then I opened the package with Expander and copied the files into system/non-packaged. When I tried it, it reported “unable to find gs.init”. I found this in a folder called 5.50. I copied all of 5.50 into another folder also containing gs. I tried some of the examples, without success. The most successful run is this.

/system/non-packaged/apps/GhostScript/Ghostscript> ./gs -dSAFER -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=X.pdf -f examples/alphabet.ps
Aladdin Ghostscript 5.50 (1998-9-16)
Copyright © 1998 Aladdin Enterprises, Menlo Park, CA. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Can’t find (or can’t open) font file p052023l.pfb.
Can’t find (or can’t open) font file URWPalladioL-Ital.
Can’t find (or can’t open) font file URWPalladioL-Ital.
Substituting font Helvetica-Oblique for URWPalladioL-Ital.
Can’t find (or can’t open) font file n019023l.pfb.
Can’t find (or can’t open) font file NimbusSanL-ReguItal.
Can’t find (or can’t open) font file NimbusSanL-ReguItal.
Unable to substitute for font.
Error: /invalidfont in findfont
Operand stack:
(Palatino-Italic) Font (Palatino-Italic) 24500 (Palatino-Italic) --nostringval-- Helvetica-Oblique NimbusSanL-ReguItal
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- 2 3 %oparray_pop --nostringval-- --nostringval-- false 1 %stopped_push 1 3 %oparray_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- 1 3 %oparray_pop 2 3 %oparray_pop --nostringval-- --nostringval-- --nostringval-- 5 4 %oparray_pop --nostringval-- --nostringval-- %loop_continue --nostringval-- 1 -1 1 --nostringval-- %for_neg_int_continue --nostringval-- --nostringval–
Dictionary stack:
–dict:905/941(G)-- --dict:0/20(G)-- --dict:57/200(L)-- --dict:16/23(G)-- --dict:905/941(G)–
Current allocation mode is local
Last OS error: No such file or directory
Current file position is 930

Here are some others.


/system/non-packaged/apps/GhostScript/Ghostscript> ./gs -dSAFER -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=X.pdf -f examples/vasarely.ps
Aladdin Ghostscript 5.50 (1998-9-16)
Copyright © 1998 Aladdin Enterprises, Menlo Park, CA. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
GS>quit
gsdll_exit returns 0

/system/non-packaged/apps/GhostScript/Ghostscript> ./gs -dSAFER -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=X.pdf -f examples/vasarely.ps
Aladdin Ghostscript 5.50 (1998-9-16)
Copyright © 1998 Aladdin Enterprises, Menlo Park, CA. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
GS>quit
gsdll_exit returns 0

They both produce an empty output file (0 bytes).

Have you select the right version of your system (x86_ggc2 hybrid…)?

It is an old BeOS port, and he was able to run it, so yes.

KantosKan, i wouldn’t fight with that stuff. Mate it is almost 20 years old, made for BeOS, from an unknown porter, you can’t have big expectations.

Just compile the new version from haikuports. I made that port, tested on x86_64 with the example files, works nicely.

1 Like

Thanks for your reply, I have no experience compiling from haikuports or using git. I write all my code with Paladin, which produces a ready application. Can you tell me how to get started ?
Thanks.

You can find the wiki here:

Clone haikuporter, clone haikuports, set up haikuporter (on gcc2h do not forget to enable the secondary arch in the haikuporter config file), then:

haikuporter ghostscript_gpl_x86 --get-dependencies

Report back if something goes wrong.

Ghostscript have plenty dependencies, so it could happen, that you won’t able to compile it. If haikuporter complains about missing dependencies, then you have to compile them too (with _x86 prefix on gcc2h). Or ask somebody on IRC to build it for gcc2h secondary arch for you and upload it to the Depot.

Thanks very much.

OK, I cloned haikuporter and haikuports. set target architecture = x86_gcc2,
secondary = x86. I tried haikuporter ghostscript as indicated. Many dependencies are marked as unsupported on the target architecture, some are marked as untested. At the end there is a message “skipping ghostscript_gpl_x86-9.21 as it is untested on current architecture”.
Then “error – no version of ghostscript can be built”. Any ideas ?

Then wait for the buildbots.

The ghostscript recipe is currently only tested for 64bit. You should set ALLOW_UNTESTED="yes" in the haikuports.config file.
Though, I tried to build for x86 as 2ndary architecture myself, and it fails…

More info how to build packages with haikuporter at this blogpost.

Generally, it’s always a good idea to include the exact command line you used to build something. Even better copy and paste it and all output to a pastebin service like sprunge.us.

Thanks for the suggestions. I spent quite a lot of time trying to get it to work, :frowning:
Your blogpost is very helpful.