Calibre: new recipe (#4657)

* Calibre: new recipe

* Build fix

* Untested on x86
This commit is contained in:
miqlas
2020-02-02 20:02:42 +01:00
committed by GitHub
parent 6e78faf3b3
commit ae8de65367
3 changed files with 355 additions and 0 deletions

View File

@@ -0,0 +1,242 @@
SUMMARY="Ebook management application"
DESCRIPTION="Calibre is an e-book manager. It can view, convert, edit and \
catalog e-books in all of the major e-book formats. It can also talk to \
e-book reader devices. It can go out to the internet and fetch metadata for \
your books. It can download newspapers and convert them into e-books for \
convenient reading. It is cross platform, running on Linux, Windows and macOS."
HOMEPAGE="https://calibre-ebook.com/"
COPYRIGHT="2008-2019 Kovid Goyal"
LICENSE="GNU GPL v3"
REVISION="1"
SOURCE_URI="https://github.com/kovidgoyal/calibre/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="50855a25f7e219de81e19d2e5df462e1068b84c11556936aee372eb7f1950419"
PATCHES="calibre-$portVersion.patchset"
ADDITIONAL_FILES="calibre.rdef.in"
ARCHITECTURES="?x86_gcc2 ?x86 x86_64"
SECONDARY_ARCHITECTURES="?x86"
# On x86_gcc2 we don't want to install the commands in bin/<arch>/, but in bin/.
commandSuffix=$secondaryArchSuffix
commandBinDir=$binDir
if [ "$targetArchitecture" = x86_gcc2 ]; then
commandSuffix=
commandBinDir=$prefix/bin
fi
PROVIDES="
calibre$secondaryArchSuffix = $portVersion
cmd:calibre_complete$commandSuffix
cmd:calibre_customize$commandSuffix
cmd:calibre_debug$commandSuffix
cmd:calibre_parallel$commandSuffix
cmd:calibre_server$commandSuffix
cmd:calibre_smtp$commandSuffix
cmd:calibre_uninstall$commandSuffix
cmd:calibre$commandSuffix
cmd:calibredb$commandSuffix
cmd:ebook_convert$commandSuffix
cmd:ebook_device$commandSuffix
cmd:ebook_edit$commandSuffix
cmd:ebook_meta$commandSuffix
cmd:ebook_polish$commandSuffix
cmd:ebook_viewer$commandSuffix
cmd:fetch_ebook_metadata$commandSuffix
cmd:lrf2lrs$commandSuffix
cmd:lrfviewer$commandSuffix
cmd:lrs2lrf$commandSuffix
cmd:markdown_calibre$commandSuffix
cmd:web2disk$commandSuffix
"
REQUIRES="
haiku$secondaryArchSuffix
cmd:python2
apsw_python
beautifulsoup_python
chardet_python
css_parser_python
dateutil_python
# dbuspython_python
dnspython_python
dukpy_python
feedparser_python
html2text_python
html5_parser_python
html5lib_python
lxml_python
markdown_python
mechanize_python
msgpack_python
# netifaces_python
pillow_python
# psutil_python
pycrypto_python
pygments_python
pyqt_python
regex_python
setuptools_python
sip_python
sip_pyqt_python
six_python
soupsieve_python
unrardll_python
webencodings_python
# lib:libdbus_1$secondaryArchSuffix
# lib:libdbus_glib_1$secondaryArchSuffix
# lib:libeasylzma$secondaryArchSuffix
lib:libexpat$secondaryArchSuffix
lib:libffi$secondaryArchSuffix
lib:libfontconfig$secondaryArchSuffix
lib:libfreetype$secondaryArchSuffix
lib:libgcrypt$secondaryArchSuffix
lib:libglib_2.0$secondaryArchSuffix
lib:libgpg_error$secondaryArchSuffix
lib:libiconv$secondaryArchSuffix
lib:libicui18n$secondaryArchSuffix
lib:libjpeg$secondaryArchSuffix
# lib:libjxrlib$secondaryArchSuffix
# lib:libmozjpeg$secondaryArchSuffix
lib:libmtp$secondaryArchSuffix
lib:libncursesw$secondaryArchSuffix
lib:libpng16$secondaryArchSuffix
lib:libpodofo$secondaryArchSuffix
lib:libpoppler${secondaryArchSuffix}_qt5
lib:libpoppler$secondaryArchSuffix
lib:libQt5Core$secondaryArchSuffix
lib:libQt5WebKit$secondaryArchSuffix
lib:libreadline$secondaryArchSuffix
lib:libsqlite3$secondaryArchSuffix
lib:libssl$secondaryArchSuffix
lib:libusb_1.0$secondaryArchSuffix
lib:libwebp$secondaryArchSuffix
lib:libxml2$secondaryArchSuffix
lib:libxslt$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
apsw_python
beautifulsoup_python
chardet_python
css_parser_python
dateutil_python
# dbuspython_python
dnspython_python
dukpy_python
feedparser_python
html2text_python
html5_parser_python
html5lib_python
lxml_python
markdown_python
mechanize_python
msgpack_python
# netifaces_python
pillow_python
# psutil_python
pycrypto_python
pygments_python
pyqt_python
regex_python
setuptools_python
sip_python
sip_pyqt_python
six_python
soupsieve_python
unrardll_python
webencodings_python
devel:libchm$secondaryArchSuffix
# devel:libdbus_1$secondaryArchSuffix
# devel:libdbus_glib_1$secondaryArchSuffix
# devel:libeasylzma$secondaryArchSuffix
devel:libexpat$secondaryArchSuffix
devel:libffi$secondaryArchSuffix
devel:libfontconfig$secondaryArchSuffix
devel:libfreetype$secondaryArchSuffix
devel:libgcrypt$secondaryArchSuffix
devel:libglib_2.0$secondaryArchSuffix
devel:libgpg_error$secondaryArchSuffix
devel:libiconv$secondaryArchSuffix
devel:libicui18n$secondaryArchSuffix
devel:libjpeg$secondaryArchSuffix
# devel:libjxrlib$secondaryArchSuffix
# devel:libmozjpeg$secondaryArchSuffix
devel:libmtp$secondaryArchSuffix
devel:libncursesw$secondaryArchSuffix
devel:libpng16$secondaryArchSuffix
devel:libpodofo$secondaryArchSuffix
devel:libpoppler${secondaryArchSuffix}_qt5
devel:libpoppler$secondaryArchSuffix
devel:libQt5Core$secondaryArchSuffix
devel:libQt5WebKit$secondaryArchSuffix
devel:libreadline$secondaryArchSuffix
devel:libsqlite3$secondaryArchSuffix
devel:libssl$secondaryArchSuffix
devel:libusb_1.0$secondaryArchSuffix
devel:libwebp$secondaryArchSuffix
devel:libxml2$secondaryArchSuffix
devel:libxslt$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:bzip2
cmd:cmake
cmd:gcc$secondaryArchSuffix
cmd:make
cmd:nasm
cmd:optipng
cmd:pkg_config$secondaryArchSuffix
cmd:python2 # Currently only Python2 supported by Calibre
cmd:python2_pyrcc5$secondaryArchSuffix #pyqt
cmd:sip
cmd:unrar
"
BUILD()
{
# For current REQUIMENTS check:
# https://github.com/kovidgoyal/build-calibre/blob/master/scripts/sources.json
export SIP_DIR=`finddir B_SYSTEM_DATA_DIRECTORY`
export PODOFO_INC_DIR=`finddir B_SYSTEM_HEADERS_DIRECTORY`/podofo
python setup.py build
python setup.py iso639
python setup.py iso3166
python setup.py resources || true # Something fishy here.
}
INSTALL()
{
export SIP_DIR=`finddir B_SYSTEM_DATA_DIRECTORY`
export PODOFO_INC_DIR=`finddir B_SYSTEM_HEADERS_DIRECTORY`/podofo
python2 setup.py install \
--prefix=$appsDir/Calibre
# Preparing the attributes
local MAJOR="`echo "$portVersion" | cut -d. -f1`"
local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
local MINOR="`echo "$portVersion" | cut -d. -f3`"
sed \
-e "s|@MAJOR@|$MAJOR|" \
-e "s|@MIDDLE@|$MIDDLE|" \
-e "s|@MINOR@|$MINOR|" \
$portDir/additional-files/calibre.rdef.in \
> calibre.rdef
# Installing extra-attribs
rc calibre.rdef
resattr -o $appsDir/Calibre/bin/calibre calibre.rsrc
addAppDeskbarSymlink $appsDir/Calibre/bin/calibre "Calibre"
}
TEST()
{
export SIP_DIR=`finddir B_SYSTEM_DATA_DIRECTORY`
export PODOFO_INC_DIR=`finddir B_SYSTEM_HEADERS_DIRECTORY`/podofo
python2 setup.py test
}