Update calibre to 1.10.0, unbreaking the port. This removes various

diffs to fix with newer poppler/png.
This commit is contained in:
sthen 2013-11-09 15:02:14 +00:00
parent a578087500
commit 9bd6c58123
15 changed files with 2086 additions and 634 deletions

View File

@ -1,13 +1,11 @@
# $OpenBSD: Makefile,v 1.23 2013/11/08 22:41:29 sthen Exp $
BROKEN = temporarily broken, py-qt4 update
# $OpenBSD: Makefile,v 1.24 2013/11/09 15:02:14 sthen Exp $
COMMENT = ebook management application
DISTNAME = calibre-0.8.20
DISTNAME = calibre-1.10.0
CATEGORIES = textproc
MASTER_SITES = ${MASTER_SITE_SOURCEFORGE:=calibre/}
REVISION = 8
EXTRACT_SUFX = .tar.xz
HOMEPAGE = http://calibre-ebook.com/
@ -17,16 +15,15 @@ PERMIT_PACKAGE_CDROM = Yes
MODULES = lang/python \
x11/qt4
WANTLIB += ICE MagickCore MagickWand QtGui SM X11 Xext
WANTLIB += Xi Xinerama Xrender c chm fontconfig freetype
WANTLIB += icudata icui18n icuio icuuc m png poppler
WANTLIB += stdc++ pthread
WANTLIB += ${MODPY_WANTLIB}
WANTLIB += ${MODPY_WANTLIB}
WANTLIB += ICE MagickCore MagickWand QtDBus QtGui QtSvg QtXml
WANTLIB += SM X11 Xext Xi Xinerama Xrender chm fontconfig freetype
WANTLIB += icudata icui18n icuio icuuc m mtp pthread stdc++ usb-1.0 z
LIB_DEPENDS= devel/chmlib \
devel/libmtp \
devel/libusb1 \
graphics/ImageMagick \
graphics/png \
print/poppler, \
textproc/icu4c
COMMON_DEPENDS = devel/py-dateutil \
@ -35,8 +32,11 @@ COMMON_DEPENDS = devel/py-dateutil \
graphics/libwmf \
graphics/py-Imaging \
net/py-dnspython \
graphics/png \
print/poppler, \
print/poppler,,-qt4 \
textproc/py-cssutils>=0.9.7 \
textproc/py-cssselect \
textproc/py-cssutils>=0.9.9 \
textproc/py-lxml>=2.2.8 \
textproc/py-pdf \
www/py-beautifulsoup \
@ -47,19 +47,26 @@ COMMON_DEPENDS = devel/py-dateutil \
BUILD_DEPENDS = ${COMMON_DEPENDS}
# This is a disgusting workaround for calibre depending on private Qt4
# interfaces that are not intended for external use. Upstream is fairly
# hostile towards packagers and would prefer people directly run a file
# from his website as root without any verification.
BUILD_DEPENDS += x11/qt4:patch
UPSTREAM_CLUE_LEVEL = 0 # https://bugs.launchpad.net/calibre/+bug/1094719
SUBST_VARS = WRKDIR
RUN_DEPENDS = ${COMMON_DEPENDS} \
databases/py-apsw \
devel/desktop-file-utils \
misc/shared-mime-info \
print/poppler,-utils
CFLAGS += "-I${LOCALBASE}/include"
LDFLAGS += "-L${LOCALBASE}/lib"
MAKE_ENV += QMAKE="${LOCALBASE}/bin/qmake4" \
LDFLAGS="${LDFLAGS}" \
FC_INC_DIR="${X11BASE}/include" \
FC_LIB_DIR="${X11BASE}/lib" \
PNG_INC_DIR="`pkg-config --cflags libpng`" \
PNG_LIB_DIR="`pkg-config --libs libpng`"
#CFLAGS += -I${X11BASE}/include -I${LOCALBASE}/include
LDFLAGS += -L${LOCALBASE}/lib
MAKE_ENV += QMAKE="${LOCALBASE}/bin/qmake4"
MAKE_ENV += LDFLAGS="${LDFLAGS}"
MAKE_ENV += FT_LIB_DIR="${X11BASE}/lib"
# Requires /sys filesystem for HW detection
MAKE_ENV += WITH_USB=no
@ -80,10 +87,12 @@ pre-configure:
cd ${WRKSRC} && (rm -rf src/cherrypy src/pyPdf ; \
find . -name '*.py' -print0 | xargs -0 perl -pi -e \
's,#!/usr/bin/env python(2)?,#!${MODPY_BIN},' )
cd ${WRKDIR}; ln -s x11/qt4/qt-everywhere-opensource-src-*/include
cd ${WRKSRC}/setup && ${SUBST_CMD} extensions.py build_environment.py
do-install:
${MODPY_CMD} ${MODPY_DISTUTILS_INSTALL} ${MODPY_DISTUTILS_INSTALLARGS}
chmod 755 ${PREFIX}/bin/calibre-mount-helper
rm -rf ${WRKDIR}/.config # to unbreak 'make clean'; created as root
${INSTALL_DATA_DIR} ${PREFIX}/share/calibre/recipes
cd ${WRKSRC}/recipes && find . -type f -exec \
${INSTALL_DATA} {} ${PREFIX}/share/calibre/recipes/ \;
@ -94,5 +103,4 @@ post-install:
${MODPY_BIN} ${MODPY_LIBDIR}/compileall.py \
${PREFIX}/share/calibre
.include <bsd.port.mk>

