gconf schemas + .desktop file question
Alexey Dokuchaev
danfe at nsu.ru
Fri Dec 16 12:49:03 UTC 2011
On Fri, Dec 16, 2011 at 07:37:22PM +0700, Alexey Dokuchaev wrote:
> On the second thought (and look), I guess I can install .desktop file
> unconditionally without simple hack. I will send another diff for review.
Here we go (untested, my tindy is occupied with something else now).
./danfe
-------------- next part --------------
Index: Makefile
===================================================================
RCS file: /home/danfe/fbsd/FreeBSD-CVS/ports/graphics/ufraw/Makefile,v
retrieving revision 1.51
diff -u -r1.51 Makefile
--- Makefile 30 Nov 2011 10:14:01 -0000 1.51
+++ Makefile 16 Dec 2011 12:42:56 -0000
@@ -8,7 +8,7 @@
PORTNAME= ufraw
PORTVERSION= 0.18
PORTREVISION= 1
-CATEGORIES= graphics gnome
+CATEGORIES= graphics
MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION}
MAINTAINER= ports at FreeBSD.org
@@ -38,9 +38,10 @@
LENSFUN "Enable LensFun library support" off \
FITS "Enable FITS output support" off \
GIMP "Install GIMP UFRaw plugin" off \
- GTK "Build the Gtk+2 GUI" on
+ GTK "Build the Gtk+2 GUI" on \
+ GNOME "Register .desktop file and GConf2 schemas" off
-.include <bsd.port.pre.mk>
+.include <bsd.port.options.mk>
.if defined(WITH_CONTRAST)
CONFIGURE_ARGS+= --enable-contrast
@@ -81,11 +82,23 @@
PLIST_FILES+= bin/ufraw
.endif
+.if defined(WITH_GNOME)
+CATEGORIES+= gnome
+USE_GNOME= desktopfileutils gconf2
+CONFIGURE_ARGS+= --enable-mime
+GCONF_SCHEMAS= ${PORTNAME}.schemas
+PLIST_SUB+= GNOME=""
+.else
+PLIST_SUB+= GNOME="@comment "
+.endif
+
post-patch:
@${REINPLACE_CMD} -e '18s|^$$|#include <sys/types.h>|' \
${WRKSRC}/dcraw.h
-# Avoid conflict with `graphics/dcraw' and rename the binary
+# Fix GConf2 schemas installation path; unconditionalize installation of
+# .desktop file; avoid conflict with `graphics/dcraw' (rename the binary)
@${REINPLACE_CMD} -e '/@schemasdir/s|datadir|sysconfdir| ; \
+ /@app/s|@INSTALL_MIME_TRUE@|| ; \
s|dcraw\$$(EXEEXT)|${PORTNAME}-&|' ${WRKSRC}/Makefile.in
.for i in ${PC_FALSE}
@${REINPLACE_CMD} -e '/PKG_CONFIG.*${i}/s|$$PKG_CONFIG|${FALSE}|' \
@@ -96,4 +109,12 @@
@${INSTALL_SCRIPT} ${LOCALBASE}/share/glib-2.0/gettext/mkinstalldirs \
${WRKSRC}
-.include <bsd.port.post.mk>
+post-install:
+.if defined(WITH_GNOME)
+ @${SETENV} GCONF_CONFIG_SOURCE=${GCONF_CONFIG_SOURCE} \
+ gconftool-2 --makefile-install-rule \
+ ${PREFIX}/etc/gconf/schemas/${PORTNAME}.schemas
+ @-update-desktop-database
+.endif
+
+.include <bsd.port.mk>
Index: pkg-plist
===================================================================
RCS file: /home/danfe/fbsd/FreeBSD-CVS/ports/graphics/ufraw/pkg-plist,v
retrieving revision 1.16
diff -u -r1.16 pkg-plist
--- pkg-plist 30 Nov 2011 10:14:01 -0000 1.16
+++ pkg-plist 16 Dec 2011 12:44:12 -0000
@@ -2,6 +2,7 @@
bin/ufraw-batch
bin/ufraw-dcraw
%%GIMP%%libexec/gimp/2.2/plug-ins/ufraw-gimp
+share/applications/ufraw.desktop
share/locale/ca/LC_MESSAGES/ufraw.mo
share/locale/cs/LC_MESSAGES/ufraw.mo
share/locale/da/LC_MESSAGES/ufraw.mo
@@ -25,6 +26,8 @@
@dirrmtry share/locale/sr at latin/LC_MESSAGES
@dirrmtry share/locale/sr at latin
@dirrmtry share/applications
+%%GNOME%%@exec %D/bin/update-desktop-database > /dev/null || /usr/bin/true
+%%GNOME%%@unexec %D/bin/update-desktop-database > /dev/null || /usr/bin/true
%%GIMP%%@dirrmtry libexec/gimp/2.2/plug-ins
%%GIMP%%@dirrmtry libexec/gimp/2.2
%%GIMP%%@dirrmtry libexec/gimp
More information about the freebsd-gnome
mailing list