2016-10-07 17:41:59 +03:00
|
|
|
NAME = books
|
|
|
|
|
|
|
|
openrepos {
|
|
|
|
PREFIX = openrepos
|
|
|
|
DEFINES += OPENREPOS
|
|
|
|
} else {
|
|
|
|
PREFIX = harbour
|
|
|
|
}
|
|
|
|
|
|
|
|
TARGET = $${PREFIX}-$${NAME}
|
2015-06-28 14:22:35 +03:00
|
|
|
CONFIG += sailfishapp link_pkgconfig
|
2015-06-28 22:28:54 +03:00
|
|
|
PKGCONFIG += sailfishapp mlite5 glib-2.0
|
2016-10-07 17:41:59 +03:00
|
|
|
|
|
|
|
app_settings {
|
|
|
|
# This path is hardcoded in jolla-settings
|
|
|
|
TRANSLATIONS_PATH = /usr/share/translations
|
|
|
|
} else {
|
|
|
|
TRANSLATIONS_PATH = /usr/share/$${TARGET}/translations
|
|
|
|
}
|
2015-06-28 14:22:35 +03:00
|
|
|
|
|
|
|
!include(../common.pri)
|
|
|
|
|
|
|
|
CONFIG(debug, debug|release) {
|
|
|
|
DEFINES += HARBOUR_DEBUG=1
|
|
|
|
}
|
|
|
|
|
|
|
|
# Directories
|
|
|
|
FBREADER_DIR = $$_PRO_FILE_PWD_/../fbreader
|
|
|
|
FRIBIDI_DIR = $$_PRO_FILE_PWD_/../fribidi
|
|
|
|
LINEBREAK_DIR = $$_PRO_FILE_PWD_/../linebreak
|
|
|
|
HARBOUR_LIB_DIR = $$_PRO_FILE_PWD_/../harbour-lib
|
|
|
|
|
2019-03-31 03:38:26 +03:00
|
|
|
HARBOUR_INCLUDE_DIR = $$HARBOUR_LIB_DIR/include
|
|
|
|
HARBOUR_SRC_DIR = $$HARBOUR_LIB_DIR/src
|
2019-04-01 02:06:55 +03:00
|
|
|
HARBOUR_LIB_QML = $$HARBOUR_LIB_DIR/qml
|
2019-03-31 03:38:26 +03:00
|
|
|
|
2015-06-28 14:22:35 +03:00
|
|
|
# Libraries
|
|
|
|
FBREADER_LIB = $$OUT_PWD/../fbreader/libfbreader.a
|
|
|
|
FRIBIDI_LIB = $$OUT_PWD/../fribidi/libfribidi.a
|
|
|
|
LINEBREAK_LIB = $$OUT_PWD/../linebreak/liblinebreak.a
|
|
|
|
|
|
|
|
PRE_TARGETDEPS += \
|
|
|
|
$$FBREADER_LIB \
|
|
|
|
$$FRIBIDI_LIB \
|
2019-03-31 03:38:26 +03:00
|
|
|
$$LINEBREAK_LIB
|
2015-06-28 14:22:35 +03:00
|
|
|
LIBS += \
|
|
|
|
$$FBREADER_LIB \
|
|
|
|
$$FRIBIDI_LIB \
|
|
|
|
$$LINEBREAK_LIB \
|
|
|
|
-lbz2 -lz -ldl
|
|
|
|
|
|
|
|
OTHER_FILES += \
|
2015-10-21 13:31:48 +03:00
|
|
|
icons/harbour-books.svg \
|
2015-06-28 14:22:35 +03:00
|
|
|
harbour-books.desktop \
|
|
|
|
qml/*.qml \
|
|
|
|
qml/images/* \
|
2016-10-07 17:41:59 +03:00
|
|
|
settings/*.qml \
|
2018-04-27 00:33:26 +03:00
|
|
|
settings/*.json \
|
2015-06-28 14:22:35 +03:00
|
|
|
data/default/* \
|
|
|
|
data/zlibrary/core/encodings/* \
|
2018-05-21 17:26:37 +03:00
|
|
|
data/zlibrary/core/resources/*
|
2015-06-28 14:22:35 +03:00
|
|
|
|
2018-04-27 00:33:26 +03:00
|
|
|
TARGET_DATA_DIR = /usr/share/$$TARGET
|
2015-06-28 14:22:35 +03:00
|
|
|
TARGET_DEFAULT_DATA_DIR = $$TARGET_DATA_DIR/data
|
|
|
|
TARGET_ZLIBRARY_DATA_DIR = $$TARGET_DEFAULT_DATA_DIR
|
2015-10-21 13:31:48 +03:00
|
|
|
TARGET_ICON_ROOT = /usr/share/icons/hicolor
|
2015-06-28 14:22:35 +03:00
|
|
|
|
|
|
|
core_data.files = \
|
|
|
|
data/zlibrary/core/*.gz \
|
|
|
|
data/zlibrary/core/*.zip \
|
|
|
|
data/zlibrary/core/encodings \
|
|
|
|
data/zlibrary/core/resources
|
|
|
|
core_data.path = $$TARGET_ZLIBRARY_DATA_DIR
|
|
|
|
INSTALLS += core_data
|
|
|
|
|
|
|
|
text_data.files = data/zlibrary/text/*.zip
|
|
|
|
text_data.path = $$TARGET_ZLIBRARY_DATA_DIR
|
|
|
|
INSTALLS += text_data
|
|
|
|
|
|
|
|
defaults.files = data/default/*
|
|
|
|
defaults.path = $$TARGET_ZLIBRARY_DATA_DIR
|
|
|
|
INSTALLS += defaults
|
|
|
|
|
|
|
|
formats.files = data/formats/*
|
|
|
|
formats.path = $$TARGET_DEFAULT_DATA_DIR/formats
|
|
|
|
INSTALLS += formats
|
|
|
|
|
2019-04-01 03:31:55 +03:00
|
|
|
samples.files = data/samples/*
|
|
|
|
samples.path = $$TARGET_DEFAULT_DATA_DIR/samples
|
|
|
|
INSTALLS += samples
|
|
|
|
|
2015-06-28 14:22:35 +03:00
|
|
|
INCLUDEPATH += \
|
|
|
|
src \
|
2019-03-31 03:38:26 +03:00
|
|
|
$$HARBOUR_INCLUDE_DIR \
|
2015-06-28 14:22:35 +03:00
|
|
|
$$FBREADER_DIR/fbreader/fbreader/src \
|
|
|
|
$$FBREADER_DIR/fbreader/zlibrary/text/include \
|
|
|
|
$$FBREADER_DIR/fbreader/zlibrary/core/include \
|
|
|
|
$$FBREADER_DIR/fbreader/zlibrary/core/src/view \
|
|
|
|
$$FBREADER_DIR/fbreader/zlibrary/core/src/dialogs \
|
|
|
|
$$FBREADER_DIR/fbreader/zlibrary/core/src/application \
|
|
|
|
$$FBREADER_DIR/fbreader/zlibrary/core/src/options \
|
|
|
|
$$FBREADER_DIR/fbreader/zlibrary/core/src/unix \
|
|
|
|
$$FBREADER_DIR/fbreader/zlibrary/ui/src/qt4
|
|
|
|
|
|
|
|
SOURCES += \
|
|
|
|
src/BooksBook.cpp \
|
|
|
|
src/BooksBookModel.cpp \
|
|
|
|
src/BooksConfig.cpp \
|
|
|
|
src/BooksCoverModel.cpp \
|
|
|
|
src/BooksCoverWidget.cpp \
|
|
|
|
src/BooksDialogManager.cpp \
|
2017-12-03 04:19:17 +03:00
|
|
|
src/BooksFeedback.cpp \
|
2015-07-12 17:11:55 +03:00
|
|
|
src/BooksHints.cpp \
|
2016-10-08 19:57:54 +03:00
|
|
|
src/BooksImageProvider.cpp \
|
2015-06-28 14:22:35 +03:00
|
|
|
src/BooksImportModel.cpp \
|
|
|
|
src/BooksListWatcher.cpp \
|
|
|
|
src/BooksLoadingProperty.cpp \
|
2017-08-08 16:09:01 +03:00
|
|
|
src/BooksMediaPlugin.cpp \
|
2017-08-03 18:48:17 +03:00
|
|
|
src/BooksPageStack.cpp \
|
2015-06-28 14:22:35 +03:00
|
|
|
src/BooksPageWidget.cpp \
|
|
|
|
src/BooksPaintContext.cpp \
|
2015-11-08 14:20:25 +03:00
|
|
|
src/BooksPathModel.cpp \
|
2017-08-08 16:09:01 +03:00
|
|
|
src/BooksPolicyPlugin.cpp \
|
2018-01-27 03:03:08 +03:00
|
|
|
src/BooksPos.cpp \
|
2015-06-28 14:22:35 +03:00
|
|
|
src/BooksSaveTimer.cpp \
|
|
|
|
src/BooksSettings.cpp \
|
|
|
|
src/BooksShelf.cpp \
|
|
|
|
src/BooksStorage.cpp \
|
|
|
|
src/BooksStorageModel.cpp \
|
|
|
|
src/BooksTextStyle.cpp \
|
|
|
|
src/BooksTaskQueue.cpp \
|
|
|
|
src/BooksTextView.cpp \
|
2015-07-15 22:59:00 +03:00
|
|
|
src/BooksUtil.cpp \
|
2015-06-28 14:22:35 +03:00
|
|
|
src/main.cpp \
|
|
|
|
src/ZLApplication.cpp \
|
|
|
|
src/ZLibrary.cpp
|
|
|
|
|
2016-10-07 17:41:59 +03:00
|
|
|
# Some libraries are not allowed in harbour
|
|
|
|
openrepos {
|
|
|
|
LIBS += -lexpat -lmagic -ludev
|
|
|
|
} else {
|
|
|
|
SOURCES += \
|
|
|
|
stubs/libexpat.c \
|
|
|
|
stubs/libmagic.c \
|
|
|
|
stubs/libudev.c
|
|
|
|
}
|
2015-07-07 13:11:16 +03:00
|
|
|
|
2015-06-28 14:22:35 +03:00
|
|
|
HEADERS += \
|
|
|
|
src/BooksBook.h \
|
|
|
|
src/BooksBookModel.h \
|
|
|
|
src/BooksConfig.h \
|
|
|
|
src/BooksCoverModel.h \
|
|
|
|
src/BooksCoverWidget.h \
|
|
|
|
src/BooksDefs.h \
|
|
|
|
src/BooksDialogManager.h \
|
2017-12-03 04:19:17 +03:00
|
|
|
src/BooksFeedback.h \
|
2015-07-12 17:11:55 +03:00
|
|
|
src/BooksHints.h \
|
2016-10-08 19:57:54 +03:00
|
|
|
src/BooksImageProvider.h \
|
2015-06-28 14:22:35 +03:00
|
|
|
src/BooksImportModel.h \
|
|
|
|
src/BooksItem.h \
|
|
|
|
src/BooksListWatcher.h \
|
|
|
|
src/BooksLoadingProperty.h \
|
2017-08-08 16:09:01 +03:00
|
|
|
src/BooksMediaPlugin.h \
|
2017-08-03 18:48:17 +03:00
|
|
|
src/BooksPageStack.h \
|
2015-06-28 14:22:35 +03:00
|
|
|
src/BooksPageWidget.h \
|
|
|
|
src/BooksPaintContext.h \
|
2015-11-08 14:20:25 +03:00
|
|
|
src/BooksPathModel.h \
|
2017-08-08 16:09:01 +03:00
|
|
|
src/BooksPolicyPlugin.h \
|
2015-06-28 14:22:35 +03:00
|
|
|
src/BooksPos.h \
|
|
|
|
src/BooksSaveTimer.h \
|
|
|
|
src/BooksSettings.h \
|
|
|
|
src/BooksShelf.h \
|
|
|
|
src/BooksStorage.h \
|
|
|
|
src/BooksStorageModel.h \
|
|
|
|
src/BooksTaskQueue.h \
|
|
|
|
src/BooksTextView.h \
|
|
|
|
src/BooksTextStyle.h \
|
2015-07-15 22:59:00 +03:00
|
|
|
src/BooksTypes.h \
|
|
|
|
src/BooksUtil.h
|
2016-10-07 17:41:59 +03:00
|
|
|
|
2019-03-31 03:38:26 +03:00
|
|
|
# harbour-lib
|
|
|
|
|
|
|
|
HEADERS += \
|
|
|
|
$$HARBOUR_INCLUDE_DIR/HarbourDisplayBlanking.h \
|
|
|
|
$$HARBOUR_INCLUDE_DIR/HarbourJson.h \
|
|
|
|
$$HARBOUR_INCLUDE_DIR/HarbourPluginLoader.h \
|
|
|
|
$$HARBOUR_INCLUDE_DIR/HarbourTask.h
|
|
|
|
|
|
|
|
HEADERS += \
|
|
|
|
$$HARBOUR_SRC_DIR/HarbourMce.h
|
|
|
|
|
|
|
|
SOURCES += \
|
|
|
|
$$HARBOUR_SRC_DIR/HarbourDisplayBlanking.cpp \
|
|
|
|
$$HARBOUR_SRC_DIR/HarbourJson.cpp \
|
|
|
|
$$HARBOUR_SRC_DIR/HarbourMce.cpp \
|
|
|
|
$$HARBOUR_SRC_DIR/HarbourPluginLoader.cpp \
|
|
|
|
$$HARBOUR_SRC_DIR/HarbourTask.cpp
|
|
|
|
|
2019-04-01 02:06:55 +03:00
|
|
|
HARBOUR_QML_COMPONENTS = \
|
|
|
|
$$HARBOUR_LIB_QML/HarbourFitLabel.qml \
|
|
|
|
$$HARBOUR_LIB_QML/HarbourHorizontalSwipeHint.qml
|
|
|
|
|
|
|
|
OTHER_FILES += $${HARBOUR_QML_COMPONENTS}
|
|
|
|
|
|
|
|
qml_components.files = $${HARBOUR_QML_COMPONENTS}
|
|
|
|
qml_components.path = /usr/share/$${TARGET}/qml/harbour
|
|
|
|
INSTALLS += qml_components
|
|
|
|
|
2016-10-07 17:41:59 +03:00
|
|
|
# Icons
|
|
|
|
ICON_SIZES = 86 108 128 256
|
|
|
|
for(s, ICON_SIZES) {
|
|
|
|
icon_target = icon$${s}
|
|
|
|
icon_dir = icons/$${s}x$${s}
|
|
|
|
$${icon_target}.files = $${icon_dir}/$${TARGET}.png
|
|
|
|
$${icon_target}.path = /usr/share/icons/hicolor/$${s}x$${s}/apps
|
|
|
|
equals(PREFIX, "openrepos") {
|
|
|
|
$${icon_target}.extra = cp $${icon_dir}/harbour-$${NAME}.png $$eval($${icon_target}.files)
|
|
|
|
$${icon_target}.CONFIG += no_check_exist
|
|
|
|
}
|
|
|
|
INSTALLS += $${icon_target}
|
|
|
|
}
|
|
|
|
|
|
|
|
# Settings
|
|
|
|
app_settings {
|
|
|
|
settings_json.files = settings/$${TARGET}.json
|
|
|
|
settings_json.path = /usr/share/jolla-settings/entries/
|
|
|
|
equals(PREFIX, "openrepos") {
|
|
|
|
settings_json.extra = sed s/harbour/openrepos/g settings/harbour-$${NAME}.json > $$eval(settings_json.files)
|
|
|
|
settings_json.CONFIG += no_check_exist
|
|
|
|
}
|
|
|
|
INSTALLS += settings_json
|
|
|
|
}
|
|
|
|
|
|
|
|
settings_qml.files = settings/*.qml
|
|
|
|
settings_qml.path = /usr/share/$${TARGET}/settings/
|
|
|
|
INSTALLS += settings_qml
|
|
|
|
|
|
|
|
# Desktop file
|
|
|
|
equals(PREFIX, "openrepos") {
|
|
|
|
desktop.extra = sed s/harbour/openrepos/g harbour-$${NAME}.desktop > $${TARGET}.desktop
|
|
|
|
desktop.CONFIG += no_check_exist
|
|
|
|
}
|
|
|
|
|
|
|
|
# Translations
|
|
|
|
TRANSLATION_SOURCES = \
|
|
|
|
$${_PRO_FILE_PWD_}/qml \
|
|
|
|
$${_PRO_FILE_PWD_}/settings
|
|
|
|
|
|
|
|
defineTest(addTrFile) {
|
2018-05-21 17:26:37 +03:00
|
|
|
rel = translations/harbour-$${1}
|
|
|
|
OTHER_FILES += $${rel}.ts
|
|
|
|
|
|
|
|
in = $${_PRO_FILE_PWD_}/$$rel
|
2016-10-07 17:41:59 +03:00
|
|
|
out = $${OUT_PWD}/translations/$${PREFIX}-$$1
|
|
|
|
|
|
|
|
s = $$replace(1,-,_)
|
|
|
|
lupdate_target = lupdate_$$s
|
|
|
|
lrelease_target = lrelease_$$s
|
|
|
|
|
|
|
|
$${lupdate_target}.commands = lupdate -noobsolete $${TRANSLATION_SOURCES} -ts \"$${in}.ts\" && \
|
|
|
|
mkdir -p \"$${OUT_PWD}/translations\" && [ \"$${in}.ts\" != \"$${out}.ts\" ] && \
|
|
|
|
cp -af \"$${in}.ts\" \"$${out}.ts\" || :
|
|
|
|
|
2017-01-28 19:25:31 +03:00
|
|
|
$${lrelease_target}.target = $${out}.qm
|
2016-10-07 17:41:59 +03:00
|
|
|
$${lrelease_target}.depends = $${lupdate_target}
|
|
|
|
$${lrelease_target}.commands = lrelease -idbased \"$${out}.ts\"
|
|
|
|
|
|
|
|
QMAKE_EXTRA_TARGETS += $${lrelease_target} $${lupdate_target}
|
2017-01-28 19:25:31 +03:00
|
|
|
PRE_TARGETDEPS += $${out}.qm
|
|
|
|
qm.files += $${out}.qm
|
2016-10-07 17:41:59 +03:00
|
|
|
|
|
|
|
export($${lupdate_target}.commands)
|
|
|
|
export($${lrelease_target}.target)
|
|
|
|
export($${lrelease_target}.depends)
|
|
|
|
export($${lrelease_target}.commands)
|
|
|
|
export(QMAKE_EXTRA_TARGETS)
|
|
|
|
export(PRE_TARGETDEPS)
|
2018-05-21 17:26:37 +03:00
|
|
|
export(OTHER_FILES)
|
2016-10-07 17:41:59 +03:00
|
|
|
export(qm.files)
|
|
|
|
}
|
|
|
|
|
2018-05-21 17:26:37 +03:00
|
|
|
LANGUAGES = de fi hu nl pl pt_BR ru sv es
|
2016-10-07 17:41:59 +03:00
|
|
|
|
|
|
|
addTrFile($${NAME})
|
|
|
|
for(l, LANGUAGES) {
|
|
|
|
addTrFile($${NAME}-$$l)
|
|
|
|
}
|
|
|
|
|
|
|
|
qm.path = $$TRANSLATIONS_PATH
|
|
|
|
qm.CONFIG += no_check_exist
|
|
|
|
INSTALLS += qm
|