View File

@ -1,2 +1,2 @@
SHA256 (calibre-0.8.20.tar.gz) = 9jSgZbteBulras+H4qpWe8cOZYZX/SoICxuw2LCgC5s=
SIZE (calibre-0.8.20.tar.gz) = 37329175
SHA256 (calibre-1.10.0.tar.xz) = LXwsVuir2g3e7bm5d9IwWZKngo1JJD/j5dsf0bEh0Jg=
SIZE (calibre-1.10.0.tar.xz) = 30531340

View File

@ -0,0 +1,13 @@
$OpenBSD: patch-setup___init___py,v 1.1 2013/11/09 15:02:14 sthen Exp $
--- setup/__init__.py.orig Fri Nov 8 03:44:31 2013
+++ setup/__init__.py Sat Nov 9 14:24:16 2013
@@ -13,7 +13,8 @@ iswindows = re.search('win(32|64)', sys.platform)
isosx = 'darwin' in sys.platform
isfreebsd = 'freebsd' in sys.platform
isnetbsd = 'netbsd' in sys.platform
-isbsd = isnetbsd or isfreebsd
+isopenbsd = 'openbsd' in sys.platform
+isbsd = isnetbsd or isfreebsd or isopenbsd
islinux = not isosx and not iswindows and not isbsd
SRC = os.path.abspath('src')
sys.path.insert(0, SRC)

View File

