--- Makefile (revision 457276) +++ Makefile (working copy) @@ -3,6 +3,7 @@ PORTNAME= calibre PORTVERSION= 3.14.0 +PORTREVISION= 1 CATEGORIES= deskutils python MASTER_SITES= http://download.calibre-ebook.com/${PORTVERSION}/ @@ -52,7 +53,7 @@ USE_RC_SUBR= calibre EXTRACT_BEFORE_ARGS= -x -s '/^calibre/~-src/' -f SHEBANG_GLOB= *.sh *.py -python_OLD_CMD= "/usr/bin/env python2" /bin/python2 /usr/bin/python2 /usr/local/bin/python2 +python_OLD_CMD= "/usr/bin/env python2" "/usr/bin/env python2" /bin/python2 /usr/bin/python2 /usr/local/bin/python2 USE_PYQT= core gui network sip svg webkit widgets webkitwidgets xmlpatterns USE_QT5= buildtools_build core dbus gui qmake_build widgets USE_GL= egl gl --- files/patch-setup_build__environment.py (revision 457276) +++ files/patch-setup_build__environment.py (working copy) @@ -1,11 +1,24 @@ ---- setup/build_environment.py.orig 2017-06-16 04:00:12 UTC +--- setup/build_environment.py.orig 2017-12-15 02:50:37 UTC +++ setup/build_environment.py -@@ -84,7 +84,7 @@ pyqt['sip_bin'] = os.environ.get('SIP_BIN', 'sip') - from PyQt5.QtCore import PYQT_CONFIGURATION +@@ -9,7 +9,7 @@ __docformat__ = 'restructuredtext en' + import os, subprocess, re, sys, sysconfig + from distutils.spawn import find_executable + +-from setup import isosx, iswindows, is64bit, islinux, ishaiku ++from setup import isbsd, isosx, iswindows, is64bit, islinux, ishaiku + is64bit + + NMAKE = RC = msvc = MT = win_inc = win_lib = None +@@ -85,6 +85,12 @@ from PyQt5.QtCore import PYQT_CONFIGURATION pyqt['sip_flags'] = PYQT_CONFIGURATION['sip_flags'] def get_sip_dir(): -- q = os.environ.get('SIP_DIR', os.path.join(sys.prefix, 'share', 'sip') if iswindows else os.path.join(sys.prefix, 'share', 'sip')) -+ q = os.environ.get('SIP_DIR', os.path.join(sys.prefix, 'share', 'sip') if iswindows else os.path.join(sys.prefix, 'share', 'py-sip')) + q = os.environ.get('SIP_DIR', os.path.join(sys.prefix, 'share', 'sip') if iswindows else os.path.join(sys.prefix, 'share', 'sip')) ++ if iswindows: ++ q = os.environ.get('SIP_DIR', os.path.join(sys.prefix, 'share', 'sip')) ++ elif isbsd: ++ q = os.environ.get('SIP_DIR', os.path.join(sys.prefix, 'share', 'py-sip')) ++ else: ++ q = os.path.join(sys.prefix, 'share', 'sip') for x in ('', 'Py2-PyQt5', 'PyQt5', 'sip/PyQt5'): base = os.path.join(q, x) if os.path.exists(os.path.join(base, 'QtWidgets')): --- files/patch-setup_extensions.json (nonexistent) +++ files/patch-setup_extensions.json (working copy) @@ -0,0 +1,18 @@ +--- setup/extensions.json.orig 2017-12-15 02:50:37 UTC ++++ setup/extensions.json +@@ -194,8 +194,14 @@ + "libraries": "usb-1.0" + }, + { ++ "name": "libusb-bsd", ++ "only": "bsd", ++ "sources": "calibre/devices/libusb/libusb.c", ++ "libraries": "usb" ++ }, ++ { + "name": "libmtp", +- "only": "osx linux haiku", ++ "only": "osx linux haiku bsd", + "sources": "calibre/devices/mtp/unix/devices.c calibre/devices/mtp/unix/libmtp.c", + "headers": "calibre/devices/mtp/unix/devices.h calibre/devices/mtp/unix/upstream/music-players.h calibre/devices/mtp/unix/upstream/device-flags.h", + "libraries": "mtp" --- files/patch-src_calibre_devices_libusb_libusb.c (nonexistent) +++ files/patch-src_calibre_devices_libusb_libusb.c (working copy) @@ -0,0 +1,14 @@ +--- src/calibre/devices/libusb/libusb.c.orig 2017-12-15 02:50:37 UTC ++++ src/calibre/devices/libusb/libusb.c +@@ -8,7 +8,11 @@ + #define UNICODE + + #include ++#ifdef __FreeBSD__ ++#include ++#else + #include ++#endif + + static PyObject *Error = NULL; + static PyObject *cache = NULL; --- pkg-plist (revision 457276) +++ pkg-plist (working copy) @@ -1181,6 +1181,8 @@ lib/calibre/calibre/plugins/icu.so lib/calibre/calibre/plugins/imageops.so lib/calibre/calibre/plugins/libheadless.so +lib/calibre/calibre/plugins/libmtp.so +lib/calibre/calibre/plugins/libusb-bsd.so lib/calibre/calibre/plugins/lzma_binding.so lib/calibre/calibre/plugins/lzx.so lib/calibre/calibre/plugins/matcher.so