KeePassXC: fix and enable recipe

This commit is contained in:
Sergei Reznikov
2017-09-01 11:41:24 +03:00
parent 0e6af4eec9
commit 0424a12457
5 changed files with 71 additions and 208 deletions

View File

@@ -2,20 +2,18 @@
resource app_flags B_SINGLE_LAUNCH | B_ARGV_ONLY;
resource app_version {
major = 2,
middle = 1,
minor = 0,
major = @MAJOR@,
middle = @MIDDLE@,
minor = @MINOR@,
variety = B_APPV_FINAL,
internal = 1,
internal = 0,
short_info = "Qt password manager",
long_info = ""
short_info = "KeePassXC",
long_info = "@LONG_INFO@"
};
resource app_signature "application/x-vnd.qt5-keepassxc";
resource file_types message;
resource app_signature "@APP_SIGNATURE@";
resource vector_icon {
$"6E6369660404007F050005FF0200060240810E3D757BBD7874408335CB76E94C"

View File

@@ -1,106 +0,0 @@
SUMMARY="Qt password manager"
DESCRIPTION="
KeePassXC is an application for people with extremly high demands on secure \
personal data management. It has a light interface, is cross platform and \
published under the terms of the GNU General Public License.
KeePassXC saves many different information e.g. user names, passwords, urls, \
attachments and comments in one single database. For a better management \
user-defined titles and icons can be specified for each single entry. \
Furthermore the entries are sorted in groups, which are customizable as well. \
The integrated search function allows to search in a single group or the \
complete database.
KeePassXC offers a little utility for secure password generation. The password \
generator is very customizable, fast and easy to use. Especially someone who \
generates passwords frequently will appreciate this feature.
KeePassXC is a community fork of KeePassX which aims to incorporate stalled \
pull requests, features, and bug fixes that have never made it into the main \
KeePassX repository."
HOMEPAGE="https://keepassxc.org/"
COPYRIGHT="2010-2012 Felix Geyer
2011-2012 Florian Geyer
2012 Tobias Tangemann
2007 Trolltech ASA
2012 Intel Corporation
2012 Nokia Corporation and/or its subsidiary(-ies)
2000-2008 Tom Sato"
LICENSE="GNU GPL v2"
REVISION="2"
SOURCE_URI="https://github.com/keepassxreboot/keepassxc/releases/download/$portVersion/keepassxc-$portVersion-src.tar.bz2"
CHECKSUM_SHA256="23a39aeda8f2e6263b0821826cfb8735275fba104712748c7a5e41e1f87fb0a6"
PATCHES="keepassxc-2.1.0.patchset"
ADDITIONAL_FILES="keepassxc.rdef"
ARCHITECTURES="x86 x86_64"
PROVIDES="
keepassxc = $portVersion
app:keepassxc = $portVersion
"
REQUIRES="
haiku
lib:libgcrypt
lib:libmicrohttpd
lib:libQt5Concurrent
lib:libQt5Core
lib:libQt5Network
lib:libQt5Test
lib:libQt5Widgets
lib:libz
"
BUILD_REQUIRES="
haiku_devel
devel:libz
devel:libgcrypt
devel:libgpg_error
devel:libmicrohttpd
devel:libQt5Concurrent
devel:libQt5Core
devel:libQt5Network
devel:libQt5Test
devel:libQt5Widgets
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:make
cmd:g++
cmd:qmake
cmd:moc
cmd:xres
"
BUILD()
{
cmake -DCMAKE_INSTALL_PREFIX=$prefix \
-DCMAKE_INSTALL_DATAROOTDIR=$dataDir \
-DCMAKE_BUILD_TYPE=Release \
-DWITH_TESTS=off -DWITH_XC_AUTOTYPE=on.
make $jobArgs
rc $portDir/additional-files/keepassxc.rdef \
-o $sourceDir/src/keepassxc.rsrc
xres -o $sourceDir/src/keepassxc $sourceDir/src/keepassxc.rsrc
mimeset -f $sourceDir/src/keepassxc
}
INSTALL()
{
make install
appIconsDir=$dataDir/keepassxc/icons/application
rm -rf $appIconsDir/scalable
rm -rf $appIconsDir/16x16/apps
rm -rf $appIconsDir/*/mimetypes
for i in 24 32 48 64 128 256; do
rm -rf $appIconsDir/${i}x${i}
done
mkdir -p $appsDir
mv $binDir/keepassxc $appsDir/KeePassXC
addAppDeskbarSymlink $appsDir/KeePassXC KeePassXC
}
TEST()
{
make test
}

View File

@@ -27,14 +27,15 @@ REVISION="1"
SOURCE_URI="https://github.com/keepassxreboot/keepassxc/archive/$portVersion.tar.gz"
CHECKSUM_SHA256="9d9d39b9c056955fe5d7a5212efe1703be02fa4731c36e2b1e06a78174b0a7b8"
PATCHES="keepassxc-$portVersion.patchset"
ADDITIONAL_FILES="keepassxc.rdef"
ADDITIONAL_FILES="keepassxc.rdef.in"
ARCHITECTURES="!x86 !x86_64"
ARCHITECTURES="!x86_gcc2 x86_64"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
keepassxc = $portVersion
cmd:keepassxc = $portVersion
cmd:keepassxc_cli = $portVersion
keepassxc$secondaryArchSuffix = $portVersion
cmd:keepassxc$secondaryArchSuffix = $portVersion
cmd:keepassxc_cli$secondaryArchSuffix = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
@@ -43,6 +44,8 @@ REQUIRES="
lib:libmicrohttpd$secondaryArchSuffix
lib:libQt5Concurrent$secondaryArchSuffix
lib:libQt5Core$secondaryArchSuffix
lib:libQt5DBus$secondaryArchSuffix
lib:libQt5Gui$secondaryArchSuffix
lib:libQt5Network$secondaryArchSuffix
lib:libQt5Test$secondaryArchSuffix
lib:libQt5Widgets$secondaryArchSuffix
@@ -51,23 +54,25 @@ REQUIRES="
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libz$secondaryArchSuffix
devel:libgcrypt$secondaryArchSuffix
devel:libgpg_error$secondaryArchSuffix
devel:libmicrohttpd$secondaryArchSuffix
devel:libQt5Concurrent$secondaryArchSuffix
devel:libQt5Core$secondaryArchSuffix
devel:libQt5Network
devel:libQt5Test
devel:libQt5Widgets
devel:libQt5DBus$secondaryArchSuffix
devel:libQt5Gui$secondaryArchSuffix
devel:libQt5Network$secondaryArchSuffix
devel:libQt5Test$secondaryArchSuffix
devel:libQt5Widgets$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:make
cmd:g++
cmd:qmake
cmd:make
cmd:moc
cmd:xres
cmd:qmake
"
BUILD()
@@ -78,27 +83,41 @@ BUILD()
-DWITH_TESTS=on -DWITH_XC_AUTOTYPE=on .
make $jobArgs
rc $portDir/additional-files/keepassxc.rdef \
-o $sourceDir/src/keepassxc.rsrc
xres -o $sourceDir/src/keepassxc $sourceDir/src/keepassxc.rsrc
mimeset -f $sourceDir/src/keepassxc
}
INSTALL()
{
# TODO: adjust path for /boot/home/.config/keepassxc/keepassxc.ini
# TODO: replace icon with the one from keepassxc.svgz
# TODO: replace toolbar icons with http://zumi.xoom.it/myhaiku/btoolbar/index.html
make install
# appIconsDir=$dataDir/keepassxc/icons/application
# rm -rf $appIconsDir/scalable
# rm -rf $appIconsDir/16x16/apps
# rm -rf $appIconsDir/*/mimetypes
# for i in 24 32 48 64 128 256; do
# rm -rf $appIconsDir/${i}x${i}
# done
appIconsDir=$dataDir/keepassxc/icons/application
rm -rf $appIconsDir/scalable
rm -rf $appIconsDir/16x16/apps
rm -rf $appIconsDir/*/mimetypes
for i in 24 32 48 64 128 256; do
rm -rf $appIconsDir/${i}x${i}
done
mkdir -p $appsDir
cp $binDir/keepassxc $appsDir/KeePassXC
addAppDeskbarSymlink $appsDir/KeePassXC KeePassXC
mv $binDir/keepassxc $appsDir/KeePassXC
local APP_SIGNATURE="application/x-vnd.qt5-keepassxc"
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|" \
-e "s|@LONG_INFO@|$LONG_INFO|" \
$portDir/additional-files/keepassxc.rdef.in > keepassxc.rdef
addResourcesToBinaries keepassxc.rdef $appsDir/KeePassXC
addAppDeskbarSymlink $appsDir/KeePassXC
}
TEST()

View File

@@ -1,65 +0,0 @@
From 669d3119fc71a275691591910da81124a9c03c51 Mon Sep 17 00:00:00 2001
From: Kacper Kasper <kacperkasper@gmail.com>
Date: Thu, 26 Jan 2017 21:24:52 +0100
Subject: Haiku support
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3914049..916a27c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -68,7 +68,7 @@ endmacro(add_gcc_compiler_flags)
add_definitions(-DQT_NO_EXCEPTIONS -DQT_STRICT_ITERATORS -DQT_NO_CAST_TO_ASCII)
-add_gcc_compiler_flags("-fno-common -fstack-protector --param=ssp-buffer-size=4")
+add_gcc_compiler_flags("-fno-common")
add_gcc_compiler_flags("-Wall -Wextra -Wundef -Wpointer-arith -Wno-long-long")
add_gcc_compiler_flags("-Wformat=2 -Wmissing-format-attribute")
add_gcc_compiler_flags("-fvisibility=hidden")
diff --git a/share/CMakeLists.txt b/share/CMakeLists.txt
index a77f80a..a688f0a 100644
--- a/share/CMakeLists.txt
+++ b/share/CMakeLists.txt
@@ -19,14 +19,14 @@ file(GLOB DATABASE_ICONS icons/database/*.png)
install(FILES ${DATABASE_ICONS} DESTINATION ${DATA_INSTALL_DIR}/icons/database)
-if(UNIX AND NOT APPLE)
+if(UNIX AND NOT APPLE AND NOT HAIKU)
install(DIRECTORY icons/application/ DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor
FILES_MATCHING PATTERN "keepassx*.png" PATTERN "keepassx*.svgz")
install(DIRECTORY icons/application/ DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor
FILES_MATCHING PATTERN "application-x-keepassxc.png" PATTERN "application-x-keepassxc.svgz")
install(FILES linux/keepassxc.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
install(FILES linux/keepassxc.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/mime/packages)
-endif(UNIX AND NOT APPLE)
+endif(UNIX AND NOT APPLE AND NOT HAIKU)
if(APPLE)
install(FILES macosx/keepassxc.icns DESTINATION ${DATA_INSTALL_DIR})
--
2.13.1
From 30c2ae94a91e1945f15ebfe3ffcbc10c65f7bc7c Mon Sep 17 00:00:00 2001
From: Chris Moore <chris@mooreonline.org>
Date: Thu, 3 Aug 2017 16:45:41 +0100
Subject: Fix invalid parameter types
diff --git a/src/format/KeePass2XmlReader.cpp b/src/format/KeePass2XmlReader.cpp
index dfb03bd..5194451 100644
--- a/src/format/KeePass2XmlReader.cpp
+++ b/src/format/KeePass2XmlReader.cpp
@@ -388,7 +388,7 @@ void KeePass2XmlReader::parseBinaries()
QString id = attr.value("ID").toString();
QByteArray data;
- if (attr.value("Compressed").compare("True", Qt::CaseInsensitive) == 0) {
+ if (attr.value("Compressed").compare(QString("True"), Qt::CaseInsensitive) == 0) {
data = readCompressedBinary();
}
else {
--
2.13.1

View File

@@ -1,4 +1,4 @@
From 407a9457296a965d5937fff2c0abd7ba963625df Mon Sep 17 00:00:00 2001
From a315bcb09ed0f9ea79de6a9855d5704bf8e84188 Mon Sep 17 00:00:00 2001
From: Sergei Reznikov <diver@gelios.net>
Date: Wed, 30 Aug 2017 20:23:38 +0300
Subject: Haiku patch
@@ -58,6 +58,23 @@ index 7916855..4e55730 100644
if (UNIX AND NOT APPLE)
target_link_libraries(keepassx_core Qt5::DBus)
endif()
diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp
index 7027d94..e95ff9f 100644
--- a/src/gui/MainWindow.cpp
+++ b/src/gui/MainWindow.cpp
@@ -331,10 +331,10 @@ MainWindow::MainWindow()
connect(m_ui->tabWidget, SIGNAL(messageDismissGlobal()), this, SLOT(hideGlobalMessage()));
connect(m_ui->tabWidget, SIGNAL(messageTab(QString,MessageWidget::MessageType)), this, SLOT(displayTabMessage(QString, MessageWidget::MessageType)));
connect(m_ui->tabWidget, SIGNAL(messageDismissTab()), this, SLOT(hideTabMessage()));
-
+#ifndef Q_OS_HAIKU
m_screenLockListener = new ScreenLockListener(this);
connect(m_screenLockListener, SIGNAL(screenLocked()), SLOT(handleScreenLock()));
-
+#endif
updateTrayIcon();
if (config()->hasAccessError()) {
--
2.13.1