mirror of
https://git.FreeBSD.org/ports.git
synced 2025-01-13 07:34:50 +00:00
- Add deskutils/calibre, a ebook management application.
Author: Kovid Goyal <kovid@kovidgoyal.net> WWW: http://calibre.kovidgoyal.net/
This commit is contained in:
parent
86dde77d88
commit
dfabbc95ca
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=242720
@ -22,6 +22,7 @@
|
||||
SUBDIR += buoh
|
||||
SUBDIR += cal
|
||||
SUBDIR += calcurse
|
||||
SUBDIR += calibre
|
||||
SUBDIR += cartotheque
|
||||
SUBDIR += cdcat
|
||||
SUBDIR += charmap
|
||||
|
77
deskutils/calibre/Makefile
Normal file
77
deskutils/calibre/Makefile
Normal file
@ -0,0 +1,77 @@
|
||||
# New ports collection makefile for: calibre
|
||||
# Date created: 10/11/2009
|
||||
# Whom: stas
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
PORTNAME= calibre
|
||||
PORTVERSION= 0.6.17
|
||||
CATEGORIES= deskutils python
|
||||
MASTER_SITES= http://calibre.kovidgoyal.net/downloads/
|
||||
|
||||
MAINTAINER= stas@FreeBSD.org
|
||||
COMMENT= Ebook management application
|
||||
|
||||
LIB_DEPENDS= MagickWand.2:${PORTSDIR}/graphics/ImageMagick \
|
||||
fontconfig.1:${PORTSDIR}/x11-fonts/fontconfig \
|
||||
poppler-qt4.3:${PORTSDIR}/graphics/poppler-qt4 \
|
||||
wmflite:${PORTSDIR}/graphics/libwmf
|
||||
BUILD_DEPENDS= py*-setuptools>=0:${PORTSDIR}/devel/py-setuptools \
|
||||
py*-sip>=0:${PORTSDIR}/devel/py-sip \
|
||||
py*-qt4-core>=0:${PORTSDIR}/devel/py-qt4-core \
|
||||
py*-qt4-gui>=0:${PORTSDIR}/x11-toolkits/py-qt4-gui
|
||||
RUN_DEPENDS= xdg-open:${PORTSDIR}/devel/xdg-utils \
|
||||
py*-dnspython>=0:${PORTSDIR}/dns/py-dnspython \
|
||||
py*-dateutil>=0:${PORTSDIR}/devel/py-dateutil \
|
||||
py*-beautifulsoup>=0:${PORTSDIR}/www/py-beautifulsoup \
|
||||
py*-imaging>=0:${PORTSDIR}/graphics/py-imaging \
|
||||
py*-lxml>=0:${PORTSDIR}/devel/py-lxml \
|
||||
py*-mechanize>=0:${PORTSDIR}/www/py-mechanize \
|
||||
py*-sqlite3>=0:${PORTSDIR}/databases/py-sqlite3 \
|
||||
py*-qt4-core>=0:${PORTSDIR}/devel/py-qt4-core \
|
||||
py*-qt4-gui>=0:${PORTSDIR}/x11-toolkits/py-qt4-gui \
|
||||
py*-qt4-network>=0:${PORTSDIR}/net/py-qt4-network \
|
||||
py*-qt4-webkit>=0:${PORTSDIR}/www/py-qt4-webkit \
|
||||
py*-qt4-xml>=0:${PORTSDIR}/textproc/py-qt4-xml
|
||||
|
||||
OPTIONS= MOUNTHELPER_SUID "Install mount helper as suid binary" off
|
||||
|
||||
USE_GETTEXT= yes
|
||||
USE_PYTHON= 2.6+
|
||||
USE_QT_VER= 4
|
||||
QT_COMPONENTS= qmake_build moc_build
|
||||
WRKSRC= ${WRKDIR}/${PORTNAME}
|
||||
PYSETUP= setup.py
|
||||
CFLAGS+= "-I${LOCALBASE}/include"
|
||||
LDFLAGS+= "-L${LOCALBASE}/lib"
|
||||
MAKE_ENV+= LDFLAGS="${LDFLAGS}" \
|
||||
FC_INC_DIR="${LOCALBASE}/include/fontconfig" \
|
||||
FC_LIB_DIR="${LOCALBASE}/lib"
|
||||
|
||||
MAN1= calibre-customize.1 calibre-debug.1 calibre-server.1 calibre-smtp.1 \
|
||||
calibredb.1 ebook-convert.1 ebook-meta.1 fetch-ebook-metadata.1 \
|
||||
librarything.1 lrf2lrs.1 lrs2lrf.1 pdfmanipulate.1 web2disk.1
|
||||
MANCOMPRESSED= no
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
|
||||
.if ${OSVERSION} < 800069
|
||||
LIB_DEPENDS+= usb-0.1.8:${PORTSDIR}/devel/libusb
|
||||
.endif
|
||||
|
||||
do-build:
|
||||
@(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} \
|
||||
${PYSETUP} build)
|
||||
|
||||
do-install:
|
||||
@(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} \
|
||||
${PYSETUP} install --prefix ${PREFIX})
|
||||
|
||||
post-install:
|
||||
.if defined(WITH_MOUNTHELPER_SUID)
|
||||
${CHOWN} ${BINOWN}:operator ${PREFIX}/bin/calibre-mount-helper
|
||||
${CHMOD} g+s ${PREFIX}/bin/calibre-mount-helper
|
||||
.endif
|
||||
|
||||
.include <bsd.port.post.mk>
|
3
deskutils/calibre/distinfo
Normal file
3
deskutils/calibre/distinfo
Normal file
@ -0,0 +1,3 @@
|
||||
MD5 (calibre-0.6.17.tar.gz) = 818b536dd74dff2afa38460d995dd436
|
||||
SHA256 (calibre-0.6.17.tar.gz) = 696215c12c228c3c399f6fcf483dad4c4d73c2355cb79b673e580d2abc5a3712
|
||||
SIZE (calibre-0.6.17.tar.gz) = 10514520
|
30
deskutils/calibre/files/patch-setup___init__.py
Normal file
30
deskutils/calibre/files/patch-setup___init__.py
Normal file
@ -0,0 +1,30 @@
|
||||
--- setup/__init__.py.orig 2009-10-11 19:11:10.000000000 +0400
|
||||
+++ setup/__init__.py 2009-10-11 19:12:17.000000000 +0400
|
||||
@@ -11,7 +11,8 @@
|
||||
is64bit = platform.architecture()[0] == '64bit'
|
||||
iswindows = re.search('win(32|64)', sys.platform)
|
||||
isosx = 'darwin' in sys.platform
|
||||
-islinux = not isosx and not iswindows
|
||||
+isfreebsd = 'freebsd' in sys.platform
|
||||
+islinux = not isosx and not iswindows and not isfreebsd
|
||||
SRC = os.path.abspath('src')
|
||||
sys.path.insert(0, SRC)
|
||||
sys.resources_location = os.path.join(os.path.dirname(SRC), 'resources')
|
||||
@@ -117,7 +118,7 @@
|
||||
self.real_user = os.environ.get('SUDO_USER', None)
|
||||
|
||||
def drop_privileges(self):
|
||||
- if not islinux or isosx:
|
||||
+ if not islinux or isosx or isfreebsd:
|
||||
return
|
||||
if self.real_user is not None:
|
||||
self.info('Dropping privileges to those of', self.real_user+':',
|
||||
@@ -128,7 +129,7 @@
|
||||
os.seteuid(int(self.real_uid))
|
||||
|
||||
def regain_privileges(self):
|
||||
- if not islinux or isosx:
|
||||
+ if not islinux or isosx or isfreebsd:
|
||||
return
|
||||
if os.geteuid() != 0 and self.orig_euid == 0:
|
||||
self.info('Trying to get root privileges')
|
43
deskutils/calibre/files/patch-setup_extensions.py
Normal file
43
deskutils/calibre/files/patch-setup_extensions.py
Normal file
@ -0,0 +1,43 @@
|
||||
--- setup/extensions.py.orig 2009-10-10 06:15:00.000000000 +0400
|
||||
+++ setup/extensions.py 2009-10-11 19:37:56.000000000 +0400
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
from PyQt4.pyqtconfig import QtGuiModuleMakefile
|
||||
|
||||
-from setup import Command, islinux, isosx, SRC, iswindows
|
||||
+from setup import Command, islinux, isfreebsd, isosx, SRC, iswindows
|
||||
from setup.build_environment import fc_inc, fc_lib, \
|
||||
fc_error, poppler_libs, poppler_lib_dirs, poppler_inc_dirs, podofo_inc, \
|
||||
podofo_lib, podofo_error, poppler_error, pyqt, OSX_SDK, NMAKE, \
|
||||
@@ -19,7 +19,7 @@
|
||||
magick_inc_dirs, magick_lib_dirs, png_lib_dirs, png_libs, \
|
||||
magick_error, magick_libs, ft_lib_dirs, ft_libs, jpg_libs, jpg_lib_dirs
|
||||
MT
|
||||
-isunix = islinux or isosx
|
||||
+isunix = islinux or isosx or isfreebsd
|
||||
|
||||
make = 'make' if isunix else NMAKE
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
if isunix:
|
||||
cc = os.environ.get('CC', 'gcc')
|
||||
cxx = os.environ.get('CXX', 'g++')
|
||||
- cflags = '-O3 -Wall -DNDEBUG -fPIC -fno-strict-aliasing -pipe'.split()
|
||||
+ cflags = '-Wall -DNDEBUG -fPIC'.split()
|
||||
ldflags = ['-Wall']
|
||||
cflags += shlex.split(os.environ.get('CFLAGS', ''))
|
||||
ldflags += shlex.split(os.environ.get('LDFLAGS', ''))
|
||||
@@ -146,6 +146,13 @@
|
||||
ldflags.append('-lpython'+sysconfig.get_python_version())
|
||||
|
||||
|
||||
+if isfreebsd:
|
||||
+ cflags.append('-pthread')
|
||||
+ ldflags.append('-shared')
|
||||
+ cflags.append('-I'+sysconfig.get_python_inc())
|
||||
+ ldflags.append('-lpython'+sysconfig.get_python_version())
|
||||
+
|
||||
+
|
||||
if isosx:
|
||||
x, p = ('x86_64', 'ppc64') if leopard_build else ('i386', 'ppc')
|
||||
archs = ['-arch', x, '-arch', p, '-isysroot',
|
46
deskutils/calibre/files/patch-setup_install.py
Normal file
46
deskutils/calibre/files/patch-setup_install.py
Normal file
@ -0,0 +1,46 @@
|
||||
--- setup/install.py.orig 2009-10-10 06:15:00.000000000 +0400
|
||||
+++ setup/install.py 2009-10-12 14:23:51.000000000 +0400
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
import sys, os, textwrap, subprocess, shutil, tempfile, atexit, stat
|
||||
|
||||
-from setup import Command, islinux, basenames, modules, functions, \
|
||||
+from setup import Command, islinux, isfreebsd, basenames, modules, functions, \
|
||||
__appname__, __version__
|
||||
|
||||
HEADER = '''\
|
||||
@@ -115,7 +115,7 @@
|
||||
|
||||
|
||||
def pre_sub_commands(self, opts):
|
||||
- if not islinux:
|
||||
+ if not (islinux or isfreebsd):
|
||||
self.info('\nSetting up a source based development environment is only '
|
||||
'supported on linux. On other platforms, see the User Manual'
|
||||
' for help with setting up a development environment.')
|
||||
@@ -143,9 +143,9 @@
|
||||
self.warn('Failed to compile mount helper. Auto mounting of',
|
||||
' devices will not work')
|
||||
|
||||
- if os.geteuid() != 0:
|
||||
- return self.warn('Must be run as root to compile mount helper. Auto '
|
||||
- 'mounting of devices will not work.')
|
||||
+# if os.geteuid() != 0:
|
||||
+# return self.warn('Must be run as root to compile mount helper. Auto '
|
||||
+# 'mounting of devices will not work.')
|
||||
src = os.path.join(self.SRC, 'calibre', 'devices', 'linux_mount_helper.c')
|
||||
dest = os.path.join(self.staging_bindir, 'calibre-mount-helper')
|
||||
self.info('Installing mount helper to '+ dest)
|
||||
@@ -153,9 +153,9 @@
|
||||
ret = p.wait()
|
||||
if ret != 0:
|
||||
return warn()
|
||||
- os.chown(dest, 0, 0)
|
||||
- os.chmod(dest, stat.S_ISUID|stat.S_ISGID|stat.S_IRUSR|stat.S_IWUSR|\
|
||||
- stat.S_IXUSR|stat.S_IXGRP|stat.S_IXOTH)
|
||||
+# os.chown(dest, 0, 0)
|
||||
+# os.chmod(dest, stat.S_ISUID|stat.S_ISGID|stat.S_IRUSR|stat.S_IWUSR|\
|
||||
+# stat.S_IXUSR|stat.S_IXGRP|stat.S_IXOTH)
|
||||
self.manifest.append(dest)
|
||||
return dest
|
||||
|
11
deskutils/calibre/files/patch-src_calibre___init__.py
Normal file
11
deskutils/calibre/files/patch-src_calibre___init__.py
Normal file
@ -0,0 +1,11 @@
|
||||
--- src/calibre/__init__.py.orig 2009-10-11 20:14:29.000000000 +0400
|
||||
+++ src/calibre/__init__.py 2009-10-11 20:14:41.000000000 +0400
|
||||
@@ -14,7 +14,7 @@
|
||||
from PyQt4.QtCore import QUrl
|
||||
from PyQt4.QtGui import QDesktopServices
|
||||
from calibre.startup import plugins, winutil, winutilerror
|
||||
-from calibre.constants import iswindows, isosx, islinux, isfrozen, \
|
||||
+from calibre.constants import iswindows, isosx, islinux, isfreebsd, isfrozen, \
|
||||
terminal_controller, preferred_encoding, \
|
||||
__appname__, __version__, __author__, \
|
||||
win32event, win32api, winerror, fcntl, \
|
12
deskutils/calibre/files/patch-src_calibre_constants.py
Normal file
12
deskutils/calibre/files/patch-src_calibre_constants.py
Normal file
@ -0,0 +1,12 @@
|
||||
--- src/calibre/constants.py.orig 2009-10-11 17:23:28.000000000 +0400
|
||||
+++ src/calibre/constants.py 2009-10-11 18:02:53.000000000 +0400
|
||||
@@ -22,7 +22,8 @@
|
||||
iswindows = 'win32' in sys.platform.lower() or 'win64' in sys.platform.lower()
|
||||
isosx = 'darwin' in sys.platform.lower()
|
||||
isnewosx = isosx and getattr(sys, 'new_app_bundle', False)
|
||||
-islinux = not(iswindows or isosx)
|
||||
+isfreebsd = 'freebsd' in sys.platform.lower()
|
||||
+islinux = not(iswindows or isosx or isfreebsd)
|
||||
isfrozen = hasattr(sys, 'frozen')
|
||||
|
||||
try:
|
15
deskutils/calibre/files/patch-src_calibre_devices_libusb.py
Normal file
15
deskutils/calibre/files/patch-src_calibre_devices_libusb.py
Normal file
@ -0,0 +1,15 @@
|
||||
--- src/calibre/devices/libusb.py.orig 2009-10-10 06:15:00.000000000 +0400
|
||||
+++ src/calibre/devices/libusb.py 2009-10-11 23:19:54.000000000 +0400
|
||||
@@ -8,10 +8,10 @@
|
||||
c_ubyte, c_ushort, c_int, c_char, c_void_p, c_byte, c_uint
|
||||
from errno import EBUSY, ENOMEM
|
||||
|
||||
-from calibre import iswindows, isosx, load_library
|
||||
+from calibre import iswindows, isosx, isfreebsd, load_library
|
||||
|
||||
_libusb_name = 'libusb'
|
||||
-PATH_MAX = 511 if iswindows else 1024 if isosx else 4096
|
||||
+PATH_MAX = 511 if iswindows else 1024 if isosx else 1024 if isfreebsd else 4096
|
||||
if iswindows:
|
||||
class Structure(_Structure):
|
||||
_pack_ = 1
|
@ -0,0 +1,38 @@
|
||||
--- src/calibre/devices/usbms/device.py.orig 2009-10-11 19:19:08.000000000 +0400
|
||||
+++ src/calibre/devices/usbms/device.py 2009-10-11 19:19:46.000000000 +0400
|
||||
@@ -22,7 +22,7 @@
|
||||
from calibre.devices.interface import DevicePlugin
|
||||
from calibre.devices.errors import DeviceError, FreeSpaceError
|
||||
from calibre.devices.usbms.deviceconfig import DeviceConfig
|
||||
-from calibre import iswindows, islinux, isosx, __appname__
|
||||
+from calibre import iswindows, islinux, isosx, isfreebsd, __appname__
|
||||
from calibre.utils.filenames import ascii_filename as sanitize, shorten_components_to
|
||||
|
||||
class Device(DeviceConfig, DevicePlugin):
|
||||
@@ -554,7 +554,7 @@
|
||||
def open(self):
|
||||
time.sleep(5)
|
||||
self._main_prefix = self._card_a_prefix = self._card_b_prefix = None
|
||||
- if islinux:
|
||||
+ if islinux or isfreebsd:
|
||||
try:
|
||||
self.open_linux()
|
||||
except DeviceError:
|
||||
@@ -621,7 +621,7 @@
|
||||
pass
|
||||
|
||||
def eject(self):
|
||||
- if islinux:
|
||||
+ if islinux or isfreebsd:
|
||||
try:
|
||||
self.eject_linux()
|
||||
except:
|
||||
@@ -655,7 +655,7 @@
|
||||
self._linux_mount_map = {}
|
||||
|
||||
def post_yank_cleanup(self):
|
||||
- if islinux:
|
||||
+ if islinux or isfreebsd:
|
||||
try:
|
||||
self.linux_post_yank()
|
||||
except:
|
@ -0,0 +1,29 @@
|
||||
--- src/calibre/ebooks/html/input.py.orig 2009-10-11 19:20:45.000000000 +0400
|
||||
+++ src/calibre/ebooks/html/input.py 2009-10-11 19:21:09.000000000 +0400
|
||||
@@ -20,7 +20,7 @@
|
||||
from calibre.customize.conversion import InputFormatPlugin
|
||||
from calibre.ebooks.chardet import xml_to_unicode
|
||||
from calibre.customize.conversion import OptionRecommendation
|
||||
-from calibre.constants import islinux
|
||||
+from calibre.constants import islinux, isfreebsd
|
||||
from calibre import unicode_path
|
||||
from calibre.utils.localization import get_lang
|
||||
|
||||
@@ -344,7 +344,7 @@
|
||||
self.added_resources = {}
|
||||
self.log = log
|
||||
for path, href in htmlfile_map.items():
|
||||
- if not islinux:
|
||||
+ if not (islinux or isfreebsd):
|
||||
path = path.lower()
|
||||
self.added_resources[path] = href
|
||||
self.urlnormalize, self.DirContainer = urlnormalize, DirContainer
|
||||
@@ -409,7 +409,7 @@
|
||||
link = os.path.abspath(link)
|
||||
if not os.access(link, os.R_OK):
|
||||
return link_
|
||||
- if not islinux:
|
||||
+ if not (islinux or isfreebsd):
|
||||
link = link.lower()
|
||||
if link not in self.added_resources:
|
||||
bhref = os.path.basename(link)
|
@ -0,0 +1,18 @@
|
||||
--- src/calibre/ebooks/lrf/html/table_as_image.py.orig 2009-10-12 00:04:02.000000000 +0400
|
||||
+++ src/calibre/ebooks/lrf/html/table_as_image.py 2009-10-12 00:04:09.000000000 +0400
|
||||
@@ -9,7 +9,7 @@
|
||||
import os, tempfile, atexit, shutil
|
||||
from PyQt4.Qt import QUrl, QApplication, QSize, QEventLoop, \
|
||||
SIGNAL, QPainter, QImage, QObject, Qt
|
||||
-from PyQt4.QtWebKit import QWebPage
|
||||
+from PyQt4.QtWebKit import *
|
||||
|
||||
|
||||
class HTMLTableRenderer(QObject):
|
||||
@@ -91,4 +91,4 @@
|
||||
QApplication([])
|
||||
tr = HTMLTableRenderer(html, base_dir, width, height, dpi, factor)
|
||||
tr.loop.exec_()
|
||||
- return tr.images, tr.tdir
|
||||
\ No newline at end of file
|
||||
+ return tr.images, tr.tdir
|
@ -0,0 +1,11 @@
|
||||
--- src/calibre/ebooks/pdf/images.cpp.orig 2009-10-11 23:25:44.000000000 +0400
|
||||
+++ src/calibre/ebooks/pdf/images.cpp 2009-10-11 23:25:51.000000000 +0400
|
||||
@@ -157,7 +157,7 @@
|
||||
delete writer;
|
||||
|
||||
free(row);
|
||||
- imgStr->close();
|
||||
+// imgStr->close();
|
||||
delete imgStr;
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
--- src/calibre/ebooks/pdf/pdftohtml.py.orig 2009-10-11 19:20:09.000000000 +0400
|
||||
+++ src/calibre/ebooks/pdf/pdftohtml.py 2009-10-11 19:20:25.000000000 +0400
|
||||
@@ -12,7 +12,7 @@
|
||||
from functools import partial
|
||||
|
||||
from calibre.ebooks import ConversionError, DRMError
|
||||
-from calibre import isosx, iswindows, islinux
|
||||
+from calibre import isosx, iswindows, islinux, isfreebsd
|
||||
from calibre import CurrentDir
|
||||
|
||||
PDFTOHTML = 'pdftohtml'
|
||||
@@ -22,7 +22,7 @@
|
||||
if iswindows and hasattr(sys, 'frozen'):
|
||||
PDFTOHTML = os.path.join(os.path.dirname(sys.executable), 'pdftohtml.exe')
|
||||
popen = partial(subprocess.Popen, creationflags=0x08) # CREATE_NO_WINDOW=0x08 so that no ugly console is popped up
|
||||
-if islinux and getattr(sys, 'frozen_path', False):
|
||||
+if (islinux or isfreebsd) and getattr(sys, 'frozen_path', False):
|
||||
PDFTOHTML = os.path.join(getattr(sys, 'frozen_path'), 'pdftohtml')
|
||||
|
||||
def pdftohtml(output_dir, pdf_path, no_images):
|
@ -0,0 +1,11 @@
|
||||
--- src/calibre/ebooks/pdf/reflow.cpp.orig 2009-10-11 23:21:41.000000000 +0400
|
||||
+++ src/calibre/ebooks/pdf/reflow.cpp 2009-10-11 23:25:18.000000000 +0400
|
||||
@@ -669,7 +669,7 @@
|
||||
int width, int height, GBool invert,
|
||||
GBool interpolate, GBool inlineImg) {
|
||||
OutputDev::drawImageMask(state, ref, str, width, height,
|
||||
- invert, interpolate, inlineImg);
|
||||
+ invert, inlineImg);
|
||||
//this->images->add_mask();
|
||||
cerr << "mask requested" << endl;
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
--- src/calibre/ebooks/pdf/writer.py.orig 2009-10-11 23:06:22.000000000 +0400
|
||||
+++ src/calibre/ebooks/pdf/writer.py 2009-10-11 23:18:59.000000000 +0400
|
||||
@@ -19,7 +19,7 @@
|
||||
from PyQt4 import QtCore
|
||||
from PyQt4.Qt import QUrl, QEventLoop, SIGNAL, QObject, \
|
||||
QApplication, QPrinter, QMetaObject, QSizeF, Qt
|
||||
-from PyQt4.QtWebKit import QWebView
|
||||
+from PyQt4.QtWebKit import *
|
||||
|
||||
from pyPdf import PdfFileWriter, PdfFileReader
|
||||
|
20
deskutils/calibre/files/patch-src_calibre_gui2___init__.py
Normal file
20
deskutils/calibre/files/patch-src_calibre_gui2___init__.py
Normal file
@ -0,0 +1,20 @@
|
||||
--- src/calibre/gui2/__init__.py.orig 2009-10-11 19:17:36.000000000 +0400
|
||||
+++ src/calibre/gui2/__init__.py 2009-10-11 19:17:55.000000000 +0400
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
ORG_NAME = 'KovidsBrain'
|
||||
APP_UID = 'libprs500'
|
||||
-from calibre import islinux, iswindows, isosx
|
||||
+from calibre import islinux, iswindows, isosx, isfreebsd
|
||||
from calibre.utils.config import Config, ConfigProxy, dynamic
|
||||
from calibre.utils.localization import set_qt_translator
|
||||
from calibre.ebooks.metadata.meta import get_metadata, metadata_from_formats
|
||||
@@ -522,7 +522,7 @@
|
||||
|
||||
def is_ok_to_use_qt():
|
||||
global gui_thread
|
||||
- if islinux and ':' not in os.environ.get('DISPLAY', ''):
|
||||
+ if (islinux or isfreebsd) and ':' not in os.environ.get('DISPLAY', ''):
|
||||
return False
|
||||
if QApplication.instance() is None:
|
||||
QApplication([])
|
@ -0,0 +1,22 @@
|
||||
--- ./src/calibre/gui2/dialogs/metadata_single.py.orig 2009-10-11 19:16:07.000000000 +0400
|
||||
+++ ./src/calibre/gui2/dialogs/metadata_single.py 2009-10-11 19:16:34.000000000 +0400
|
||||
@@ -24,7 +24,7 @@
|
||||
from calibre.ebooks import BOOK_EXTENSIONS
|
||||
from calibre.ebooks.metadata import authors_to_sort_string, string_to_authors, authors_to_string
|
||||
from calibre.ebooks.metadata.library_thing import cover_from_isbn
|
||||
-from calibre import islinux
|
||||
+from calibre import islinux, isfreebsd
|
||||
from calibre.ebooks.metadata.meta import get_metadata
|
||||
from calibre.utils.config import prefs
|
||||
from calibre.customize.ui import run_plugins_on_import
|
||||
@@ -382,8 +382,8 @@
|
||||
height_of_rest = self.frameGeometry().height() - self.cover.height()
|
||||
width_of_rest = self.frameGeometry().width() - self.cover.width()
|
||||
ag = QCoreApplication.instance().desktop().availableGeometry(self)
|
||||
- self.cover.MAX_HEIGHT = ag.height()-(25 if islinux else 0)-height_of_rest
|
||||
- self.cover.MAX_WIDTH = ag.width()-(25 if islinux else 0)-width_of_rest
|
||||
+ self.cover.MAX_HEIGHT = ag.height()-(25 if (islinux or isfreebsd) else 0)-height_of_rest
|
||||
+ self.cover.MAX_WIDTH = ag.width()-(25 if (islinux or isfreebsd) else 0)-width_of_rest
|
||||
if cover:
|
||||
pm = QPixmap()
|
||||
pm.loadFromData(cover)
|
@ -0,0 +1,29 @@
|
||||
--- src/calibre/gui2/lrf_renderer/main.py.orig 2009-10-11 19:13:56.000000000 +0400
|
||||
+++ src/calibre/gui2/lrf_renderer/main.py 2009-10-11 19:14:32.000000000 +0400
|
||||
@@ -5,7 +5,7 @@
|
||||
from PyQt4.QtGui import QKeySequence, QPainter, QDialog, QSpinBox, QSlider, QIcon
|
||||
from PyQt4.QtCore import Qt, QObject, SIGNAL, QCoreApplication, QThread
|
||||
|
||||
-from calibre import __appname__, setup_cli_handlers, islinux
|
||||
+from calibre import __appname__, setup_cli_handlers, islinux, isfreebsd
|
||||
from calibre.ebooks.lrf.lrfparser import LRFDocument
|
||||
|
||||
from calibre.gui2 import ORG_NAME, APP_UID, error_dialog, \
|
||||
@@ -255,7 +255,7 @@
|
||||
level = logging.DEBUG if opts.verbose else logging.INFO
|
||||
logger = logging.getLogger('lrfviewer')
|
||||
setup_cli_handlers(logger, level)
|
||||
- if islinux:
|
||||
+ if islinux or isfreebsd:
|
||||
try: # Set lrfviewer as the default for LRF files for this user
|
||||
from subprocess import call
|
||||
call('xdg-mime default calibre-lrfviewer.desktop application/lrf', shell=True)
|
||||
@@ -304,7 +304,7 @@
|
||||
if hasattr(opts, 'help'):
|
||||
parser.print_help()
|
||||
return 1
|
||||
- pid = os.fork() if islinux else -1
|
||||
+ pid = os.fork() if (islinux or isfreebsd) else -1
|
||||
if pid <= 0:
|
||||
app = Application(args)
|
||||
app.setWindowIcon(QIcon(I('viewer.svg')))
|
11
deskutils/calibre/files/patch-src_calibre_gui2_main.py
Normal file
11
deskutils/calibre/files/patch-src_calibre_gui2_main.py
Normal file
@ -0,0 +1,11 @@
|
||||
--- src/calibre/gui2/main.py.orig 2009-10-11 19:12:53.000000000 +0400
|
||||
+++ src/calibre/gui2/main.py 2009-10-11 19:13:28.000000000 +0400
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
from calibre import prints, patheq
|
||||
from calibre.constants import __version__, __appname__, isfrozen, islinux, \
|
||||
- iswindows, isosx, filesystem_encoding
|
||||
+ iswindows, isosx, isfreebsd, filesystem_encoding
|
||||
from calibre.utils.filenames import ascii_filename
|
||||
from calibre.ptempfile import PersistentTemporaryFile
|
||||
from calibre.utils.config import prefs, dynamic
|
@ -0,0 +1,11 @@
|
||||
--- src/calibre/gui2/viewer/documentview.py.orig 2009-10-12 00:03:34.000000000 +0400
|
||||
+++ src/calibre/gui2/viewer/documentview.py 2009-10-12 00:03:45.000000000 +0400
|
||||
@@ -10,7 +10,7 @@
|
||||
QPainter, QPalette, QBrush, QFontDatabase, QDialog, \
|
||||
QColor, QPoint, QImage, QRegion, QVariant, \
|
||||
QFont, QObject, QApplication, pyqtSignature
|
||||
-from PyQt4.QtWebKit import QWebPage, QWebView, QWebSettings
|
||||
+from PyQt4.QtWebKit import *
|
||||
|
||||
from calibre.utils.config import Config, StringConfig
|
||||
from calibre.utils.localization import get_language
|
@ -0,0 +1,20 @@
|
||||
--- src/calibre/gui2/viewer/main.py.orig 2009-10-11 19:16:59.000000000 +0400
|
||||
+++ src/calibre/gui2/viewer/main.py 2009-10-11 19:17:14.000000000 +0400
|
||||
@@ -19,7 +19,7 @@
|
||||
info_dialog, error_dialog
|
||||
from calibre.ebooks.oeb.iterator import EbookIterator
|
||||
from calibre.ebooks import DRMError
|
||||
-from calibre.constants import islinux
|
||||
+from calibre.constants import islinux, isfreebsd
|
||||
from calibre.utils.config import Config, StringConfig, dynamic
|
||||
from calibre.gui2.search_box import SearchBox2
|
||||
from calibre.ebooks.metadata import MetaInformation
|
||||
@@ -665,7 +665,7 @@
|
||||
def main(args=sys.argv):
|
||||
parser = option_parser()
|
||||
opts, args = parser.parse_args(args)
|
||||
- pid = os.fork() if False and islinux else -1
|
||||
+ pid = os.fork() if False and (islinux or isfreebsd) else -1
|
||||
if pid <= 0:
|
||||
app = Application(args)
|
||||
app.setWindowIcon(QIcon(I('viewer.svg')))
|
@ -0,0 +1,11 @@
|
||||
--- src/calibre/gui2/viewer/printing.py.orig 2009-10-12 00:05:04.000000000 +0400
|
||||
+++ src/calibre/gui2/viewer/printing.py 2009-10-12 00:05:09.000000000 +0400
|
||||
@@ -12,7 +12,7 @@
|
||||
from PyQt4 import QtCore
|
||||
from PyQt4.Qt import QUrl, QEventLoop, SIGNAL, QObject, QApplication, Qt, \
|
||||
QPrinter, QPrintPreviewDialog, QPrintDialog, QDialog, QMetaObject, Q_ARG
|
||||
-from PyQt4.QtWebKit import QWebView
|
||||
+from PyQt4.QtWebKit import *
|
||||
|
||||
PRINTCSS = 'body{width:100%;margin:0;padding:0;font-family:Arial;color:#000;background:none;font-size:12pt;text-align:left;}h1,h2,h3,h4,h5,h6{font-family:Helvetica;}h1{font-size:19pt;}h2{font-size:17pt;}h3{font-size:15pt;}h4,h5,h6{font-size:12pt;}pre,code,samp{font:10ptCourier,monospace;white-space:pre-wrap;page-break-inside:avoid;}blockquote{margin:1.3em;padding:1em;font-size:10pt;}hr{background-color:#ccc;}aimg{border:none;}a:link,a:visited{background:transparent;font-weight:700;text-decoration:underline;color:#333;}a:link:after,a{color:#000;}table{margin:1px;text-align:left;}th{border-bottom:1pxsolid#333;font-weight:bold;}td{border-bottom:1pxsolid#333;}th,td{padding:4px10px4px0;}tfoot{font-style:italic;}caption{background:#fff;margin-bottom:2em;text-align:left;}thead{display:table-header-group;}tr{page-break-inside:avoid;}#header,.header,#footer,.footer,#navbar,.navbar,#navigation,.navigation,#rightSideBar,.rightSideBar,#leftSideBar,.leftSideBar{display:none;}'
|
||||
|
40
deskutils/calibre/files/patch-src_calibre_linux.py
Normal file
40
deskutils/calibre/files/patch-src_calibre_linux.py
Normal file
@ -0,0 +1,40 @@
|
||||
--- src/calibre/linux.py.orig 2009-10-10 06:15:01.000000000 +0400
|
||||
+++ src/calibre/linux.py 2009-10-12 14:10:34.000000000 +0400
|
||||
@@ -128,10 +128,7 @@
|
||||
self.icon_resources = []
|
||||
self.menu_resources = []
|
||||
self.mime_resources = []
|
||||
- self.setup_completion()
|
||||
- self.setup_udev_rules()
|
||||
self.install_man_pages()
|
||||
- self.setup_desktop_integration()
|
||||
self.create_uninstaller()
|
||||
|
||||
from calibre.utils.config import config_dir
|
||||
@@ -140,8 +137,6 @@
|
||||
for f in os.listdir('.'):
|
||||
if os.stat(f).st_uid == 0:
|
||||
os.rmdir(f) if os.path.isdir(f) else os.unlink(f)
|
||||
- if os.stat(config_dir).st_uid == 0:
|
||||
- os.rmdir(config_dir)
|
||||
|
||||
if warn is None and self.warnings:
|
||||
self.info('There were %d warnings'%len(self.warnings))
|
||||
@@ -319,7 +314,7 @@
|
||||
def install_man_pages(self):
|
||||
try:
|
||||
from calibre.utils.help2man import create_man_page
|
||||
- manpath = os.path.join(self.opts.staging_sharedir, 'man/man1')
|
||||
+ manpath = os.path.join(self.opts.staging_root, 'man/man1')
|
||||
if not os.path.exists(manpath):
|
||||
os.makedirs(manpath)
|
||||
self.info('Installing MAN pages...')
|
||||
@@ -332,7 +327,7 @@
|
||||
continue
|
||||
parser = parser()
|
||||
raw = create_man_page(prog, parser)
|
||||
- manfile = os.path.join(manpath, prog+'.1'+__appname__+'.bz2')
|
||||
+ manfile = os.path.join(manpath, prog+'.1')
|
||||
self.info('\tInstalling MAN page for', prog)
|
||||
open(manfile, 'wb').write(raw)
|
||||
self.manifest.append(manfile)
|
19
deskutils/calibre/files/patch-src_calibre_utils_help2man.py
Normal file
19
deskutils/calibre/files/patch-src_calibre_utils_help2man.py
Normal file
@ -0,0 +1,19 @@
|
||||
--- src/calibre/utils/help2man.py.orig 2009-10-11 23:44:37.000000000 +0400
|
||||
+++ src/calibre/utils/help2man.py 2009-10-11 23:49:58.000000000 +0400
|
||||
@@ -3,7 +3,7 @@
|
||||
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
-import time, bz2
|
||||
+import time, gzip
|
||||
|
||||
from calibre.constants import __version__, __appname__, __author__
|
||||
|
||||
@@ -57,6 +57,6 @@
|
||||
lines = [x if isinstance(x, unicode) else unicode(x, 'utf-8', 'replace') for
|
||||
x in lines]
|
||||
|
||||
- return bz2.compress((u'\n'.join(lines)).encode('utf-8'))
|
||||
+ return (u'\n'.join(lines)).encode('utf-8')
|
||||
|
||||
|
6
deskutils/calibre/pkg-descr
Normal file
6
deskutils/calibre/pkg-descr
Normal file
@ -0,0 +1,6 @@
|
||||
Calibre is meant to be a complete e-library solution and thus includes
|
||||
library management, format conversion, news feeds to ebook conversion,
|
||||
as well as e-book reader sync features and an integrated e-book viewer.
|
||||
|
||||
Author: Kovid Goyal <kovid@kovidgoyal.net>
|
||||
WWW: http://calibre.kovidgoyal.net/
|
1492
deskutils/calibre/pkg-plist
Normal file
1492
deskutils/calibre/pkg-plist
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user