# emacs will not install due to conflict in ghostscript port



## tonyhain (Apr 10, 2017)

Fresh install of 11-STABLE a couple of days ago
Install of Freeswitch/FusionPBX
Tried to add emacs

```
# cd /usr/ports/editors/emacs
# make -DBATCH install
...
===>  Checking if ghostscript9-agpl-base already installed
===>   Registering installation for ghostscript9-agpl-base-9.16_5 as automatic
Installing ghostscript9-agpl-base-9.16_5...
pkg-static: ghostscript9-agpl-base-9.16_5 conflicts with ghostscript9-base-9.06_13 (installs files into the same place).  Problematic file: /usr/local/bin/dvipdf
*** Error code 70

Stop.
make[2]: stopped in /usr/ports/print/ghostscript9-agpl-base
```
Since I don't know what installed ghostscript, or what the difference between -base- vs. -agpl-base-, I am reluctant to deinstall -base- so emacs will install. I have put emacs on all the < 11.0 systems I have built, and never run into a problem like this. Did someone change the ghostscript version recently? Is there a reason emacs needs the -agpl- version? Is it better to deinstall the -base- version, or modify the emacs make dependency tree so it avoids this conflict?

Tony


----------



## tonyhain (Apr 10, 2017)

So it looks like the problem is ImageMagick, but I don't understand why. The Makefile does not specify -agpl-base, but that is what gets picked. the makefile has a few places that look like:

```
.if ${PORT_OPTIONS:MGSLIB}
CONFIGURE_ARGS+=        --with-gslib
. if ${PORT_OPTIONS:MX11}
USES+=          ghostscript:x11
. else
USES+=          ghostscript
. endif
.else
CONFIGURE_ARGS+=        --without-gslib
.endif

# grep -I ghost Makefile
        type-dejavu.xml type-ghostscript.xml type-windows.xml type.xml
USES+=        ghostscript:x11
USES+=        ghostscript
USES+=            ghostscript:x11
USES+=            ghostscript
USES+=        ghostscript:x11,build
USES+=        ghostscript:build
```
but the build picks -agpl-base

```
/usr/ports/graphics/ImageMagick # make install
    ===>   ImageMagick-6.9.6.4_1,1 depends on executable: gmake - found
===>   ImageMagick-6.9.6.4_1,1 depends on package: pkgconf>=1.3.0_1 - found
===>   ImageMagick-6.9.6.4_1,1 depends on package: ghostscript9-agpl-base>=9.16_2 - not found
===>  Installing for ghostscript9-agpl-base-9.16_5
...
Installing ghostscript9-agpl-base-9.16_5...
pkg-static: ghostscript9-agpl-base-9.16_5 conflicts with ghostscript9-base-9.06_13 (installs files into the same place).  Problematic file: /usr/local/bin/dvipdf
*** Error code 70
```
Given that it is not clear to me how I would change the behavior. I tried make config, but there was nothing obvious about agpl, or ghostscript for that mater. something hidden in this sequence is picking 9-agpl-base rather than 9-agpl-x11, 9-base, 9-x11. given that the makefile is not specific, it is likely simply picking the first one it finds. Well it is not an alpha sort issue, because I created a softlink for 9-aaaa-base -> -base-, and 1234-base -> -base- and it still picked agpl. The lower level make specifies -devel that is not even available anymore.

```
# cd /usr/ports/graphics/ImageMagick/work/ImageMagick-6.9.6-4 
# grep -i ghost * | grep -i req
ImageMagick.spec.in:BuildRequires:  ghostscript-devel, djvulibre-devel
ImageMagick.spec.in:Requires: libX11-devel, libXext-devel, libXt-devel, ghostscript-devel
Install-unix.txt:      done first). Ghostscript is a prerequisite, otherwise the EPS, PS,
Install-unix.txt:  Ghostscript is a prerequisite, otherwise the EPS, PS, and PDF tests will


# ls /usr/ports/print|grep ghost
ghostscript7-base
ghostscript7-commfont
ghostscript7-jpnfont
ghostscript7-korfont
ghostscript7-x11
ghostscript8-base
ghostscript8-x11
ghostscript9-1234-base
ghostscript9-agpl-base
ghostscript9-agpl-x11
ghostscript9-base
ghostscript9-x11
```
Is there some higher level mapping from -devel to -agpl ???


----------



## ShelLuser (Apr 10, 2017)

Are you sure this is an recent fresh install? Because if you look at the initial error (OP) you'll notice that it complaints about not being able to install print/ghostscript9-agpl-base because ghostscript9-base is in the way.

So here's the thing... if you check /usr/ports/UPDATING you'll notice item 20160324 which indicates that (I quote):


```
The default Ghostscript port has changed from print/ghostscript9-base,
  which is no longer developed, to print/ghostscript9-agpl-base.  Package
  users will upgrade automatically.  Ports users can stick with the old
  port by adding "DEFAULT_VERSIONS+=ghostscript=9" to /etc/make.conf, or
  move to the new port with:

      portmaster -o print/ghostscript9-agpl-base ghostscript9-base
  or: portupgrade -o print/ghostscript9-agpl-base print/ghostscript9-base
```
Your problem is that print/ghostscript9-base is still installed. Which I consider a bit odd because this has long since been changed in the ports collection:


```
root@feliner:/usr/ports/graphics/ImageMagick # make run-depends-list | grep ghost
/usr/ports/print/ghostscript9-agpl-base
/usr/ports/print/ghostscript9-agpl-x11
```
(this is run on FreeBSD 11 as well).

Bottom line: there's nothing wrong with ImageMagick but with your setup. Follow the instructions above and install the right Ghostscript version, that should solve the whole thing.


----------



## tonyhain (Apr 10, 2017)

Yes it is a fresh install, because Saturday i burned an entire day trying to get something working. I can't find the post I thought I sent about this late last night, but quick summary: The 11.0-release iso refuses to install on hyper-v (despite a patch being known for over 6 months), I then tried 10.0-release-bootonly because i knew that worked on hyper-v, but it is not longer mirrored. After two failures i switched to 10.3-release-bootonly hoping it would install on hyper-v, but after the install it would not upgrade to 11 because it couldn't find mirrors. after finding the details about the hyper-v patch I switched to 11-stable-bootonly, but that couldn't find any mirrors to install from. I finally got this installed as 11-stable-disc1 with ports, but it would not complete freebsd-update because it couldn't find mirrors (though I could ping & ping6 the name it was looking for). Giving up on the base system which was functional, I did a "portsnap fetch update", that failed as well, but "portsnap auto" immediately after that worked. shortly after portsnap auto worked, i installed freeswitch with defaults, then pulled down fusionpbx and installed that. Given the number of failures to get here, i am not surprised that something is confused. (you are likely thinking i was having network problems due to the number of failures, but I had no problem downloading the iso files, installing 10.3-bootonly, or searching for any hints about the failures I was seeing, or pinging the mirrors that the 11 install/upgrade/update were failing on. it all appeared to be isolated to 11-related mirror failures).
Thanks for the pointer about updating. I would not have even considered 9-agpl-base to be an update to 9-base since it is not clear what the relationship is, or which might be newer than the other. If it had been 8 -> 9 I would have been looking for something like that. the make.conf approach did allow completion of the emacs port install. now back to the problem where rebuilding freeswitch w/all_modules is failing to build in qt5-widgets due to multiple definition of _end@Qt_5 ....


----------

