Hi ports@,

Calibre does not start when using the calibre.desktop file because the 
'--detach' option is not defined on *BSD.

The patch below fixes this.

Cheers,
Fabian


Index: Makefile
===================================================================
RCS file: /cvs/ports/textproc/calibre/Makefile,v
retrieving revision 1.33
diff -u -p -r1.33 Makefile
--- Makefile    15 May 2014 10:10:01 -0000      1.33
+++ Makefile    7 Jul 2014 21:04:10 -0000
@@ -7,6 +7,8 @@ CATEGORIES =            textproc
 MASTER_SITES =         ${MASTER_SITE_SOURCEFORGE:=calibre/}
 EXTRACT_SUFX =         .tar.xz
 
+REVISION =             0
+
 HOMEPAGE =             http://calibre-ebook.com/
 
 # GPLv3
Index: patches/patch-src_calibre_gui2___init___py
===================================================================
RCS file: patches/patch-src_calibre_gui2___init___py
diff -N patches/patch-src_calibre_gui2___init___py
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_calibre_gui2___init___py  7 Jul 2014 21:04:10 -0000
@@ -0,0 +1,22 @@
+$OpenBSD$
+
+add '--detach' option. Some .desktop files uses this option
+and will not start calibre correctly without this patch.
+
+--- src/calibre/gui2/__init__.py.orig  Fri May  9 04:41:55 2014
++++ src/calibre/gui2/__init__.py       Mon Jul  7 22:33:05 2014
+@@ -849,12 +849,12 @@ def load_builtin_fonts():
+                         _rating_font = u'calibre Symbols'
+ 
+ def setup_gui_option_parser(parser):
+-    if islinux:
++    if islinux or isbsd:
+         parser.add_option('--detach', default=False, action='store_true',
+                           help='Detach from the controlling terminal, if any 
(linux only)')
+ 
+ def detach_gui():
+-    if islinux and not DEBUG:
++    if (islinux or isbsd) and not DEBUG:
+         # Detach from the controlling process.
+         if os.fork() != 0:
+             raise SystemExit(0)

Reply via email to