Working on my first ports, what to do about conflicts with icons ?

I am working on a port of qtads. I have it mostly finished and it passes portlint. However, ive noticed that it installs icons to /usr/local/share/icons/hicolor and one of them conflicts with gargoyle.

Both of these are interpreters that run interactive fiction games. Gargoyle is kinda of a generalist "jack of all trades" interpreter than interprets a wide variety of formats. Qtads targets the tads format specifically and supports more features for the format than Gargoyle does. In an idea world, id love to have both be installable at the same time. So adding a "CONFLICTS= gargoyle" to the Makefile seems undesirable.

Do I omit the offending icon from the pkg-plist file? Or something else ?

Is there a way of marking a file as optional ? (Install if not already present.)
 
I was trying to see if anyone else ever hit a similar issue, and how they resolved it. I couldn't find anything directly relevant to FreeBSD, but interestingly it looks like some folks over in Arch Linux noticed the same thing when packaging both applications.

Digging around further in the porters' handbook, it looks like there are ways to mark files as optional at installation time. Anyone else having the same problem can check the first topic under "Chapter 8. Advanced pkg-plist Practices." It looks like the easiest fix to me, is simply to make the conflicting mimetype icons an optional default, and raise a "CONFLICTS_INSTALL= gargoyle" unless it's been turned off.

So something like:
Makefile:
OPTIONS_DEFINE=        ICONS
ICONS_DESC=            Install mimetype icons.
OPTIONS_DEFAULT=       ICONS
OPTIONS_SUB=           yes

.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MICONS}

CONFLICTS_INSTALL=     gargoyle

.endif

Then anything in pkg-plist prefixed with "%%ICONS%%" will be installed or skipped according.
 
No, that's not how CONFLICTS_INSTALL works. From the source
Code:
# Conflict checking.  Use if your port cannot be installed at the same time as
# another package.
#
# CONFLICTS             - A list of package name patterns that the port conflicts
#                                 with, separated by blanks.  The names may include shell
#                                 pattern meta-characters "*", "?", "[", "]", and "!".
#                                 Example: apache*-1.2* apache*-1.3.[012345] apache-*+ssl_*
#
# CONFLICTS_BUILD
#                               - Check conflict prior to the build.
#
# CONFLICTS_INSTALL
#                               - Check conflict prior to the installation stage.
So if you define CONFLICTS_INSTALL, your port will not be installed if the port / package in question already exists on the machine.
 
So if you define CONFLICTS_INSTALL, your port will not be installed if the port / package in question already exists on the machine.

Right, but I think that is the behavior I'd want, isn't it?

Gargoyle contains a mime type icon which conflicts with a qtads mimetype icon. If gargoyle is installed, and the option to install mime type icons is enabled, we should fail to install.

I've tested this a couple different ways and it appears to be the behavior I want.

Or am I missing something ? Is there a better way to handle this?
 
To be a bit clearer. I have my pkg-plist setup thusly:
Code:
share/applications/nikos.chantziaras.qtads.desktop
%%ICONS%%share/icons/hicolor/128x128/mimetypes/application-x-t3vm-image.png
%%ICONS%%share/icons/hicolor/128x128/mimetypes/application-x-tads.png
%%ICONS%%share/icons/hicolor/16x16/mimetypes/application-x-t3vm-image.png
%%ICONS%%share/icons/hicolor/16x16/mimetypes/application-x-tads.png
share/icons/hicolor/256x256/apps/qtads.png
%%ICONS%%share/icons/hicolor/32x32/mimetypes/application-x-t3vm-image.png
%%ICONS%%share/icons/hicolor/32x32/mimetypes/application-x-tads.png
share/icons/hicolor/48x48/apps/qtads.png
%%ICONS%%share/icons/hicolor/48x48/mimetypes/application-x-t3vm-image.png
%%ICONS%%share/icons/hicolor/48x48/mimetypes/application-x-tads.png
share/icons/hicolor/72x72/apps/qtads.png
share/man/man6/qtads.6.gz
share/metainfo/nikos.chantziaras.qtads.appdata.xml
share/mime/packages/qtads.xml

Because I have the "ICONS" defined as an option, and OPTIONS_SUB=yes defined in the makefile. Then the mimetype icons are skipped (or not) at installation time depending on how the option is set. Per "Changing pkg-plist Based on Make Variables" https://docs.freebsd.org/en/books/porters-handbook/plist/
 
Back
Top