aboutsummaryrefslogtreecommitdiff
path: root/graphics/entangle
diff options
context:
space:
mode:
authorAlexey Dokuchaev <danfe@FreeBSD.org>2013-07-04 14:10:25 +0000
committerAlexey Dokuchaev <danfe@FreeBSD.org>2013-07-04 14:10:25 +0000
commitfd3a8bbe419e69cd8a33587d5863f22366f89d38 (patch)
tree7a81678b70bb684eebbf62568ee34da0fa7d7f33 /graphics/entangle
parent071055deb6750489b36793803c7720a748bc2036 (diff)
downloadports-fd3a8bbe419e69cd8a33587d5863f22366f89d38.tar.gz
ports-fd3a8bbe419e69cd8a33587d5863f22366f89d38.zip
Port Entangle, an application which uses GTK+3 and libgphoto2 to provide a
graphical interface for tethered photography with digital cameras. Provide FreeBSD native camera autodetection via devd(8); special thanks to marcus@ for reviewing relevant parts of the code. The patch was submitted upstream and welcomed by the author, although he prefers that we use GIO's GSocket + GUnixSocketAddress APIs instead of direct POSIX socket API calls. WWW: http://entangle-photo.org/
Notes
Notes: svn path=/head/; revision=322274
Diffstat (limited to 'graphics/entangle')
-rw-r--r--graphics/entangle/Makefile49
-rw-r--r--graphics/entangle/distinfo2
-rw-r--r--graphics/entangle/files/patch-src_backend_entangle-device-manager.c173
-rw-r--r--graphics/entangle/pkg-descr12
-rw-r--r--graphics/entangle/pkg-plist167
5 files changed, 403 insertions, 0 deletions
diff --git a/graphics/entangle/Makefile b/graphics/entangle/Makefile
new file mode 100644
index 000000000000..ac69603940dd
--- /dev/null
+++ b/graphics/entangle/Makefile
@@ -0,0 +1,49 @@
+# Created by: Alexey Dokuchaev <danfe@FreeBSD.org>
+# $FreeBSD$
+
+PORTNAME= entangle
+DISTVERSION= 0.5.1
+CATEGORIES= graphics
+MASTER_SITES= http://entangle-photo.org/download/sources/
+
+MAINTAINER= danfe@FreeBSD.org
+COMMENT= Digital camera tethered control and capture program
+
+LICENSE= GPLv3
+
+LIB_DEPENDS= gphoto2:${PORTSDIR}/graphics/libgphoto2 \
+ lcms:${PORTSDIR}/graphics/lcms \
+ gexiv2:${PORTSDIR}/graphics/gexiv2 \
+ raw_r:${PORTSDIR}/graphics/libraw \
+ peas:${PORTSDIR}/devel/libpeas
+
+GNU_CONFIGURE= yes
+USE_GMAKE= yes
+USE_GNOME= gtk30
+
+.if defined(BATCH) || defined(PACKAGE_BUILDING)
+CONFIGURE_ARGS= --disable-silent-rules
+.endif
+
+CPPFLAGS+= -I${LOCALBASE}/include
+LDFLAGS+= -L${LOCALBASE}/lib
+
+MAN1= ${PORTNAME}.1
+
+OPTIONS_DEFINE= NLS
+OPTIONS_SUB= yes
+
+NLS_CONFIGURE_OFF= --disable-nls
+
+.include <bsd.port.options.mk>
+
+.if ${PORT_OPTIONS:MNLS}
+USES+= gettext # XXX: replace with NLS_USES once available
+.endif
+
+post-patch:
+ @${REINPLACE_CMD} -e '/checking for GUDEV/,+93d' ${WRKSRC}/configure
+ @${REINPLACE_CMD} -e 's,_udev,,' \
+ ${WRKSRC}/src/backend/entangle-camera-list.c
+
+.include <bsd.port.mk>
diff --git a/graphics/entangle/distinfo b/graphics/entangle/distinfo
new file mode 100644
index 000000000000..4ef4b81d279e
--- /dev/null
+++ b/graphics/entangle/distinfo
@@ -0,0 +1,2 @@
+SHA256 (entangle-0.5.1.tar.gz) = 9fee7d28ef9e86471cd893760c81a4c69c77fec3954bd95dd3f27b2bd9faf8fc
+SIZE (entangle-0.5.1.tar.gz) = 872542
diff --git a/graphics/entangle/files/patch-src_backend_entangle-device-manager.c b/graphics/entangle/files/patch-src_backend_entangle-device-manager.c
new file mode 100644
index 000000000000..ca73a5cfe136
--- /dev/null
+++ b/graphics/entangle/files/patch-src_backend_entangle-device-manager.c
@@ -0,0 +1,173 @@
+--- src/backend/entangle-device-manager.c.orig 2013-03-13 05:23:35.000000000 +0800
++++ src/backend/entangle-device-manager.c 2013-07-04 20:02:19.000000000 +0800
+@@ -20,13 +20,19 @@
+
+ #include <config.h>
+
+-#include <string.h>
+-#include <stdio.h>
+-
++#if defined(__FreeBSD__)
++#include <sys/socket.h>
++#include <sys/un.h>
++#include <glib.h>
++#include <unistd.h>
++#else
+ #define G_UDEV_API_IS_SUBJECT_TO_CHANGE
+ #ifdef G_UDEV_API_IS_SUBJECT_TO_CHANGE
+ #include <gudev/gudev.h>
+ #endif
++#endif
++#include <string.h>
++#include <stdio.h>
+
+ #include "entangle-debug.h"
+ #include "entangle-device-manager.h"
+@@ -35,7 +41,11 @@
+ (G_TYPE_INSTANCE_GET_PRIVATE((obj), ENTANGLE_TYPE_DEVICE_MANAGER, EntangleDeviceManagerPrivate))
+
+ struct _EntangleDeviceManagerPrivate {
++#if defined(__linux__)
+ GUdevClient *ctx;
++#elif defined(__FreeBSD__)
++ int efd;
++#endif
+ };
+
+ G_DEFINE_TYPE(EntangleDeviceManager, entangle_device_manager, G_TYPE_OBJECT);
+@@ -47,8 +57,13 @@ static void entangle_device_manager_fina
+ EntangleDeviceManagerPrivate *priv = manager->priv;
+ ENTANGLE_DEBUG("Finalize manager");
+
++#if defined(__linux__)
+ if (priv->ctx)
+ g_object_unref(priv->ctx);
++#elif defined(__FreeBSD__)
++ if (priv->efd)
++ close(priv->efd);
++#endif
+
+ G_OBJECT_CLASS (entangle_device_manager_parent_class)->finalize (object);
+ }
+@@ -85,6 +100,7 @@ static void entangle_device_manager_clas
+ }
+
+
++#if defined(__linux__)
+ static void do_udev_event(GUdevClient *client G_GNUC_UNUSED,
+ const char *action,
+ GUdevDevice *dev,
+@@ -126,6 +142,91 @@ static void do_udev_event(GUdevClient *c
+ }
+ g_free(port);
+ }
++#elif defined(__FreeBSD__)
++static void devd_init(EntangleDeviceManager *manager);
++
++static gboolean do_devd_event(GIOChannel *source,
++ GIOCondition condition,
++ gpointer user_data)
++{
++ EntangleDeviceManager *manager = user_data;
++ char *event, *cutoff;
++ gsize end;
++ GIOStatus status;
++
++ status = g_io_channel_read_line(source, &event, NULL, &end, NULL);
++
++ switch (status) {
++ case G_IO_STATUS_NORMAL:
++ event[end] = '\0';
++ if (strncmp(event + 1, "ugen", 4))
++ break;
++ if (!(cutoff = strchr(event + 5, ' ')))
++ break;
++ *cutoff = '\0';
++ if (*event == '+') {
++ g_signal_emit_by_name(manager, "device-added", event + 1);
++ } else if (*event == '-') {
++ g_signal_emit_by_name(manager, "device-removed", event + 1);
++ }
++ g_free(event);
++ break;
++ case G_IO_STATUS_EOF:
++ case G_IO_STATUS_AGAIN:
++ /*
++ * Apparently, devd(8) was reinited (restarted?). Allocate
++ * new channel and teardown previous connection.
++ */
++ devd_init(manager);
++ if (manager->priv->efd > 0) {
++ int old_efd = g_io_channel_unix_get_fd(source);
++ g_io_channel_shutdown(source, FALSE, NULL);
++ close(old_efd);
++ return FALSE;
++ }
++ break;
++ case G_IO_STATUS_ERROR:
++ default:
++ /* XXX: what shall we do? */
++ break;
++ }
++ return TRUE;
++}
++
++
++static void devd_init(EntangleDeviceManager *manager)
++{
++ EntangleDeviceManagerPrivate *priv = manager->priv;
++ struct sockaddr_un addr;
++
++ priv->efd = socket(PF_UNIX, SOCK_STREAM, 0);
++ if (priv->efd == -1) {
++ perror("socket");
++ return;
++ }
++
++ addr.sun_family = AF_UNIX;
++ strncpy(addr.sun_path, "/var/run/devd.pipe", sizeof(addr.sun_path));
++
++ if (connect(priv->efd, (struct sockaddr *)&addr, sizeof(addr)) == 0) {
++ GIOChannel *channel = g_io_channel_unix_new(priv->efd);
++ g_io_add_watch(channel, G_IO_IN, do_devd_event, manager);
++ /*
++ * We can reduce the refcount here so that when the watch is
++ * removed, the channel will be destroyed.
++ */
++ g_io_channel_unref(channel);
++ } else {
++ /*
++ * XXX: we should probably spin for a while until connect()
++ * succeeds to get rid of the useless socket()/close() storm
++ * for a short period when devd(8) is not ready yet.
++ */
++ close(priv->efd);
++ priv->efd = -1;
++ }
++}
++#endif
+
+
+ EntangleDeviceManager *entangle_device_manager_new(void)
+@@ -138,6 +239,8 @@ static void entangle_device_manager_init
+ {
+ EntangleDeviceManagerPrivate *priv = manager->priv;
+ GList *devs, *tmp;
++
++#if defined(__linux__)
+ const gchar *const subsys[] = {
+ "usb/usb_device", NULL,
+ };
+@@ -161,6 +264,12 @@ static void entangle_device_manager_init
+ }
+
+ g_list_free(devs);
++#elif defined(__FreeBSD__)
++
++ ENTANGLE_DEBUG("Init devd");
++
++ devd_init(manager);
++#endif
+ }
+
+
diff --git a/graphics/entangle/pkg-descr b/graphics/entangle/pkg-descr
new file mode 100644
index 000000000000..185db70e8037
--- /dev/null
+++ b/graphics/entangle/pkg-descr
@@ -0,0 +1,12 @@
+Entangle is an application which uses GTK+3 and libgphoto2 to provide a
+graphical interface for tethered photography with digital cameras.
+
+It includes control over camera shooting and configuration settings and
+"hands off" shooting directly from the controlling computer:
+
+ - Trigger the shutter from the computer
+ - Live preview of scene before shooting
+ - Automatic download and display of photos as they are shot
+ - Control of all camera settings from computer
+
+WWW: http://entangle-photo.org/
diff --git a/graphics/entangle/pkg-plist b/graphics/entangle/pkg-plist
new file mode 100644
index 000000000000..06eb78c3c8bd
--- /dev/null
+++ b/graphics/entangle/pkg-plist
@@ -0,0 +1,167 @@
+bin/entangle
+lib/girepository-1.0/Entangle-0.1.typelib
+%%NLS%%share/locale/ar/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/as/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/ast/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/bg/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/bn/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/bn_IN/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/br/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/ca/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/cs/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/da/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/de/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/el/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/es/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/eu/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/fa/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/fi/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/fr/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/ga/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/gl/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/he/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/hi/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/hu/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/ia/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/id/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/is/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/it/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/ja/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/ka/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/kk/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/ko/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/ks/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/lv/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/mai/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/ml/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/nb/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/nl/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/nn/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/pl/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/pt/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/pt_BR/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/ro/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/ru/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/si/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/sk/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/sq/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/sr/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/sv/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/ta/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/tr/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/uk/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/vi/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/zh_CN/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/zh_HK/LC_MESSAGES/entangle.mo
+%%NLS%%share/locale/zh_TW/LC_MESSAGES/entangle.mo
+share/applications/entangle.desktop
+share/entangle/capture-22.png
+share/entangle/capture.png
+share/entangle/color-management-22.png
+share/entangle/color-management.png
+share/entangle/entangle-128x128.png
+share/entangle/entangle-16x16.png
+share/entangle/entangle-256x256.png
+share/entangle/entangle-32x32.png
+share/entangle/entangle-48x48.png
+share/entangle/entangle-64x64.png
+share/entangle/entangle-camera-info.xml
+share/entangle/entangle-camera-manager.xml
+share/entangle/entangle-camera-picker.xml
+share/entangle/entangle-camera-support.xml
+share/entangle/entangle-help-about.xml
+share/entangle/entangle-image-popup.xml
+share/entangle/entangle-preferences.xml
+share/entangle/entangle.svg
+share/entangle/icons/hicolor/128x128/actions/capture.png
+share/entangle/icons/hicolor/128x128/actions/preview.png
+share/entangle/icons/hicolor/16x16/actions/capture.png
+share/entangle/icons/hicolor/16x16/actions/preview.png
+share/entangle/icons/hicolor/22x22/actions/capture.png
+share/entangle/icons/hicolor/22x22/actions/preview.png
+share/entangle/icons/hicolor/32x32/actions/capture.png
+share/entangle/icons/hicolor/32x32/actions/preview.png
+share/entangle/icons/hicolor/48x48/actions/capture.png
+share/entangle/icons/hicolor/48x48/actions/preview.png
+share/entangle/icons/hicolor/64x64/actions/capture.png
+share/entangle/icons/hicolor/64x64/actions/preview.png
+share/entangle/imageviewer-22.png
+share/entangle/imageviewer.png
+share/entangle/interface-22.png
+share/entangle/interface.png
+share/entangle/plugins-22.png
+share/entangle/plugins.png
+share/entangle/sRGB.icc
+share/gir-1.0/Entangle-0.1.gir
+share/glib-2.0/schemas/org.entangle-photo.manager.gschema.xml
+share/gtk-doc/html/Entangle/Entangle-EntangleProgress.html
+share/gtk-doc/html/Entangle/Entangle-entangle-debug.html
+share/gtk-doc/html/Entangle/Entangle-entangle-dpms.html
+share/gtk-doc/html/Entangle/Entangle-entangle-pixbuf.html
+share/gtk-doc/html/Entangle/Entangle.devhelp2
+share/gtk-doc/html/Entangle/EntangleApplication.html
+share/gtk-doc/html/Entangle/EntangleCamera.html
+share/gtk-doc/html/Entangle/EntangleCameraFile.html
+share/gtk-doc/html/Entangle/EntangleCameraInfo.html
+share/gtk-doc/html/Entangle/EntangleCameraList.html
+share/gtk-doc/html/Entangle/EntangleCameraManager.html
+share/gtk-doc/html/Entangle/EntangleCameraPicker.html
+share/gtk-doc/html/Entangle/EntangleCameraSupport.html
+share/gtk-doc/html/Entangle/EntangleColourProfileTransform.html
+share/gtk-doc/html/Entangle/EntangleControl.html
+share/gtk-doc/html/Entangle/EntangleControlButton.html
+share/gtk-doc/html/Entangle/EntangleControlChoice.html
+share/gtk-doc/html/Entangle/EntangleControlDate.html
+share/gtk-doc/html/Entangle/EntangleControlGroup.html
+share/gtk-doc/html/Entangle/EntangleControlPanel.html
+share/gtk-doc/html/Entangle/EntangleControlRange.html
+share/gtk-doc/html/Entangle/EntangleControlText.html
+share/gtk-doc/html/Entangle/EntangleControlToggle.html
+share/gtk-doc/html/Entangle/EntangleDeviceManager.html
+share/gtk-doc/html/Entangle/EntangleHelpAbout.html
+share/gtk-doc/html/Entangle/EntangleImage.html
+share/gtk-doc/html/Entangle/EntangleImageDisplay.html
+share/gtk-doc/html/Entangle/EntangleImageHistogram.html
+share/gtk-doc/html/Entangle/EntangleImageLoader.html
+share/gtk-doc/html/Entangle/EntangleImagePopup.html
+share/gtk-doc/html/Entangle/EntangleImageStatusbar.html
+share/gtk-doc/html/Entangle/EntanglePixbufLoader.html
+share/gtk-doc/html/Entangle/EntanglePreferences.html
+share/gtk-doc/html/Entangle/EntanglePreferencesDisplay.html
+share/gtk-doc/html/Entangle/EntangleSession.html
+share/gtk-doc/html/Entangle/EntangleSessionBrowser.html
+share/gtk-doc/html/Entangle/EntangleThumbnailLoader.html
+share/gtk-doc/html/Entangle/annotation-glossary.html
+share/gtk-doc/html/Entangle/api-index-full.html
+share/gtk-doc/html/Entangle/ch01.html
+share/gtk-doc/html/Entangle/ch02.html
+share/gtk-doc/html/Entangle/home.png
+share/gtk-doc/html/Entangle/index.html
+share/gtk-doc/html/Entangle/index.sgml
+share/gtk-doc/html/Entangle/left.png
+share/gtk-doc/html/Entangle/object-tree.html
+share/gtk-doc/html/Entangle/right.png
+share/gtk-doc/html/Entangle/style.css
+share/gtk-doc/html/Entangle/up.png
+%%NLS%%@dirrmtry share/locale/ks/LC_MESSAGES
+%%NLS%%@dirrmtry share/locale/ks
+@dirrm share/gtk-doc/html/Entangle
+@dirrm share/entangle/plugins
+@dirrm share/entangle/icons/hicolor/64x64/actions
+@dirrm share/entangle/icons/hicolor/64x64
+@dirrm share/entangle/icons/hicolor/48x48/actions
+@dirrm share/entangle/icons/hicolor/48x48
+@dirrm share/entangle/icons/hicolor/32x32/actions
+@dirrm share/entangle/icons/hicolor/32x32
+@dirrm share/entangle/icons/hicolor/22x22/actions
+@dirrm share/entangle/icons/hicolor/22x22
+@dirrm share/entangle/icons/hicolor/16x16/actions
+@dirrm share/entangle/icons/hicolor/16x16
+@dirrm share/entangle/icons/hicolor/128x128/actions
+@dirrm share/entangle/icons/hicolor/128x128
+@dirrm share/entangle/icons/hicolor
+@dirrm share/entangle/icons
+@dirrm share/entangle
+@dirrmtry share/applications
+@dirrm lib/entangle/plugins
+@dirrm lib/entangle