# FreeBSD 7.2 print/ghostscript8 installation fails



## lungten (May 12, 2009)

Can any one tell me why print/ghostscript8 installation fails?

Here's the error message:

```
cups/gdevcups.c:74:25: error: cups/raster.h: No such file or directory
cups/gdevcups.c:204: error: expected specifier-qualifier-list before 'cups_raster_t'
cups/gdevcups.c:314: warning: excess elements in struct initializer
cups/gdevcups.c:314: warning: (near initialization for 'gs_cups_device')
cups/gdevcups.c:315: error: extra brace group at end of initializer
cups/gdevcups.c:315: error: (near initialization for 'gs_cups_device')
cups/gdevcups.c:321: error: 'CUPS_ADVANCE_NONE' undeclared here (not in a function)
cups/gdevcups.c:322: error: 'CUPS_FALSE' undeclared here (not in a function)
cups/gdevcups.c:323: error: 'CUPS_CUT_NONE' undeclared here (not in a function)
cups/gdevcups.c:325: error: extra brace group at end of initializer
cups/gdevcups.c:325: error: (near initialization for 'gs_cups_device')
cups/gdevcups.c:326: error: extra brace group at end of initializer
cups/gdevcups.c:326: error: (near initialization for 'gs_cups_device')
cups/gdevcups.c:328: error: 'CUPS_JOG_NONE' undeclared here (not in a function)
cups/gdevcups.c:329: error: 'CUPS_EDGE_TOP' undeclared here (not in a function)
cups/gdevcups.c:330: error: extra brace group at end of initializer
cups/gdevcups.c:330: error: (near initialization for 'gs_cups_device')
cups/gdevcups.c:337: error: 'CUPS_ORIENT_0' undeclared here (not in a function)
cups/gdevcups.c:339: error: extra brace group at end of initializer
cups/gdevcups.c:339: error: (near initialization for 'gs_cups_device')
cups/gdevcups.c:349: error: 'CUPS_ORDER_CHUNKED' undeclared here (not in a function)
cups/gdevcups.c:350: error: 'CUPS_CSPACE_K' undeclared here (not in a function)
cups/gdevcups.c:370: warning: excess elements in struct initializer
cups/gdevcups.c:370: warning: (near initialization for 'gs_cups_device')
cups/gdevcups.c: In function 'cups_close':
cups/gdevcups.c:442: error: 'gx_device_cups' has no member named 'stream'
cups/gdevcups.c:444: warning: implicit declaration of function 'cupsRasterClose'
cups/gdevcups.c:444: error: 'gx_device_cups' has no member named 'stream'
cups/gdevcups.c:445: error: 'gx_device_cups' has no member named 'stream'
cups/gdevcups.c: In function 'cups_decode_color':
cups/gdevcups.c:481: error: 'gx_device_cups' has no member named 'header'
cups/gdevcups.c:481: error: 'CUPS_CSPACE_KCMYcm' undeclared (first use in this function)
cups/gdevcups.c:481: error: (Each undeclared identifier is reported only once
cups/gdevcups.c:481: error: for each function it appears in.)
cups/gdevcups.c:482: error: 'gx_device_cups' has no member named 'header'

.........

cups/gdevcups.c: In function 'cups_get_params':
cups/gdevcups.c:724: error: 'gx_device_cups' has no member named 'header'
cups/gdevcups.c:724: warning: left-hand operand of comma expression has no effect
cups/gdevcups.c:724: warning: value computed is not used
cups/gdevcups.c:724: warning: value computed is not used
cups/gdevcups.c:728: error: 'gx_device_cups' has no member named 'header'
cups/gdevcups.c:728: warning: left-hand operand of comma expression has no effect
cups/gdevcups.c:728: warning: value computed is not used
cups/gdevcups.c:728: warning: value computed is not used
cups/gdevcups.c:732: error: 'gx_device_cups' has no member named 'header'
cups/gdevcups.c:732: warning: left-hand operand of comma expression has no effect
cups/gdevcups.c:732: warning: value computed is not used
cups/gdevcups.c:732: warning: value computed is not used
cups/gdevcups.c:736: error: 'gx_device_cups' has no member named 'header'
cups/gdevcups.c:736: warning: left-hand operand of comma expression has no effect
cups/gdevcups.c:736: warning: value computed is not used
cups/gdevcups.c:736: warning: value computed is not used
cups/gdevcups.c:741: error: 'gx_device_cups' has no member named 'header'

.......

cups/gdevcups.c:4482: error: 'CUPS_CSPACE_GMCK' undeclared (first use in this function)
cups/gdevcups.c:4483: error: 'CUPS_CSPACE_GMCS' undeclared (first use in this function)
cups/gdevcups.c:4484: error: 'CUPS_CSPACE_RGBA' undeclared (first use in this function)
cups/gdevcups.c:4486: error: 'CUPS_CSPACE_CMYK' undeclared (first use in this function)
cups/gdevcups.c:4487: error: 'CUPS_CSPACE_YMCK' undeclared (first use in this function)
cups/gdevcups.c:4488: error: 'CUPS_CSPACE_KCMY' undeclared (first use in this function)
cups/gdevcups.c:4514: error: 'CUPS_CSPACE_KCMYcm' undeclared (first use in this function)
cups/gdevcups.c:4536: error: 'gx_device_cups' has no member named 'header'
cups/gdevcups.c:4538: error: 'gx_device_cups' has no member named 'header'
cups/gdevcups.c:4652: error: 'gx_device_cups' has no member named 'header'
cups/gdevcups.c:4654: error: 'gx_device_cups' has no member named 'header'
cups/gdevcups.c:4743: error: 'gx_device_cups' has no member named 'header'
cups/gdevcups.c:4750: error: 'gx_device_cups' has no member named 'header'
cups/gdevcups.c:4764: error: 'gx_device_cups' has no member named 'stream'
cups/gdevcups.c:4764: error: 'gx_device_cups' has no member named 'header'
gmake[1]: *** [obj/../soobj/gdevcups.o] Error 1
gmake[1]: Leaving directory `/usr/ports/print/ghostscript8/work/ghostscript-8.64'
gmake: *** [so] Error 2
*** Error code 1

