aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsobomax <sobomax@FreeBSD.org>2001-08-28 20:04:42 +0800
committersobomax <sobomax@FreeBSD.org>2001-08-28 20:04:42 +0800
commit289c36981d7e8e7c4e20fdd241e8661081a99624 (patch)
tree80591fa18bcf2c713dd8869233356aceae37ac70
parente07c2ca63b482b3172d45131de57ceab6be8c10b (diff)
downloadfreebsd-ports-gnome-289c36981d7e8e7c4e20fdd241e8661081a99624.tar.gz
freebsd-ports-gnome-289c36981d7e8e7c4e20fdd241e8661081a99624.tar.zst
freebsd-ports-gnome-289c36981d7e8e7c4e20fdd241e8661081a99624.zip
- Rework optional GNOME dependency, so it would not confuse bento;
- enable gnomeprint support in Gnome case; - use "@*" to pass arguments from the helper script to the binary instead of $*. Submitted by: bento
-rw-r--r--graphics/dia/Makefile18
-rw-r--r--graphics/dia/files/dia.sh2
2 files changed, 13 insertions, 7 deletions
diff --git a/graphics/dia/Makefile b/graphics/dia/Makefile
index 940792b2a83e..a83294e92590 100644
--- a/graphics/dia/Makefile
+++ b/graphics/dia/Makefile
@@ -7,18 +7,19 @@
PORTNAME= dia
PORTVERSION= 0.88.1
+PORTREVISION= 1
CATEGORIES+= graphics gnome
MASTER_SITES= ${MASTER_SITE_GNOME}
MASTER_SITE_SUBDIR= stable/sources/dia
MAINTAINER?= gnome@FreeBSD.org
-LIB_DEPENDS= popt.0:${PORTSDIR}/devel/popt
+LIB_DEPENDS= popt.0:${PORTSDIR}/devel/popt \
+ gdk_pixbuf.2:${PORTSDIR}/graphics/gdk-pixbuf
USE_X_PREFIX= yes
USE_GMAKE= yes
USE_GNOMELIBS= yes
-WANT_GNOME= yes
USE_LIBTOOL= yes
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \
LIBS="-L${LOCALBASE}/lib -lintl"
@@ -27,13 +28,18 @@ MAN1= dia.1
.include <bsd.port.pre.mk>
-.if defined(HAVE_GNOME)
+.if exists(${X11BASE}/bin/panel) || defined(WITH_GNOME)
USE_GNOME= yes
-CONFIGURE_ARGS= --enable-gnome
-PLIST_SUB+= DIAHELP="help/dia"
+PKGNAMESUFFIX= -gnome
+CONFIGURE_ARGS= --enable-gnome \
+ --enable-gnome-print
+PLIST_SUB+= DIAHELP="help/dia" \
+ GNOME:=""
+MAKE_ENV= HAVE_GNOME="yes"
.else
CONFIGURE_ARGS= --disable-gnome
-PLIST_SUB+= DIAHELP="dia/help"
+PLIST_SUB+= DIAHELP="dia/help" \
+ GNOME:="@comment "
.endif
pre-patch:
diff --git a/graphics/dia/files/dia.sh b/graphics/dia/files/dia.sh
index 5d9473f4e89c..a41d856d67b4 100644
--- a/graphics/dia/files/dia.sh
+++ b/graphics/dia/files/dia.sh
@@ -4,4 +4,4 @@ DIA_SHAPE_PATH=%%PREFIX%%/share/gnome/dia/shapes
DIA_SHEET_PATH=%%PREFIX%%/share/gnome/dia/sheets
export DIA_LIB_PATH DIA_SHAPE_PATH DIA_INT_SHAPE_PATH DIA_SHEET_PATH
-exec %%PREFIX%%/bin/dia-bin $*
+exec %%PREFIX%%/bin/dia-bin "$@"
n style="color:#3a3935">, ...) { va_list args; va_start (args, format); printf ("Client %s: ", client == client1 ? "1" : client == client2 ? "2" : "UNKNOWN"); vprintf (format, args); va_end (args); } /* Dumps some interesting data from a component */ static void dump_component (CalComponent *comp) { const char *uid; CalComponentText summary; cal_component_get_uid (comp, &uid); printf ("UID %s\n", uid); cal_component_get_summary (comp, &summary); if (summary.value) printf ("\tSummary: `%s', altrep `%s'\n", summary.value, summary.altrep ? summary.altrep : "NONE"); else printf ("\tNo summary\n"); } /* Lists the UIDs of objects in a calendar, called as an idle handler */ static gboolean list_uids (gpointer data) { CalClient *client; GList *uids; GList *l; client = CAL_CLIENT (data); uids = cal_client_get_uids (client, CALOBJ_TYPE_ANY); cl_printf (client, "UIDs: "); if (!uids) printf ("none\n"); else { for (l = uids; l; l = l->next) { char *uid; uid = l->data; printf ("`%s' ", uid); } printf ("\n"); for (l = uids; l; l = l->next) { char *uid; CalComponent *comp; CalClientGetStatus status; uid = l->data; status = cal_client_get_object (client, uid, &comp); if (status == CAL_CLIENT_GET_SUCCESS) { printf ("------------------------------\n"); dump_component (comp); printf ("------------------------------\n"); g_object_unref (comp); } else { printf ("FAILED: %d\n", status); } } } cal_obj_uid_list_free (uids); g_object_unref (client); return FALSE; } /* Callback used when a calendar is opened */ static void cal_opened_cb (CalClient *client, CalClientOpenStatus status, gpointer data) { cl_printf (client, "Load/create %s\n", ((status == CAL_CLIENT_OPEN_SUCCESS) ? "success" : (status == CAL_CLIENT_OPEN_ERROR) ? "error" : (status == CAL_CLIENT_OPEN_NOT_FOUND) ? "not found" : (status == CAL_CLIENT_OPEN_METHOD_NOT_SUPPORTED) ? "method not supported" : "unknown status value")); if (status == CAL_CLIENT_OPEN_SUCCESS) { GList *comp_list; /* get free/busy information */ comp_list = cal_client_get_free_busy (client, NULL, 0, time (NULL)); if (comp_list) { GList *l; for (l = comp_list; l; l = l->next) { char *comp_str; comp_str = cal_component_get_as_string (CAL_COMPONENT (l->data)); g_object_unref (l->data); cl_printf (client, "Free/Busy -> %s\n", comp_str); g_free (comp_str); } g_list_free (comp_list); } g_idle_add (list_uids, client); } else g_object_unref (client); } /* Callback used when an object is updated */ static void obj_updated_cb (CalClient *client, const char *uid, gpointer data) { cl_printf (client, "Object updated: %s\n", uid); } /* Callback used when a client is destroyed */ static void client_destroy_cb (GObject *object, gpointer data) { if (CAL_CLIENT (object) == client1) client1 = NULL; else if (CAL_CLIENT (object) == client2) client2 = NULL; else g_assert_not_reached (); if (!client1 && !client2) bonobo_main_quit (); } /* Creates a calendar client and tries to load the specified URI into it */ static void create_client (CalClient **client, const char *uri, gboolean only_if_exists) { gboolean result; *client = cal_client_new (); if (!*client) { g_message ("create_client(): could not create the client"); exit (1); } g_signal_connect (*client, "destroy", G_CALLBACK (client_destroy_cb), NULL); g_signal_connect (*client, "cal_opened", G_CALLBACK (cal_opened_cb), NULL); g_signal_connect (*client, "obj_updated", G_CALLBACK (obj_updated_cb), NULL); printf ("Calendar loading `%s'...\n", uri); result = cal_client_open_calendar (*client, uri, only_if_exists); if (!result) { g_message ("create_client(): failure when issuing calendar open request `%s'", uri); exit (1); } } int main (int argc, char **argv) { char *dir; bindtextdomain (PACKAGE, GNOMELOCALEDIR); textdomain (PACKAGE); g_type_init (); bonobo_activation_init (argc, argv); if (!bonobo_init (&argc, argv)) { g_message ("main(): could not initialize Bonobo"); exit (1); } dir = g_strdup_printf ("%s/evolution/local/Calendar/calendar.ics", g_get_home_dir ()); create_client (&client1, dir, FALSE); g_free (dir); create_client (&client2, "/cvs/evolution/calendar/cal-client/test.ics", TRUE); bonobo_main (); return 0; }