@ -1,12 +1,38 @@
$OpenBSD: patch-setup_build_environment_py,v 1.1.1.1 2011/04/17 18:39:21 phessler Exp $
--- setup/build_environment.py.orig Fri Jan 21 23:22:10 2011
+++ setup/build_environment.py Thu Jan 27 09:46:09 2011
@@ -170,7 +170,7 @@ else:
$OpenBSD: patch-setup_build_environment_py,v 1.2 2013/11/09 15:02:14 sthen Exp $
- find headers from /usr/local/include
- add a horrible hack to locate qt private headers unpacked using
the 'BUILD_DEPENDS=x11/qt4:patch' target
if updating patches, watch out for WRKDIR subst in last chunk.
--- setup/build_environment.py.orig Fri Nov 8 03:44:31 2013
+++ setup/build_environment.py Sat Nov 9 14:24:16 2013
@@ -7,11 +7,12 @@ __copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.n
__docformat__ = 'restructuredtext en'
fc_inc = os.environ.get('FC_INC_DIR', fc_inc)
fc_lib = os.environ.get('FC_LIB_DIR', fc_lib)
-fc_error = None if os.path.exists(os.path.join(fc_inc, 'fontconfig.h')) else \
+fc_error = None if os.path.exists(os.path.join(fc_inc, 'fontconfig/fontconfig.h')) else \
('fontconfig header files not found on your system. '
'Try setting the FC_INC_DIR and FC_LIB_DIR environment '
'variables.')
import os, socket, struct, subprocess, glob
+from distutils import sysconfig
from distutils.spawn import find_executable
from PyQt4 import pyqtconfig
-from setup import isosx, iswindows, islinux, is64bit
+from setup import isosx, iswindows, islinux, is64bit, isopenbsd
is64bit
OSX_SDK = '/Developer/SDKs/MacOSX10.5.sdk'
@@ -164,6 +165,12 @@ else:
ft_lib_dirs = pkgconfig_lib_dirs('freetype2', 'FT_LIB_DIR', '/usr/lib')
ft_libs = pkgconfig_libs('freetype2', '', '')
+if isopenbsd:
+ sw_inc_dir = os.path.join(sysconfig.PREFIX, 'include')
+ icu_inc_dirs = [sw_inc_dir]
+ chmlib_inc_dirs = [sw_inc_dir]
+ bq = glob.glob('${WRKDIR}/x11/qt4/qt-*/include')[-1]
+ qt_private_inc = ['%s/%s'%(bq, m) for m in ('QtGui', 'QtCore')]
magick_error = None
if not magick_inc_dirs or not os.path.exists(os.path.join(magick_inc_dirs[0],

View File

@ -1,23 +1,83 @@
$OpenBSD: patch-setup_extensions_py,v 1.2 2011/09/05 12:38:36 jasper Exp $
--- setup/extensions.py.orig Fri Jun 24 20:01:27 2011
+++ setup/extensions.py Tue Jun 28 23:45:46 2011
@@ -111,8 +111,8 @@ extensions = [
reflow_sources,
headers=reflow_headers,
libraries=poppler_libs+magick_libs+png_libs+ft_libs+jpg_libs+pdfreflow_libs,
- lib_dirs=poppler_lib_dirs+magick_lib_dirs+png_lib_dirs+ft_lib_dirs+jpg_lib_dirs,
- inc_dirs=poppler_inc_dirs+magick_inc_dirs+png_inc_dirs,
+ lib_dirs=poppler_lib_dirs+magick_lib_dirs+png_lib_dirs+ft_lib_dirs+jpg_lib_dirs+[fc_lib],
+ inc_dirs=poppler_inc_dirs+magick_inc_dirs+png_inc_dirs+[fc_inc],
error=reflow_error,
cflags=['-DPNG_SKIP_SETJMP_CHECK'] if islinux else []
),
@@ -191,7 +191,7 @@ if isunix:
cc = os.environ.get('CC', 'gcc')
cxx = os.environ.get('CXX', 'g++')
cflags = os.environ.get('OVERRIDE_CFLAGS',
- '-O3 -Wall -DNDEBUG -fno-strict-aliasing -pipe')
+ '-Wall -DNDEBUG -fno-strict-aliasing -pipe')
cflags = shlex.split(cflags) + ['-fPIC']
ldflags = os.environ.get('OVERRIDE_LDFLAGS', '-Wall')
ldflags = shlex.split(ldflags)
$OpenBSD: patch-setup_extensions_py,v 1.3 2013/11/09 15:02:14 sthen Exp $
- make podofo optional
- fix various header search paths
- don't override compiler optimizer levels
- build with libmtp/libusb1 on OpenBSD (possibly useless as it
may need /sys/ access to actually detect devices..)
if updating patches, watch out for X11BASE -> /usr/X11R6 in last chunk
--- setup/extensions.py.orig Fri Nov 8 03:44:31 2013
+++ setup/extensions.py Sat Nov 9 14:24:16 2013
@@ -12,7 +12,7 @@ from multiprocessing import cpu_count
from PyQt4.pyqtconfig import QtGuiModuleMakefile
-from setup import Command, islinux, isbsd, isosx, SRC, iswindows
+from setup import Command, islinux, isbsd, isosx, SRC, iswindows, isopenbsd
from setup.build_environment import (chmlib_inc_dirs,
podofo_inc, podofo_lib, podofo_error, pyqt, OSX_SDK, NMAKE, QMAKE,
msvc, MT, win_inc, win_lib, win_ddk, magick_inc_dirs, magick_lib_dirs,
@@ -47,13 +47,6 @@ class Extension(object):
self.ldflags = kwargs.get('ldflags', [])
self.optional = kwargs.get('optional', False)
self.needs_ddk = kwargs.get('needs_ddk', False)
- of = kwargs.get('optimize_level', None)
- if of is None:
- of = '/Ox' if iswindows else '-O3'
- else:
- flag = '/O%d' if iswindows else '-O%d'
- of = flag % of
- self.cflags.insert(0, of)
def preflight(self, obj_dir, compiler, linker, builder, cflags, ldflags):
pass
@@ -167,6 +160,7 @@ extensions = [
libraries=['podofo'],
lib_dirs=[podofo_lib],
inc_dirs=[podofo_inc, os.path.dirname(podofo_inc)],
+ optional=1,
error=podofo_error),
Extension('pictureflow',
@@ -247,9 +241,10 @@ if isosx:
ldflags=['-framework', 'CoreServices', '-framework', 'IOKit'])
)
-if islinux or isosx:
+if islinux or isosx or isopenbsd:
extensions.append(Extension('libusb',
['calibre/devices/libusb/libusb.c'],
+ inc_dirs=[os.path.join(sysconfig.PREFIX, 'include')],
libraries=['usb-1.0']
))
@@ -263,6 +258,7 @@ if islinux or isosx:
'calibre/devices/mtp/unix/upstream/music-players.h',
'calibre/devices/mtp/unix/upstream/device-flags.h',
],
+ inc_dirs=[os.path.join(sysconfig.PREFIX, 'include')],
libraries=['mtp']
))
@@ -289,9 +285,9 @@ if isbsd:
cflags.append('-pthread')
ldflags.append('-shared')
cflags.append('-I'+sysconfig.get_python_inc())
+ ldflags.append('-L'+os.path.join(sysconfig.PREFIX))
ldflags.append('-lpython'+sysconfig.get_python_version())
-
if isosx:
x, p = ('i386', 'x86_64')
archs = ['-arch', x, '-arch', p, '-isysroot',
@@ -498,7 +494,7 @@ class Build(Command):
DESTDIR = .
TARGET = calibre
QT *= svg
- INCLUDEPATH *= {conf} {inc}
+ INCLUDEPATH *= "/usr/X11R6/include" {conf} {inc}
win32-msvc*:DEFINES *= _CRT_SECURE_NO_WARNINGS
# Force C++ language

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-setup_install_py,v 1.1.1.1 2011/04/17 18:39:21 phessler Exp $
--- setup/install.py.orig Thu Jan 27 09:50:17 2011
+++ setup/install.py Thu Jan 27 09:50:20 2011
@@ -269,7 +269,7 @@ class Install(Develop):
$OpenBSD: patch-setup_install_py,v 1.2 2013/11/09 15:02:14 sthen Exp $
--- setup/install.py.orig Fri Nov 8 03:44:31 2013
+++ setup/install.py Sat Nov 9 14:24:16 2013
@@ -243,7 +243,7 @@ class Install(Develop):
reldir = os.path.relpath(x[0], self.SRC)
destdir = os.path.join(dest, reldir)
for f in x[-1]:

View File

@ -1,16 +1,16 @@
$OpenBSD: patch-src_calibre_constants_py,v 1.1 2011/09/05 12:38:36 jasper Exp $
$OpenBSD: patch-src_calibre_constants_py,v 1.2 2013/11/09 15:02:14 sthen Exp $
Add OpenBSD to list of recognized BSDs
--- src/calibre/constants.py.orig Sun Jul 17 14:31:23 2011
+++ src/calibre/constants.py Sun Jul 17 14:31:53 2011
@@ -28,7 +28,8 @@ isosx = 'darwin' in _plat
isnewosx = isosx and getattr(sys, 'new_app_bundle', False)
--- src/calibre/constants.py.orig Fri Nov 8 03:44:31 2013
+++ src/calibre/constants.py Fri Nov 8 12:12:00 2013
@@ -21,7 +21,8 @@ isnewosx = isosx and getattr(sys, 'new_app_bundle', F
isfreebsd = 'freebsd' in _plat
isnetbsd = 'netbsd' in _plat
-isbsd = isfreebsd or isnetbsd
isdragonflybsd = 'dragonfly' in _plat
-isbsd = isfreebsd or isnetbsd or isdragonflybsd
+isopenbsd = 'openbsd' in _plat
+isbsd = isfreebsd or isnetbsd or isopenbsd
+isbsd = isfreebsd or isnetbsd or isdragonflybsd or isopenbsd
islinux = not(iswindows or isosx or isbsd)
isfrozen = hasattr(sys, 'frozen')
isunix = isosx or islinux

View File

@ -1,32 +0,0 @@
$OpenBSD: patch-src_calibre_devices_scanner_py,v 1.2 2011/09/05 12:38:36 jasper Exp $
--- src/calibre/devices/scanner.py.orig Fri Jun 24 20:01:27 2011
+++ src/calibre/devices/scanner.py Tue Jun 28 23:45:46 2011
@@ -10,6 +10,8 @@ from threading import RLock
from calibre.constants import iswindows, isosx, plugins, islinux
+isopenbsd = 'openbsd' in sys.platform.lower()
+
osx_scanner = win_scanner = linux_scanner = None
if iswindows:
@@ -160,12 +162,18 @@ linux_scanner = None
if islinux:
linux_scanner = LinuxScanner()
+openbsd_scanner = None
+
+''' OpenBSD support currently not written yet '''
+if isopenbsd:
+ openbsd_scanner = None
+
class DeviceScanner(object):
def __init__(self, *args):
if isosx and osx_scanner is None:
raise RuntimeError('The Python extension usbobserver must be available on OS X.')
- self.scanner = win_scanner if iswindows else osx_scanner if isosx else linux_scanner
+ self.scanner = win_scanner if iswindows else osx_scanner if isosx else openbsd_scanner if isopenbsd else linux_scanner
self.devices = []
def scan(self):

View File

@ -1,16 +0,0 @@
$OpenBSD: patch-src_calibre_ebooks_pdf_images_cpp,v 1.3 2011/11/26 19:50:08 kili Exp $
OCTStream::getRawStream deleted in poppler-0.18; Stream::getNextStream()
does the same according to the poppler documentation.
--- src/calibre/ebooks/pdf/images.cpp.orig Fri Sep 23 19:14:20 2011
+++ src/calibre/ebooks/pdf/images.cpp Thu Nov 17 16:12:13 2011
@@ -126,7 +126,7 @@ void XMLImages::add(GfxState *state, Object *ref, Stre
if (img->type == jpeg) {
int c;
- str = ((DCTStream *)str)->getRawStream();
+ str = str->getNextStream();
str->reset();
// copy the stream

View File

@ -1,14 +0,0 @@
$OpenBSD: patch-src_calibre_ebooks_pdf_images_h,v 1.1 2011/07/08 20:38:00 naddy Exp $
Fix build with png-1.5.
--- src/calibre/ebooks/pdf/images.h.orig Wed Jul 6 18:40:34 2011
+++ src/calibre/ebooks/pdf/images.h Wed Jul 6 18:40:45 2011
@@ -11,6 +11,7 @@
#include <GfxState.h>
#include <splash/SplashBitmap.h>
#include <png.h>
+#include <zlib.h>
#include <jpeglib.h>
#include "utils.h"

View File

@ -1,41 +0,0 @@
$OpenBSD: patch-src_calibre_ebooks_pdf_reflow_cpp,v 1.3 2013/08/15 18:42:03 kili Exp $
--- src/calibre/ebooks/pdf/reflow.cpp.orig Fri Sep 23 19:14:20 2011
+++ src/calibre/ebooks/pdf/reflow.cpp Wed Aug 7 20:20:35 2013
@@ -625,7 +625,7 @@ static string get_link_dest(LinkAction *link, PDFDoc *
return oss.str();
}
-void XMLOutputDev::process_link(Link* link){
+void XMLOutputDev::process_link(AnnotLink* link){
double _x1, _y1, _x2, _y2;
int x1, y1, x2, y2;
@@ -646,7 +646,7 @@ void XMLOutputDev::process_link(Link* link){
void XMLOutputDev::endPage() {
- Links *slinks = catalog->getPage(current_page->number())->getLinks(catalog);
+ Links *slinks = catalog->getPage(current_page->number())->getLinks();
for (int i = 0; i < slinks->getNumLinks(); i++)
{
this->process_link(slinks->getLink(i));
@@ -877,8 +877,8 @@ vector<char>* Reflow::render_first_page(bool use_crop_
throw ReflowException("Failed to allocate SplashOutputDev");
}
try {
- out->startDoc(doc->getXRef());
- out->startPage(1, NULL);
+ out->startDoc(doc);
+ out->startPage(1, NULL, doc->getXRef());
double pg_w, pg_h;
int pg = 1;
@@ -921,7 +921,7 @@ class MemOutStream : public OutStream {
MemOutStream() :OutStream() {}
~MemOutStream() {}
void close() {}
- int getPos() { return out.tellp(); }
+ Goffset getPos() { return out.tellp(); }
void put(char c) { out.put(c); }
void printf (const char *format, ...) {
vector<char> buf;

View File

@ -1,16 +0,0 @@
$OpenBSD: patch-src_calibre_ebooks_pdf_reflow_h,v 1.1 2011/11/26 19:50:08 kili Exp $
With poppler-0.18, the classes Link and AnnotLink had been merged
into AnnotLink. The latter should now contain all functionality of
the former.
--- src/calibre/ebooks/pdf/reflow.h.orig Fri Sep 23 19:14:20 2011
+++ src/calibre/ebooks/pdf/reflow.h Thu Nov 17 16:33:49 2011
@@ -244,6 +244,6 @@ class XMLOutputDev : public OutputDev {
XMLImages *images;
PDFDoc *doc;
- void process_link(Link* link);
+ void process_link(AnnotLink* link);
};
}

View File

@ -1,12 +1,22 @@
$OpenBSD: patch-src_calibre_linux_py,v 1.1 2011/09/05 12:38:36 jasper Exp $
$OpenBSD: patch-src_calibre_linux_py,v 1.2 2013/11/09 15:02:14 sthen Exp $
Lifted from ArchLinux, saves mime and desktop files on disk
instead of trying to add them directly.
Saves mime and desktop files on disk instead of trying to add them directly.
Adapted from archlinux patch:
https://projects.archlinux.org/svntogit/community.git/tree/trunk?h=packages/calibre
--- src/calibre/linux.py.orig Sun Jul 17 13:26:34 2011
+++ src/calibre/linux.py Sun Jul 17 13:37:59 2011
@@ -140,19 +140,7 @@ class PostInstall:
self.install_man_pages()
--- src/calibre/linux.py.orig Fri Nov 8 03:44:31 2013
+++ src/calibre/linux.py Sat Nov 9 14:27:11 2013
@@ -8,7 +8,7 @@ from subprocess import check_call
from functools import partial
from calibre import __appname__, prints, guess_type
-from calibre.constants import islinux, isnetbsd, isbsd
+from calibre.constants import islinux, isnetbsd, isopenbsd, isbsd
from calibre.customize.ui import all_input_formats
from calibre.ptempfile import TemporaryDirectory
from calibre import CurrentDir
@@ -450,19 +450,7 @@ class PostInstall:
self.setup_completion()
if islinux or isbsd:
self.setup_desktop_integration()
- self.create_uninstaller()
@ -25,82 +35,101 @@ instead of trying to add them directly.
if warn is None and self.warnings:
self.info('There were %d warnings'%len(self.warnings))
for args, kwargs in self.warnings:
@@ -321,7 +309,7 @@ class PostInstall:
if isbsd:
manfile = os.path.join(manpath, prog+'.1')
@@ -507,7 +495,7 @@ class PostInstall:
if os.path.exists(bc):
f = os.path.join(bc, 'calibre')
else:
- if isnetbsd:
+ if isnetbsd or isopenbsd:
f = os.path.join(self.opts.staging_root, 'share/bash_completion.d/calibre')
else:
- manfile = os.path.join(manpath, prog+'.1'+__appname__+'.bz2')
+ manfile = os.path.join(manpath, prog+'.1'+'.bz2')
self.info('\tInstalling MAN page for', prog)
open(manfile, 'wb').write(raw)
self.manifest.append(manfile)
@@ -339,51 +327,39 @@ class PostInstall:
f = os.path.join(self.opts.staging_etc, 'bash_completion.d/calibre')
@@ -651,65 +639,44 @@ class PostInstall:
env['LD_LIBRARY_PATH'] = os.pathsep.join(npaths)
cc = partial(check_call, env=env)
with TemporaryDirectory() as tdir:
with CurrentDir(tdir):
- render_img('mimetypes/lrf.png', 'calibre-lrf.png')
- check_call('xdg-icon-resource install --noupdate --context mimetypes --size 128 calibre-lrf.png application-lrf', shell=True)
- self.icon_resources.append(('mimetypes', 'application-lrf', '128'))
- check_call('xdg-icon-resource install --noupdate --context mimetypes --size 128 calibre-lrf.png text-lrs', shell=True)
- self.icon_resources.append(('mimetypes', 'application-lrs',
- '128'))
- render_img('lt.png', 'calibre-gui.png')
- check_call('xdg-icon-resource install --noupdate --size 128 calibre-gui.png calibre-gui', shell=True)
- self.icon_resources.append(('apps', 'calibre-gui', '128'))
- render_img('viewer.png', 'calibre-viewer.png')
- check_call('xdg-icon-resource install --size 128 calibre-viewer.png calibre-viewer', shell=True)
- self.icon_resources.append(('apps', 'calibre-viewer', '128'))
+ dir = os.path.join(self.opts.staging_sharedir,'../pixmaps')
+ os.mkdir(dir)
+ render_img('mimetypes/lrf.png', os.path.join(dir,'calibre-lrf.png'))
+ render_img('lt.png', os.path.join(dir, 'calibre-gui.png'))
+ render_img('viewer.png', os.path.join(dir, 'calibre-viewer.png'))
- with TemporaryDirectory() as tdir, CurrentDir(tdir), \
- PreserveMIMEDefaults():
- render_img('mimetypes/lrf.png', 'calibre-lrf.png')
- cc('xdg-icon-resource install --noupdate --context mimetypes --size 128 calibre-lrf.png application-lrf', shell=True)
- self.icon_resources.append(('mimetypes', 'application-lrf', '128'))
- cc('xdg-icon-resource install --noupdate --context mimetypes --size 128 calibre-lrf.png text-lrs', shell=True)
- self.icon_resources.append(('mimetypes', 'application-lrs',
- '128'))
- render_img('mimetypes/mobi.png', 'calibre-mobi.png')
- cc('xdg-icon-resource install --noupdate --context mimetypes --size 128 calibre-mobi.png application-x-mobipocket-ebook', shell=True)
- self.icon_resources.append(('mimetypes', 'application-x-mobipocket-ebook', '128'))
- render_img('mimetypes/tpz.png', 'calibre-tpz.png')
- cc('xdg-icon-resource install --noupdate --context mimetypes --size 128 calibre-tpz.png application-x-topaz-ebook', shell=True)
- self.icon_resources.append(('mimetypes', 'application-x-topaz-ebook', '128'))
- render_img('mimetypes/azw2.png', 'calibre-azw2.png')
- cc('xdg-icon-resource install --noupdate --context mimetypes --size 128 calibre-azw2.png application-x-kindle-application', shell=True)
- self.icon_resources.append(('mimetypes', 'application-x-kindle-application', '128'))
- render_img('mimetypes/azw3.png', 'calibre-azw3.png')
- cc('xdg-icon-resource install --noupdate --context mimetypes --size 128 calibre-azw3.png application-x-mobi8-ebook', shell=True)
- self.icon_resources.append(('mimetypes', 'application-x-mobi8-ebook', '128'))
- render_img('lt.png', 'calibre-gui.png', width=256, height=256)
- cc('xdg-icon-resource install --noupdate --size 256 calibre-gui.png calibre-gui', shell=True)
- self.icon_resources.append(('apps', 'calibre-gui', '128'))
- render_img('viewer.png', 'calibre-viewer.png')
- cc('xdg-icon-resource install --size 128 calibre-viewer.png calibre-viewer', shell=True)
- self.icon_resources.append(('apps', 'calibre-viewer', '128'))
+ with TemporaryDirectory() as tdir, CurrentDir(tdir):
+ dir = os.path.join(self.opts.staging_sharedir,'../pixmaps')
+ os.mkdir(dir)
+ render_img('mimetypes/lrf.png', os.path.join(dir,'calibre-lrf.png'))
+ render_img('mimetypes/mobi.png', os.path.join(dir,'calibre-mobi.png')) # application-x-mobipocket-ebook
+ render_img('mimetypes/tpz.png', os.path.join(dir,'calibre-tpz.png')) # application-x-topaz-ebook
+ render_img('mimetypes/azw2.png', os.path.join(dir,'calibre-azw2.png')) # application-x-kindle-application
+ render_img('mimetypes/azw3.png', os.path.join(dir,'calibre-azw3.png')) # application-x-mobi8-ebook
+ render_img('lt.png', os.path.join(dir, 'calibre-gui.png'))
+ render_img('viewer.png', os.path.join(dir, 'calibre-viewer.png'))
mimetypes = set([])
for x in all_input_formats():
mt = guess_type('dummy.'+x)[0]
- if mt and 'chemical' not in mt and 'ctc-posml' not in mt:
+ if mt and 'chemical' not in mt and 'text' not in mt and 'pdf' not in mt and 'xhtml' not in mt:
mimetypes.add(mt)
mimetypes = set([])
for x in all_input_formats():
mt = guess_type('dummy.'+x)[0]
- if mt and 'chemical' not in mt and 'ctc-posml' not in mt:
+ if mt and 'chemical' not in mt and 'ctc-posml' not in mt and 'text' not in mt and 'pdf' not in mt and 'xhtml' not in mt:
mimetypes.add(mt)
def write_mimetypes(f):
f.write('MimeType=%s;\n'%';'.join(mimetypes))
def write_mimetypes(f):
f.write('MimeType=%s;\n'%';'.join(mimetypes))
- f = open('calibre-lrfviewer.desktop', 'wb')
+ dir = os.path.join(self.opts.staging_sharedir,'../applications')
+ os.mkdir(dir)
+ f = open(os.path.join(dir, 'calibre-lrfviewer.desktop'), 'wb')
f.write(VIEWER)
f.close()
- f = open('calibre-ebook-viewer.desktop', 'wb')
+ f = open(os.path.join(dir, 'calibre-ebook-viewer.desktop'), 'wb')
f.write(EVIEWER)
write_mimetypes(f)
f.close()
- f = open('calibre-gui.desktop', 'wb')
+ f = open(os.path.join(dir, 'calibre-gui.desktop'), 'wb')
f.write(GUI)
write_mimetypes(f)
f.close()
- des = ('calibre-gui.desktop', 'calibre-lrfviewer.desktop',
- 'calibre-ebook-viewer.desktop')
- for x in des:
- cmd = ['xdg-desktop-menu', 'install', '--noupdate', './'+x]
- check_call(' '.join(cmd), shell=True)
- self.menu_resources.append(x)
- check_call(['xdg-desktop-menu', 'forceupdate'])
- f = open('calibre-mimetypes', 'wb')
+ dir = os.path.join(self.opts.staging_sharedir,'../mime/packages/')
+ os.makedirs(dir)
+ f = open(os.path.join(dir, 'calibre.xml'), 'wb')
f.write(MIME)
f.close()
- self.mime_resources.append('calibre-mimetypes')
- check_call('xdg-mime install ./calibre-mimetypes', shell=True)
- f = open('calibre-lrfviewer.desktop', 'wb')
+ dir = os.path.join(self.opts.staging_sharedir,'../applications')
+ os.mkdir(dir)
+ f = open(os.path.join(dir, 'calibre-lrfviewer.desktop'), 'wb')
f.write(VIEWER)
f.close()
- f = open('calibre-ebook-viewer.desktop', 'wb')
+ f = open(os.path.join(dir, 'calibre-ebook-viewer.desktop'), 'wb')
f.write(EVIEWER)
write_mimetypes(f)
f.close()
- f = open('calibre-gui.desktop', 'wb')
+ f = open(os.path.join(dir, 'calibre-gui.desktop'), 'wb')
f.write(GUI)
write_mimetypes(f)
f.close()
- des = ('calibre-gui.desktop', 'calibre-lrfviewer.desktop',
- 'calibre-ebook-viewer.desktop')
- for x in des:
- cmd = ['xdg-desktop-menu', 'install', '--noupdate', './'+x]
- cc(' '.join(cmd), shell=True)
- self.menu_resources.append(x)
- cc(['xdg-desktop-menu', 'forceupdate'])
- f = open('calibre-mimetypes.xml', 'wb')
+ dir = os.path.join(self.opts.staging_sharedir,'../mime/packages/')
+ os.makedirs(dir)
+ f = open(os.path.join(dir, 'calibre.xml'), 'wb')
f.write(MIME)
f.close()
- self.mime_resources.append('calibre-mimetypes.xml')
- cc('xdg-mime install ./calibre-mimetypes.xml', shell=True)
except Exception:
if self.opts.fatal_errors:
raise
@@ -521,7 +497,7 @@ GUI = '''\
@@ -857,7 +824,7 @@ GUI = '''\
[Desktop Entry]
Version=1.0
Type=Application

View File

@ -1,12 +0,0 @@
$OpenBSD: patch-src_calibre_utils_fonts_fontconfig_c,v 1.1.1.1 2011/04/17 18:39:21 phessler Exp $
--- src/calibre/utils/fonts/fontconfig.c.orig Sat Jan 15 21:10:37 2011
+++ src/calibre/utils/fonts/fontconfig.c Sat Jan 15 21:10:47 2011
@@ -14,7 +14,7 @@
#include <Python.h>
#include <stdio.h>
#include <string.h>
-#include <fontconfig.h>
+#include <fontconfig/fontconfig.h>
static PyObject *
fontconfig_initialize(PyObject *self, PyObject *args) {

File diff suppressed because it is too large Load Diff