Stop in /usr/ports/print/ghostscript8.
*** Error code 1

Stop in /usr/ports/print/ghostscript8.
```

I understand that a header file is missing but I have no clue as to where to find it.
Is cups/raster.h causing all these errors? I have my ports up to date.


----------



## graudeejs (May 12, 2009)

same problem here


----------



## lungten (May 12, 2009)

Looks like this problem is not directly from ghostscript8. It occurs in print/cups-pstoraster while installing print/cups. I installed ghostscript8 using pkg_add.

So, I am assuming that the problem is caused by missing cups/raster.h file, after all.


----------



## DutchDaemon (May 12, 2009)

Isn't it cups failing rather than ghostscript? The raster.h file is part of cups (/usr/local/include/cups/raster.h).


```
[/usr/ports/print]$ find . -name pkg-plist | while read file; do grep -l raster.h $file; done
./cups-base/pkg-plist
```


----------



## lungten (May 12, 2009)

OK, I get it but /usr/local/include/cups/raster.h is missing in my system. Does it come with the base system or am I supposed to get it from somewhere esle?


----------



## DutchDaemon (May 12, 2009)

Like I said/showed above: it's installed by cups-base.


----------



## lungten (May 12, 2009)

I don't have either cups or cups-base installed on my box. I don't know if /usr/local/include/cups is supposed to be there without those packages being installed.
This error occurs while installing cups-base or cups. Installing these packages first compiles ghostscript8 as a dependency and this is where the error occurs, inside print/ghostscript8.

I found out in Gentoo forums that there's a cyclic dependency in , how should I put it, ghostscript or cups. Could it be the same problem here?


----------



## DutchDaemon (May 12, 2009)

Might be cyclic, yes. Though not completely.

/usr/ports/print/cups-base needs ghostscript8-8.64_1 to build
/usr/ports/print/ghostscript8 does not need cups-base to build

But if it checks for raster.h, it apparently does need cups-base as a build dependency, though it's not listed as such. And that needs ghostscript8 again, yes.


----------



## lungten (May 12, 2009)

I think this is exactly what is happening here since I tried installing ghostscript8 and cups-base independently both meeting the same end.
So, what would be your suggestion? Should I be waiting for the ghostscript/cups developers to fix this or could there be a work-around?
Sorry for throwing you all this question but I am not much into hacking the source codes, and I think you could give me some directions here.
Thank you @DutchDaemon.


----------



## DutchDaemon (May 12, 2009)

It's hard for me to say where the origin of this cyclic dependency lies. You could try contacting both port maintainers first (their addresses are in the respective Makefiles) -- link to this thread and it should be clear enough. They can escalate to the authors if that's where the inconsistency was introduced.


----------



## lungten (May 12, 2009)

Thanks a lot for the help. I think I should give a try. I didn't experience this problem in my previous installations.


----------



## tangram (May 13, 2009)

I had some problems yesterday with cpus-base, cups-client and ghostscript8. Fixed the issues by deinstalling and reinstalling the ports. Can't remember the exact steps though :\.


----------



## lungten (May 13, 2009)

Thanks @tangram for pointing out. Finally, I had a smooth installation of cups-base and/or ghostscript8.

The problem was caused by print/cups-client being installed before print/ghostscript8. cups-client was installed by cups-base as a dependency before installing ghostscript8, which is installed next as another dependency.

I removed cups-client and installed ghostscript8 first. Then, proceeded with cups-base. This way I didn't encounter any errors.


----------



## Carpetsmoker (May 14, 2009)

You can also add CONFIGURE_ARGS=--disable-cups to the Makefile for ghostscript8 ... This will disable CUPS and solve the problem.


----------



## speed (May 16, 2009)

Carpetsmoker, Thank you very much!
I have installed ghostscript8 followed your suggestions.



			
				Carpetsmoker said:
			
		

> You can also add CONFIGURE_ARGS=--disable-cups to the Makefile for ghostscript8 ... This will disable CUPS and solve the problem.


----------



## hydra (May 16, 2009)

Same troubles here, I had to remove all cups ports and ghostscript8 too. Then a simple install of print/ghostscript8 followed by print/cups did the magic.


----------



## dinoex@ (May 21, 2009)

Thanks for reporting.

I have split cups into 3 ports:

print/cups-base: Server (All the heavy stuff)
print/cups-image: libcupsimage (Filters use ist to read or write cups rastefiles)
print/cups-cliint: libcups (Applications use it to print)

ghostscript uses now libcupsimage.


----------



## Mel_Flynn (May 26, 2009)

dinoex@ said:
			
		

> Thanks for reporting.
> 
> I have split cups into 3 ports:
> 
> ...



One more thing: can you make print/ghostscript8 respect WITHOUT_CUPS, like every other port?

I hacked it locally:

```
Index: print/ghostscript8/Makefile
===================================================================
RCS file: /home/ncvs/ports/print/ghostscript8/Makefile,v
retrieving revision 1.182
diff -u -r1.182 Makefile
--- print/ghostscript8/Makefile 18 May 2009 09:55:35 -0000      1.182
+++ print/ghostscript8/Makefile 23 May 2009 18:02:10 -0000
@@ -22,8 +22,7 @@
 COMMENT=       Ghostscript 8.x PostScript interpreter

 LIB_DEPENDS=   jpeg.9:${PORTSDIR}/graphics/jpeg \
