[PATCH] Automatically fixup the *.desktop files and hook them into KDE

John Baldwin jhb at freebsd.org
Mon May 8 12:41:53 UTC 2006


On Sunday 07 May 2006 21:39, Bartosz Fabianowski wrote:
> What's still missing are the icons. Those are currently not being
> installed at all. They can be found in:
>
> {$WRKDIR}/OOB680_m5/sysui/desktop/icons/hicolor
>
> The 128x128 subdirectory is incomplete (no icon for OpenOffice.org
> Base), the others appear to be fine. The icons should go into:
>
> {$PREFIX}/share/icons/hicolor

Ok, the patch below installs the various application icons renamed
to include the openofficeorg-20- prefix so that they work with the
.desktop files out of the box.  It also installs the various mimetype
icons as well.  It does not install the 128x128/main.png icon at all,
and it doesn't try to install the lo-color icons.

Index: Makefile
===================================================================
RCS file: /host/cvs/usr/cvs/ports/editors/openoffice.org-2.0/Makefile,v
retrieving revision 1.230
diff -u -r1.230 Makefile
--- Makefile	24 Apr 2006 11:48:15 -0000	1.230
+++ Makefile	8 May 2006 12:37:52 -0000
@@ -158,6 +158,8 @@
 #EXTRA_PATCHES+=	 ${FILESDIR}/optpatch-freetype
 #.endif
 
+ICONS=	${WRKSRC}/sysui/desktop/icons
+
 .include <${FILESDIR}/Makefile.knobs>
 
 pre-everything::
@@ -237,6 +239,29 @@
 	@${LN} -fs ${PREFIX}/bin/${EXECBASE} ${PREFIX}/bin/${EXECBASE}-spadmin
 	@${LN} -fs ${PREFIX}/bin/${EXECBASE} ${PREFIX}/bin/${EXECBASE}-swriter
 	@${PRINTF} "bin/openoffice.org\n" > ${TMPPLIST}
+	@${REINPLACE_CMD} -e 's#${RELEASE_NR}#${OOOVERSION}#g' \
+			-e '/^Exec/s/printeradmin/spadmin/' \
+			${PREFIX}/${INSTALLATION_BASEDIR}/share/xdg/*.desktop
+	@${RM} ${PREFIX}/${INSTALLATION_BASEDIR}/share/xdg/*.desktop.bak
+.if defined(WITH_KDE)
+	@ln -sf ${PREFIX}/${INSTALLATION_BASEDIR}/share/xdg \
+			${PREFIX}/share/applnk/${EXECBASE}
+	@${PRINTF} "share/applnk/${EXECBASE}\n" >> ${TMPPLIST}
+.endif
+	@for dir in `ls ${ICONS}/hicolor | grep -v CVS`; do \
+		for app in base calc draw impress math printeradmin writer; do \
+			if [ -r ${ICONS}/hicolor/$${dir}/apps/$${app}.png ]; then \
+				${CP} ${ICONS}/hicolor/$${dir}/apps/$${app}.png \
+				    
${PREFIX}/share/icons/hicolor/$${dir}/apps/openofficeorg-20-$${app}.png ; \
+				
${PRINTF} "share/icons/hicolor/$${dir}/apps/openofficeorg-20-$${app}.png\n" 
>> ${TMPPLIST} ; \
+			fi \
+		done ; \
+		for file in `cd ${ICONS}/hicolor/$${dir}/mimetypes; ls *.png`; do \
+			${CP} ${ICONS}/hicolor/$${dir}/mimetypes/$${file} \
+			    ${PREFIX}/share/icons/hicolor/$${dir}/mimetypes/ ; \
+			${PRINTF} "share/icons/hiclor/$${dir}/mimetypes/$${file}\n" >> 
${TMPPLIST} ; \
+		done ; \
+	done
 	@cd ${PREFIX} ; ${FIND} -s bin -type f | ${GREP} ${EXECBASE} >> ${TMPPLIST}
 	@cd ${PREFIX} ; ${FIND} -s bin -type l | ${GREP} ${EXECBASE} >> ${TMPPLIST}
 	@cd ${PREFIX} ; ${FIND} -s ${INSTALLATION_BASEDIR} -type f >> ${TMPPLIST}

Bah, kmail keeps wrapping it even though I turned wrapping off. :(
I've uploaded a copy to http://www.freebsd.org/~jhb/patches/ooo.patch
which should apply fine.

-- 
John Baldwin <jhb at FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org


More information about the freebsd-openoffice mailing list