mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-22 11:40:06 +02:00
BooksOrg: new recipe (#3263)
This commit is contained in:
47
app-text/booksorg/additional-files/booksorg.rdef.in
Normal file
47
app-text/booksorg/additional-files/booksorg.rdef.in
Normal file
@@ -0,0 +1,47 @@
|
||||
|
||||
resource app_flags B_MULTIPLE_LAUNCH;
|
||||
|
||||
resource app_version {
|
||||
major = @MAJOR@,
|
||||
middle = @MIDDLE@,
|
||||
minor = @MINOR@,
|
||||
|
||||
variety = B_APPV_FINAL,
|
||||
internal = 0,
|
||||
short_info = "BooksOrg",
|
||||
long_info = "@LONG_INFO@"
|
||||
};
|
||||
|
||||
resource app_signature "@APP_SIGNATURE@";
|
||||
|
||||
resource file_types message {
|
||||
"types" = "application/x-pdf"
|
||||
};
|
||||
|
||||
resource vector_icon {
|
||||
$"6E636966180500020006023861083AA03BBD30293AE36E4A1739473BE7009A9A"
|
||||
$"9AFF38415005A203606C7E020006023B243C3CD85DBD486C3B9FF848FB2749CB"
|
||||
$"D200C7ECFFFF5FBBEB03339CD30200060236D5283AEBDCBDE32D39C4F74ABF1B"
|
||||
$"4A0D19001F8CC4FF214C8B020016023309E1394B03BD3A8536FAA94A315146C1"
|
||||
$"8900B9FFE9020016023C00000000000000003C00004780000000000083FF9903"
|
||||
$"1781B705CA020306053C5BB0BC8F073C10C13BCEA04A8FBE4A96F700F1F1F136"
|
||||
$"D9DDF48A837EADB4B8BEDBFFF4F4F404EBD00200060239736C3BB940BB99B739"
|
||||
$"56324ABC6949D16C004137A9FFB9B9B904017E0401920501020106023E491D00"
|
||||
$"00000000003CAA994940004A30007CFFC0C0FFF4F4F40200160338D28F3CD147"
|
||||
$"BCD14738D28F4CD12846C61400E7BDFFFFEB020016023A55C2BAC23D3AC23D3A"
|
||||
$"55C2C9587AC82F330001FF9E0200060237474E3C936BBC6A1C3712BA486F0448"
|
||||
$"AF0A6B06F8B7FF1467FF020006023B619938E70AB8E70A3B61994AEAB8C435C2"
|
||||
$"00FF6D6DFFDA1C1C05FF05000D06032E3F5F595F4F5F595F4E4D0A0826362656"
|
||||
$"3C614C4C4D2E462C3E2A3E2A0A04263626562B582B380A04313B315C395F393D"
|
||||
$"0A042636263A2B3C2B380A043A604C4C4C2F393C0606F60F3E3022492444244D"
|
||||
$"245A2255225A225A305A30553049324D3244320606F60F3E3022492444244D24"
|
||||
$"5A2255225A225A305A30553049324D3244320803522E522756270404B6412E27"
|
||||
$"45294526452C422B0604F649272E4E2C4E2F4E2C4E294EB71A4E260802522B55"
|
||||
$"2B0A042C382C59325C323B1D0A0E0100000A0001011001178400040A0100000A"
|
||||
$"0200000A0300000A050104000A060105000A0700000A0800000A0900000A0A00"
|
||||
$"000A00001815FF01178400040A000018001501178600040A0B00000A0C00000A"
|
||||
$"0D001001178200040A040102000A0F00000A10001001178300040A1100000A10"
|
||||
$"001001178300040A1200000A13001001178000040A13001001178000040A1401"
|
||||
$"0C201F1F0A10001001178000040A1001061001178302040A15020703000A1604"
|
||||
$"08090A0B100117812204"
|
||||
};
|
||||
84
app-text/booksorg/booksorg-0.3.recipe
Normal file
84
app-text/booksorg/booksorg-0.3.recipe
Normal file
@@ -0,0 +1,84 @@
|
||||
SUMMARY="A Simple Books Organizer"
|
||||
DESCRIPTION="Application to Organize with ease your pdf book"
|
||||
COPYRIGHT="2014-2015 Abou Zakaria"
|
||||
LICENSE="GNU GPL v3"
|
||||
REVISION="1"
|
||||
HOMEPAGE="https://sourceforge.net/projects/booksorg/"
|
||||
SOURCE_URI="https://downloads.sourceforge.net/booksorg/booksorg_${portVersion/./}.tar.gz"
|
||||
SOURCE_DIR="booksorg_${portVersion/./}"
|
||||
CHECKSUM_SHA256="dcdcce89090d1539c020412d294e2f6c0ffc84a0f4f400132f57e1c1be29d234"
|
||||
PATCHES="booksorg-$portVersion.patchset"
|
||||
ADDITIONAL_FILES="booksorg.rdef.in"
|
||||
|
||||
ARCHITECTURES="!x86_gcc2 x86 x86_64"
|
||||
if [ "$targetArchitecture" = x86_gcc2 ]; then
|
||||
SECONDARY_ARCHITECTURES="x86"
|
||||
fi
|
||||
|
||||
USER_SETTINGS_FILES="
|
||||
settings/elokab/BooksOrg directory
|
||||
"
|
||||
PROVIDES="
|
||||
booksorg$secondaryArchSuffix = $portVersion
|
||||
app:BooksOrg = $portVersion
|
||||
"
|
||||
REQUIRES="
|
||||
haiku$secondaryArchSuffix
|
||||
lib:libGL$secondaryArchSuffix
|
||||
lib:libpoppler$secondaryArchSuffix
|
||||
lib:libpoppler${secondaryArchSuffix}_qt5
|
||||
lib:libQt5Core$secondaryArchSuffix
|
||||
lib:libQt5DBus$secondaryArchSuffix
|
||||
lib:libQt5Gui$secondaryArchSuffix
|
||||
lib:libQt5PrintSupport$secondaryArchSuffix
|
||||
lib:libQt5Sql$secondaryArchSuffix
|
||||
lib:libQt5Svg$secondaryArchSuffix
|
||||
lib:libQt5Widgets$secondaryArchSuffix
|
||||
"
|
||||
|
||||
BUILD_REQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel
|
||||
devel:libGL$secondaryArchSuffix
|
||||
devel:libpoppler$secondaryArchSuffix
|
||||
devel:libpoppler${secondaryArchSuffix}_qt5
|
||||
devel:libQt5Core$secondaryArchSuffix
|
||||
devel:libQt5DBus$secondaryArchSuffix
|
||||
devel:libQt5Gui$secondaryArchSuffix
|
||||
devel:libQt5PrintSupport$secondaryArchSuffix
|
||||
devel:libQt5Sql$secondaryArchSuffix
|
||||
devel:libQt5Svg$secondaryArchSuffix
|
||||
devel:libQt5Widgets$secondaryArchSuffix
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
cmd:ld$secondaryArchSuffix
|
||||
cmd:make
|
||||
cmd:pkg_config$secondaryArchSuffix
|
||||
cmd:qmake$secondaryArchSuffix >= 5
|
||||
"
|
||||
|
||||
BUILD()
|
||||
{
|
||||
qmake
|
||||
make $jobArgs
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
install -d $appsDir
|
||||
install -T ./bin/BooksOrg $appsDir/BooksOrg
|
||||
local APP_SIGNATURE="application/x-vnd.booksorg"
|
||||
local MAJOR="`echo "$portVersion" | cut -d. -f1`"
|
||||
local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
|
||||
local MINOR="`echo "$portVersion" | cut -d. -f3`"
|
||||
local LONG_INFO="$SUMMARY"
|
||||
sed \
|
||||
-e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \
|
||||
-e "s|@MAJOR@|$MAJOR|" \
|
||||
-e "s|@MIDDLE@|$MIDDLE|" \
|
||||
-e "s|@MINOR@|${MINOR:-0}|" \
|
||||
-e "s|@LONG_INFO@|$LONG_INFO|" \
|
||||
$portDir/additional-files/booksorg.rdef.in > booksorg.rdef
|
||||
addResourcesToBinaries booksorg.rdef $appsDir/BooksOrg
|
||||
addAppDeskbarSymlink $appsDir/BooksOrg
|
||||
}
|
||||
166
app-text/booksorg/patches/booksorg-0.3.patchset
Normal file
166
app-text/booksorg/patches/booksorg-0.3.patchset
Normal file
@@ -0,0 +1,166 @@
|
||||
From ccbb524bd22970d19e726d09225282134eb1ed2a Mon Sep 17 00:00:00 2001
|
||||
From: mazbrili <mazbrili@yahoo.com>
|
||||
Date: Sat, 20 Oct 2018 18:56:36 +0700
|
||||
Subject: apply path difference
|
||||
|
||||
change path with builtin QStandardPaths from Qt
|
||||
|
||||
modify pro files to use pkgconfig
|
||||
|
||||
diff --git a/bookinfo.cpp b/bookinfo.cpp
|
||||
index f75bcaa..30204eb 100644
|
||||
--- a/bookinfo.cpp
|
||||
+++ b/bookinfo.cpp
|
||||
@@ -19,17 +19,13 @@
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
#include "bookinfo.h"
|
||||
-#if QT_VERSION >= 0x050000
|
||||
-#include <poppler-qt5.h>
|
||||
-#else
|
||||
-#include <poppler-qt4.h>
|
||||
-#endif
|
||||
|
||||
#include<QApplication>
|
||||
#include<QInputDialog>
|
||||
#include<QDir>
|
||||
#include<QFileInfo>
|
||||
#include<QSettings>
|
||||
+#include<QStandardPaths>
|
||||
//#define thumbnails QDir::homePath()+"/."+QApplication::applicationName()+"/thumbnails"
|
||||
|
||||
BookInfo::BookInfo()
|
||||
@@ -37,8 +33,14 @@ BookInfo::BookInfo()
|
||||
|
||||
QSettings settings;
|
||||
|
||||
+#ifndef Q_OS_HAIKU
|
||||
QString appdir=(settings.value("BooksPath",
|
||||
QDir::homePath()+"/."+QApplication::applicationName()).toString());
|
||||
+#else
|
||||
+QString appdir=(settings.value("BooksPath",
|
||||
+ QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation)).toString());
|
||||
+#endif
|
||||
+
|
||||
mThumbnails=appdir+"/thumbnails/";
|
||||
|
||||
}
|
||||
diff --git a/booksorganizer.pro b/booksorganizer.pro
|
||||
index 2162d85..c057736 100644
|
||||
--- a/booksorganizer.pro
|
||||
+++ b/booksorganizer.pro
|
||||
@@ -27,6 +27,11 @@ win32{
|
||||
LIBS += -L poppler-win\bin -lpoppler-qt5
|
||||
RC_FILE = myapp.rc
|
||||
# QT +=winextras
|
||||
+}
|
||||
+haiku{
|
||||
+ TARGET = BooksOrg
|
||||
+ CONFIG += link_pkgconfig
|
||||
+ PKGCONFIG += poppler-qt5
|
||||
}else{
|
||||
|
||||
equals(QT_MAJOR_VERSION, 5) {
|
||||
diff --git a/configuredialog.cpp b/configuredialog.cpp
|
||||
index 4058fa3..17fff99 100644
|
||||
--- a/configuredialog.cpp
|
||||
+++ b/configuredialog.cpp
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <QSettings>
|
||||
#include <QMessageBox>
|
||||
#include <QFileDialog>
|
||||
+#include <QStandardPaths>
|
||||
ConfigureDialog::ConfigureDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::ConfigureDialog)
|
||||
@@ -11,8 +12,14 @@ ConfigureDialog::ConfigureDialog(QWidget *parent) :
|
||||
ui->setupUi(this);
|
||||
QSettings settings;
|
||||
|
||||
+#ifndef Q_OS_HAIKU
|
||||
ui->lineEditPath->setText(settings.value("BooksPath",
|
||||
QDir::homePath()+"/."+QApplication::applicationName()).toString());
|
||||
+#else
|
||||
+ ui->lineEditPath->setText(settings.value("BooksPath",
|
||||
+ QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation)).toString());
|
||||
+#endif
|
||||
+
|
||||
ui->checkBoxCopy->setChecked(settings.value("CopyBooks",false).toBool());
|
||||
|
||||
}
|
||||
diff --git a/main.cpp b/main.cpp
|
||||
index e45955e..eeda882 100644
|
||||
--- a/main.cpp
|
||||
+++ b/main.cpp
|
||||
@@ -57,7 +57,12 @@ int main(int argc, char *argv[])
|
||||
qRegisterMetaType< QList< QRectF > >("QList<QRectF>");
|
||||
|
||||
QApplication a(argc, argv);
|
||||
+
|
||||
+#ifndef Q_OS_HAIKU
|
||||
a.setApplicationName("booksorg");
|
||||
+#else
|
||||
+ a.setApplicationName("BooksOrg");
|
||||
+#endif
|
||||
a.setOrganizationName("elokab");
|
||||
a.setApplicationVersion("0.3");
|
||||
a.setWindowIcon(QIcon(":/icons/booksorg"));
|
||||
@@ -98,7 +103,12 @@ int main(int argc, char *argv[])
|
||||
#endif
|
||||
|
||||
QDir dir;
|
||||
+#ifndef Q_OS_HAIKU
|
||||
dir.mkpath(QDir::homePath()+"/."+a.applicationName()+"/thumbnails");
|
||||
+#else
|
||||
+ dir.mkpath(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation)+
|
||||
+ QDir::separator()+"thumbnails");
|
||||
+#endif
|
||||
|
||||
MainWindow w;
|
||||
w.show();
|
||||
diff --git a/mainwindow.cpp b/mainwindow.cpp
|
||||
index d1f46a0..9fd1741 100644
|
||||
--- a/mainwindow.cpp
|
||||
+++ b/mainwindow.cpp
|
||||
@@ -68,8 +68,13 @@ QSettings settings;
|
||||
|
||||
|
||||
|
||||
+#ifdef Q_OS_HAIKU
|
||||
+ Path::setWorkingDir(settings.value("BooksPath",
|
||||
+ QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation)).toString());
|
||||
+#else
|
||||
Path::setWorkingDir(settings.value("BooksPath",
|
||||
QDir::homePath()+"/."+QApplication::applicationName()).toString());
|
||||
+#endif
|
||||
|
||||
Path::setCopyBooks(settings.value("CopyBooks",false).toBool());
|
||||
|
||||
diff --git a/path.cpp b/path.cpp
|
||||
index 069e2be..9eb1db6 100644
|
||||
--- a/path.cpp
|
||||
+++ b/path.cpp
|
||||
@@ -1,3 +1,8 @@
|
||||
#include "path.h"
|
||||
+#include <QStandardPaths>
|
||||
+#ifdef Q_OS_HAIKU
|
||||
+QString Path::mWorkingDir= QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation);
|
||||
+#else
|
||||
QString Path::mWorkingDir= QDir::homePath()+"/."+QApplication::applicationName();
|
||||
+#endif
|
||||
bool Path::mCopy=false;
|
||||
diff --git a/searchtools.cpp b/searchtools.cpp
|
||||
index 3bf60ca..c64a4a4 100644
|
||||
--- a/searchtools.cpp
|
||||
+++ b/searchtools.cpp
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "eicon.h"
|
||||
#include <QtGui>
|
||||
#include <QSettings>
|
||||
+#include <QAction>
|
||||
|
||||
SearchTools::SearchTools(bool isPdf, QWidget *parent) :
|
||||
QWidget(parent),
|
||||
--
|
||||
2.19.1
|
||||
|
||||
Reference in New Issue
Block a user