Bug 290241 - java/eclipse: desktop icon is broken
Summary: java/eclipse: desktop icon is broken
Status: In Progress
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Vladimir Druzenko
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-10-14 22:40 UTC by Mark Felder
Modified: 2025-11-16 21:48 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (ngrundmann)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Felder freebsd_committer freebsd_triage 2025-10-14 22:40:51 UTC
in the eclipse.desktop that gets installed by the package, it has the Icon set to

Icon=icon.xpm

which would be resolvable to /usr/local/share/eclipse/icon.xpm

But unfortunately that isn't a real icon.

If instead you link it to one of the PNG icons included in the source but buried under a "plugin", it works:

Icon=/usr/local/share/eclipse/plugins/org.eclipse.sdk_4.37.0.v20251012-1536/eclipse256.png

now the icon shows up correctly in the menu on KDE

alternatively the port could just be updated to find one of these pngs with a glob like 

org.eclipse.sdk.${PORTVERSION}*/eclipse256.png

install that to ${DATADIR}/icon.png

Then just update the .desktop to reference Icon=icon.png

and it should work reliably across future releases
Comment 1 Norbert Grundmann 2025-11-03 08:34:43 UTC
So I checked under xfce (I don't use KDE, sorry) and made it possible with the following change:

set Icon in Desktop/eclipse.desktop to:

Icon=/usr/local/share/eclipse/icon.xpm

There is no need for an eclipse port change - so the best would be to add a message in files/pkg-message.in that is displayed after the port/package is installed :-)

PS: I am not so familar with all the portage settings and files - but I think the file pkg-message.in is okay for that, or?
Comment 2 Norbert Grundmann 2025-11-03 08:44:39 UTC
Sorry, I was not correct with my formulation - of course it would be a port change, when adding a pkg-message.in file - but it would not affect the port compilation / build step :-)
Comment 3 Vladimir Druzenko freebsd_committer freebsd_triage 2025-11-10 01:26:01 UTC
Testing this modification to Makefile:

_ICONS_PNG=     16 22 24 32 48 64 128 256 512 1024
_ICONS_SVG=     16 32 48
_VER=           ${DISTVERSION}.0.v20250906-0132

do-build:
        cd ${WRKSRC} && ${SETENV} ${MAVEN_ENV} mvn ${MAVEN_PARAMS}

do-install:
        ${MKDIR} ${STAGEDIR}${DATADIR}
        ${TAR} -x --directory ${STAGEDIR}${DATADIR}/.. --file ${WRKSRC}/${ECLIPSE_RESULT}
        ${INSTALL_SCRIPT} ${WRKDIR}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin
.for _ICON in ${_ICONS_PNG}
        ${INSTALL_DATA} \
                ${STAGEDIR}${DATADIR}/plugins/org.eclipse.platform_${_VER}/${PORTNAME}${_ICON}.png \
                ${STAGEDIR}${PREFIX}/share/icons/hicolor/${_ICON}x${_ICON}/apps/${PORTNAME}.png
.endfor
.for _ICON in ${_ICONS_SVG}
        ${INSTALL_DATA} \
                ${STAGEDIR}${DATADIR}/plugins/org.eclipse.platform_${_VER}/${PORTNAME}${_ICON}.svg \
                ${STAGEDIR}${PREFIX}/share/icons/hicolor/${_ICON}x${_ICON}/apps/${PORTNAME}.svg
.endfor
Comment 4 Vladimir Druzenko freebsd_committer freebsd_triage 2025-11-10 04:29:54 UTC
This work for me:

_ICONS_PNG=     16 22 24 32 48 64 128 256 512 1024
_ICONS_SVG=     16 32 48
_ICONS_PATH=    ${STAGEDIR}${DATADIR}/plugins/org.eclipse.platform_${DISTVERSION}.0.v*

do-build:
        cd ${WRKSRC} && ${SETENV} ${MAVEN_ENV} mvn ${MAVEN_PARAMS}

do-install:
        ${MKDIR} ${STAGEDIR}${DATADIR}
        ${TAR} -x --directory ${STAGEDIR}${DATADIR}/.. --file ${WRKSRC}/${ECLIPSE_RESULT}
        ${INSTALL_SCRIPT} ${WRKDIR}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin
        ${MKDIR} ${_ICONS_PNG:C|([0-9]*)|${STAGEDIR}${PREFIX}/share/icons/hicolor/\1x\1/apps|}
.for _ICON in ${_ICONS_PNG}
        ${INSTALL_DATA} \
                ${_ICONS_PATH}/${PORTNAME}${_ICON}.png \
                ${STAGEDIR}${PREFIX}/share/icons/hicolor/${_ICON}x${_ICON}/apps/${PORTNAME}.png
.endfor
.for _ICON in ${_ICONS_SVG}
        ${INSTALL_DATA} \
                ${_ICONS_PATH}/${PORTNAME}${_ICON}.svg \
                ${STAGEDIR}${PREFIX}/share/icons/hicolor/${_ICON}x${_ICON}/apps/${PORTNAME}.svg
.endfor

# Generate dynamic plist, to cater for different ARCHS
post-install:
        cd ${STAGEDIR}${PREFIX} && ${FIND} -s bin/${PORTNAME} \
                share/${PORTNAME} share/icons -not -type d >> ${TMPPLIST}
        cd ${STAGEDIR}${PREFIX} && ${FIND} -ds share/${PORTNAME} -type d | \
                ${SED} -e 's,^,@dir ,' >> ${TMPPLIST}
Comment 5 Norbert Grundmann 2025-11-10 06:05:40 UTC
Thanks - sounds nice :-)  I will "crosscheck" when I find time...
Comment 6 Mark Felder freebsd_committer freebsd_triage 2025-11-11 19:25:31 UTC
(In reply to Norbert Grundmann from comment #1)

Perhaps this will work. I just reinstalled Eclipse and looked at the icon.xpm with Gimp and it renders an icon, but when I looked at it previously it was an empty image. Could have been a bug on my end and you don't need to look for a suitable png icon
Comment 7 Vladimir Druzenko freebsd_committer freebsd_triage 2025-11-16 21:48:19 UTC
Anyway install icons in ${PREFIX}/share/icons/hicolor/ is good idea.