-               png.5:${PORTSDIR}/graphics/png \
-               cupsimage.2:${PORTSDIR}/print/cups-image
+               png.5:${PORTSDIR}/graphics/png
 RUN_DEPENDS=   ${LOCALBASE}/share/${PORTNAME:S,8,,}/fonts/a010013l.pfb:${PORTSDIR}/print/gsfonts

 CONFLICTS=     gambc-[0-9]* ghostscript7-[0-9]* ghostscript7-*-[0-9]*
@@ -60,7 +59,8 @@
 OPTIONS=       A4SIZE  "Set A4 (not Letter) as a default paper size"   off \
                FONTCONFIG      "fontconfig support"    on \
                FT_BRIDGE       "FreeType bridge"       off \
-               X11     "X11 support"   on
+               X11     "X11 support"   on \
+               CUPS    "Cups support"  on

 MAN1=          dvipdf.1 font2c.1 gs.1 gslp.1 gsnd.1 \
                pdf2dsc.1 pdf2ps.1 pdfopt.1 pf2afm.1 pfbtopfa.1 printafm.1 \
@@ -155,6 +155,13 @@
 CONFLICTS+=    ghostscript8-[0-9]*
 .endif

+.if !defined(WITHOUT_CUPS)
+LIB_DEPENDS+=  cupsimage.2:${PORTSDIR}/print/cups-image
+.else
+PKGNAMESUFFIX:=        ${PKGNAMESUFFIX}-nocups
+CONFIGURE_ARGS+=--disable-cups
+.endif
+
 .if defined(WITHOUT_ICONV)
 . undef WITH_GS_oprp
 . undef WITH_GS_opvp
```


----------



## urandom (Jun 12, 2009)

to whom it might concern (and as a reminder for myself):

Because I also had some trouble with this ghostscript8 port, some remarks how I succeeded:  
I pkg_delete'd all *cups* packages:

```
# pkg_version -v | grep cups
cups-client-1.3.10_2                =   up-to-date with port
cups-image-1.3.10_2                 =   up-to-date with port
# pkg_delete cups-image-1.3.10_2 cups-client-1.3.10_2
# pkg_version -v | grep cups
#
```
removed old configurations:

```
# cd /usr/ports/print/cups-client
# make rmconfig
===> Removing user-configured options for cups-client-1.3.10_2
# cd /usr/ports/print/cups-image/
# make rmconfig
===> No user-specified options configured for cups-image-1.3.10_2
# cd /usr/ports/print/ghostscript8
# make rmconfig
===> Removing user-configured options for ghostscript8-8.64_5
```
and finally installed ghostscript8:

```
# portinstall ghostscript8
```
Without removing old configs make'ing ghostscript didn't run through.


----------

