mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge branch 'master' of https://github.com/cemeyer/calibre
This commit is contained in:
commit
563865b6c5
@ -9,7 +9,7 @@ __docformat__ = 'restructuredtext en'
|
|||||||
import textwrap, os, shlex, subprocess, glob, shutil, re, sys, json
|
import textwrap, os, shlex, subprocess, glob, shutil, re, sys, json
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
from setup import Command, islinux, isbsd, isosx, ishaiku, SRC, iswindows, __version__
|
from setup import Command, islinux, isbsd, isfreebsd, isosx, ishaiku, SRC, iswindows, __version__
|
||||||
isunix = islinux or isosx or isbsd or ishaiku
|
isunix = islinux or isosx or isbsd or ishaiku
|
||||||
|
|
||||||
py_lib = os.path.join(sys.prefix, 'libs', 'python%d%d.lib' % sys.version_info[:2])
|
py_lib = os.path.join(sys.prefix, 'libs', 'python%d%d.lib' % sys.version_info[:2])
|
||||||
@ -87,9 +87,9 @@ def expand_file_list(items, is_paths=True):
|
|||||||
def is_ext_allowed(ext):
|
def is_ext_allowed(ext):
|
||||||
only = ext.get('only', '')
|
only = ext.get('only', '')
|
||||||
if only:
|
if only:
|
||||||
only = only.split()
|
only = set(only.split())
|
||||||
q = 'windows' if iswindows else 'osx' if isosx else 'bsd' if isbsd else 'haiku' if ishaiku else 'linux'
|
q = set(filter(lambda x: globals()["is" + x], ["bsd", "freebsd", "haiku", "linux", "osx", "windows"]))
|
||||||
return q in only
|
return len(q.intersection(only)) > 0
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
@ -107,6 +107,8 @@ def parse_extension(ext):
|
|||||||
ans = ext.pop('osx_' + k, ans)
|
ans = ext.pop('osx_' + k, ans)
|
||||||
elif isbsd:
|
elif isbsd:
|
||||||
ans = ext.pop('bsd_' + k, ans)
|
ans = ext.pop('bsd_' + k, ans)
|
||||||
|
elif isfreebsd:
|
||||||
|
ans = ext.pop('freebsd_' + k, ans)
|
||||||
elif ishaiku:
|
elif ishaiku:
|
||||||
ans = ext.pop('haiku_' + k, ans)
|
ans = ext.pop('haiku_' + k, ans)
|
||||||
else:
|
else:
|
||||||
|
@ -9,7 +9,7 @@ __docformat__ = 'restructuredtext en'
|
|||||||
import os, subprocess, re, sys, sysconfig
|
import os, subprocess, re, sys, sysconfig
|
||||||
from distutils.spawn import find_executable
|
from distutils.spawn import find_executable
|
||||||
|
|
||||||
from setup import isosx, iswindows, is64bit, islinux, ishaiku
|
from setup import isfreebsd, isosx, iswindows, is64bit, islinux, ishaiku
|
||||||
is64bit
|
is64bit
|
||||||
|
|
||||||
NMAKE = RC = msvc = MT = win_inc = win_lib = None
|
NMAKE = RC = msvc = MT = win_inc = win_lib = None
|
||||||
@ -84,7 +84,12 @@ pyqt['sip_bin'] = os.environ.get('SIP_BIN', 'sip')
|
|||||||
from PyQt5.QtCore import PYQT_CONFIGURATION
|
from PyQt5.QtCore import PYQT_CONFIGURATION
|
||||||
pyqt['sip_flags'] = PYQT_CONFIGURATION['sip_flags']
|
pyqt['sip_flags'] = PYQT_CONFIGURATION['sip_flags']
|
||||||
def get_sip_dir():
|
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'))
|
if iswindows:
|
||||||
|
q = os.environ.get('SIP_DIR', os.path.join(sys.prefix, 'share', 'sip'))
|
||||||
|
elif isfreebsd:
|
||||||
|
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'):
|
for x in ('', 'Py2-PyQt5', 'PyQt5', 'sip/PyQt5'):
|
||||||
base = os.path.join(q, x)
|
base = os.path.join(q, x)
|
||||||
if os.path.exists(os.path.join(base, 'QtWidgets')):
|
if os.path.exists(os.path.join(base, 'QtWidgets')):
|
||||||
|
@ -193,9 +193,15 @@
|
|||||||
"sources": "calibre/devices/libusb/libusb.c",
|
"sources": "calibre/devices/libusb/libusb.c",
|
||||||
"libraries": "usb-1.0"
|
"libraries": "usb-1.0"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "libusb",
|
||||||
|
"only": "freebsd",
|
||||||
|
"sources": "calibre/devices/libusb/libusb.c",
|
||||||
|
"libraries": "usb"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "libmtp",
|
"name": "libmtp",
|
||||||
"only": "osx linux haiku",
|
"only": "freebsd osx linux haiku",
|
||||||
"sources": "calibre/devices/mtp/unix/devices.c calibre/devices/mtp/unix/libmtp.c",
|
"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",
|
"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"
|
"libraries": "mtp"
|
||||||
|
@ -172,7 +172,7 @@ class Plugins(collections.Mapping):
|
|||||||
plugins.extend(['winutil', 'wpd', 'winfonts'])
|
plugins.extend(['winutil', 'wpd', 'winfonts'])
|
||||||
if isosx:
|
if isosx:
|
||||||
plugins.append('usbobserver')
|
plugins.append('usbobserver')
|
||||||
if islinux or isosx:
|
if isfreebsd or ishaiku or islinux or isosx:
|
||||||
plugins.append('libusb')
|
plugins.append('libusb')
|
||||||
plugins.append('libmtp')
|
plugins.append('libmtp')
|
||||||
self.plugins = frozenset(plugins)
|
self.plugins = frozenset(plugins)
|
||||||
|
@ -8,7 +8,11 @@
|
|||||||
#define UNICODE
|
#define UNICODE
|
||||||
|
|
||||||
#include <Python.h>
|
#include <Python.h>
|
||||||
|
#ifdef __FreeBSD__
|
||||||
|
#include <libusb.h>
|
||||||
|
#else
|
||||||
#include <libusb-1.0/libusb.h>
|
#include <libusb-1.0/libusb.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
static PyObject *Error = NULL;
|
static PyObject *Error = NULL;
|
||||||
static PyObject *cache = NULL;
|
static PyObject *cache = NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user