Dolphin: add recipe

This commit is contained in:
Gerasim Troeglazov
2022-05-17 22:25:15 +10:00
parent 6d64dd3fc3
commit c567a3eff7
3 changed files with 333 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
resource app_flags B_MULTIPLE_LAUNCH;
resource app_version {
major = @MAJOR@,
middle = @MIDDLE@,
minor = @MINOR@,
variety = B_APPV_FINAL,
internal = 0,
short_info = "Dolphin file manager",
long_info = "@LONG_INFO@"
};
resource app_signature "@APP_SIGNATURE@";
resource vector_icon {
$"6E636966080500020006023474C53CA989BEB9DF3683D74AB6E54A4D23007FD5"
$"F8FF166AD2020016022C60663CAAAABEBB082E6EFC4BBA064A22B000FFFF8E02"
$"0006022C25F43C6917BEBB082E6EFA4BAFBF497E0B0097DBFFFF033D7E033D3D"
$"5D020016023AE3B43C79DCBE5BC53CC0974B42AC47CA41009AFF5004016505FF"
$"080A064A5D505D545958595E53504F0A04232F2D494A5B463E0A04232F463E4A"
$"5BC3233C0A063A282E494A5A5C2C502A4C2C0A04302B30494A5951360A04302B"
$"51364A5954BB1E0A0A232F2D494A5B5C2C502A4C2C3A28382D302BB957BAA706"
$"0DFEFEB90345543B42BDB0C0FABDCFC0353F403F40393E383F39BFB4BAB1BDB2"
$"2C3D2A3EB67ABEB32C3F31442C3FBA2BC1BD334930473349463C4E3645BD3BC3"
$"4FBA73C0552E3F3642B9FDBEECBE65C2F30A0A060100000A0001061815FF0117"
$"8400040A00010618001501178600040A030103000A020104000A050105000A01"
$"0101000A040102000A04010702404AED0000000000004015C8C26A2CC3365A0A"
$"07010720211F"
};

View File

@@ -0,0 +1,209 @@
SUMMARY="KDE File Manager"
DESCRIPTION="Dolphin is a lightweight file manager. It has been designed with ease of \
use and simplicity in mind, while still allowing flexibility and customisation. This m\
eans that you can do your file management exactly the way you want to do it.
* Simple to use and dedicated file manager
* Focus on usability
* Breadcrumb navigation bar
* Optional panels for convenient navigation and information display
* Remote and pseudo-filesystem file management through KIO
* Tag files and folders, and find files by content, using Baloo
At first look, this is a simple file manager, but it has many talents. Some features include:
* Split windows - view and use two directories at the same time
* Viewing attributes can be set (and remembered) independently for each window
* Tabbed browsing
* Use the optional informational panel on the right
* Or elect to have essential attribute information displayed in the window
* Use 'breadcrumb' navigation for speed
* One-click change to editable navigation bar
* Add Folders panel for traditional navigation
* Add a terminal in the directory you are currently browsing
* Many functions controlled by keyboard shortcuts"
HOMEPAGE="https://userbase.kde.org/Dolphin"
COPYRIGHT="2000-2022 KDE"
LICENSE="GNU GPL v2"
REVISION="1"
SOURCE_URI="https://download.kde.org/stable/release-service/$portVersion/src/dolphin-$portVersion.tar.xz"
CHECKSUM_SHA256="58c6cdd0d3b8ac41880e5ea2322cad92380c8c45336150c3c39f9357dfa4f100"
PATCHES="dolphin-$portVersion.patchset"
ADDITIONAL_FILES="dolphin.rdef.in"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
commandSuffix=$secondaryArchSuffix
commandBinDir=$binDir
if [ "$targetArchitecture" = x86_gcc2 ]; then
commandSuffix=
commandBinDir=$prefix/bin
fi
PROVIDES="
dolphin$secondaryArchSuffix = $portVersion
app:Dolphin$secondaryArchSuffix = $portVersion
lib:libdolphinprivate$secondaryArchSuffix = 5.0.0 compat >= 5
lib:libdolphinvcs$secondaryArchSuffix = 5.0.0 compat >= 5
cmd:dolphin$commandSuffix = $portVersion
cmd:servicemenuinstaller$commandSuffix = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
cmd:dbus_launch
lib:libkdeinit5_klauncher$secondaryArchSuffix
lib:libKF5Activities$secondaryArchSuffix
lib:libKF5Archive$secondaryArchSuffix
lib:libKF5Attica$secondaryArchSuffix
lib:libKF5Auth$secondaryArchSuffix
lib:libKF5Bookmarks$secondaryArchSuffix
lib:libKF5Codecs$secondaryArchSuffix
lib:libKF5Completion$secondaryArchSuffix
lib:libKF5ConfigCore$secondaryArchSuffix
lib:libKF5ConfigWidgets$secondaryArchSuffix
lib:libKF5CoreAddons$secondaryArchSuffix
lib:libKF5Crash$secondaryArchSuffix
lib:libKF5DBusAddons$secondaryArchSuffix
lib:libKF5DocTools$secondaryArchSuffix
lib:libKF5FileMetadata$secondaryArchSuffix
lib:libKF5GuiAddons$secondaryArchSuffix
lib:libKF5I18n$secondaryArchSuffix
lib:libKF5IconThemes$secondaryArchSuffix
lib:libKF5ItemViews$secondaryArchSuffix
lib:libKF5JobWidgets$secondaryArchSuffix
lib:libKF5KCMUtils$secondaryArchSuffix
lib:libKF5KIOCore$secondaryArchSuffix
lib:libKF5NewStuff$secondaryArchSuffix
lib:libKF5NewStuffCore$secondaryArchSuffix
lib:libKF5Notifications$secondaryArchSuffix
lib:libKF5Package$secondaryArchSuffix
lib:libKF5Parts$secondaryArchSuffix
lib:libKF5Service$secondaryArchSuffix
lib:libKF5Solid$secondaryArchSuffix
lib:libKF5SonnetCore$secondaryArchSuffix
lib:libKF5TextWidgets$secondaryArchSuffix
lib:libKF5Wallet$secondaryArchSuffix
lib:libKF5WidgetsAddons$secondaryArchSuffix
lib:libKF5WindowSystem$secondaryArchSuffix
lib:libKF5XmlGui$secondaryArchSuffix
lib:libphonon4qt5$secondaryArchSuffix
lib:libphonon4qt5experimental$secondaryArchSuffix
lib:libQt5Core$secondaryArchSuffix
lib:libQt5Gui$secondaryArchSuffix
lib:libQt5PrintSupport$secondaryArchSuffix
lib:libQt5Widgets$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
extra_cmake_modules$secondaryArchSuffix >= 5.93
devel:libkdeinit5_klauncher$secondaryArchSuffix
devel:libKF5Activities$secondaryArchSuffix
devel:libKF5Archive$secondaryArchSuffix
devel:libKF5Attica$secondaryArchSuffix
devel:libKF5Auth$secondaryArchSuffix
devel:libKF5Bookmarks$secondaryArchSuffix
devel:libKF5Codecs$secondaryArchSuffix
devel:libKF5Completion$secondaryArchSuffix
devel:libKF5ConfigCore$secondaryArchSuffix
devel:libKF5ConfigWidgets$secondaryArchSuffix
devel:libKF5CoreAddons$secondaryArchSuffix
devel:libKF5Crash$secondaryArchSuffix
devel:libKF5DBusAddons$secondaryArchSuffix
devel:libKF5DocTools$secondaryArchSuffix
devel:libKF5FileMetadata$secondaryArchSuffix
devel:libKF5GuiAddons$secondaryArchSuffix
devel:libKF5I18n$secondaryArchSuffix
devel:libKF5IconThemes$secondaryArchSuffix
devel:libKF5ItemViews$secondaryArchSuffix
devel:libKF5JobWidgets$secondaryArchSuffix
devel:libKF5KCMUtils$secondaryArchSuffix
devel:libKF5KIOCore$secondaryArchSuffix
devel:libKF5NewStuff$secondaryArchSuffix
devel:libKF5Notifications$secondaryArchSuffix
devel:libKF5Package$secondaryArchSuffix
devel:libKF5Parts$secondaryArchSuffix
devel:libKF5Service$secondaryArchSuffix
devel:libKF5Solid$secondaryArchSuffix
devel:libKF5SonnetCore$secondaryArchSuffix
devel:libKF5TextWidgets$secondaryArchSuffix
devel:libKF5Wallet$secondaryArchSuffix
devel:libKF5WidgetsAddons$secondaryArchSuffix
devel:libKF5WindowSystem$secondaryArchSuffix
devel:libKF5XmlGui$secondaryArchSuffix
devel:libphonon4qt5$secondaryArchSuffix
devel:libQt5Core$secondaryArchSuffix
devel:libQt5Gui$secondaryArchSuffix
devel:libQt5PrintSupport$secondaryArchSuffix
devel:libQt5Widgets$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
PROVIDES_devel="
dolphin${secondaryArchSuffix}_devel = $portVersion
devel:libdolphinprivate$secondaryArchSuffix = 5.0.0 compat >= 5
devel:libdolphinvcs$secondaryArchSuffix = 5.0.0 compat >= 5
"
REQUIRES_devel="
dolphin$secondaryArchSuffix == $portVersion base
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:g++$secondaryArchSuffix
cmd:make
cmd:qdbuscpp2xml$secondaryArchSuffix >= 5
"
BUILD()
{
# disable docs
sed -e '/add_subdirectory(doc)/ s/^#*/#/' -i CMakeLists.txt
sed -e '/kdoctools_install(po)/ s/^#*/#/' -i CMakeLists.txt
mkdir -p build
cd build
cmake .. $cmakeDirArgs \
-DCMAKE_BUILD_TYPE=Release \
-DKDE_INSTALL_DATAROOTDIR=$dataDir \
-DKDE_INSTALL_PLUGINDIR=addOnsDir/Qt5 \
-DECM_DIR="/system/data/cmake/Modules/ECM/cmake"
make $jobArgs
}
INSTALL()
{
cd build
make install
mkdir -p $appsDir
mv $commandBinDir/dolphin $appsDir/Dolphin
ln -s $appsDir/Dolphin $commandBinDir/dolphin
rm -rf $libDir/systemd
local APP_SIGNATURE="application/x-vnd.kde-dolphin"
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/dolphin.rdef.in > dolphin.rdef
prepareInstalledDevelLibs \
libdolphinprivate libdolphinvcs
packageEntries devel \
$libDir/cmake \
$developDir
addResourcesToBinaries dolphin.rdef $appsDir/Dolphin
addAppDeskbarSymlink $appsDir/Dolphin
}

View File

@@ -0,0 +1,92 @@
From a96f13a772d9b78ec746cdd7512baf8b0d3f1e1a Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Tue, 2 Nov 2021 19:42:47 +1000
Subject: Fix for Haiku
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 46dbaa1..0867620 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -428,7 +428,7 @@ endif()
if(NOT WIN32)
add_subdirectory(settings/contextmenu/servicemenuinstaller)
- install( FILES settings/contextmenu/servicemenu.knsrc DESTINATION ${KDE_INSTALL_KNSRCDIR} )
+ install( FILES settings/contextmenu/servicemenu.knsrc DESTINATION ${KDE_INSTALL_DATADIR}/knsrcfiles )
endif()
########### install files ###############
diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp
index dc7cacf..56a2c23 100644
--- a/src/dolphinviewcontainer.cpp
+++ b/src/dolphinviewcontainer.cpp
@@ -87,7 +87,7 @@ DolphinViewContainer::DolphinViewContainer(const QUrl& url, QWidget* parent) :
m_messageWidget->setCloseButtonVisible(true);
m_messageWidget->hide();
-#ifndef Q_OS_WIN
+#if !defined(Q_OS_WIN) && !defined(Q_OS_HAIKU)
if (getuid() == 0) {
// We must be logged in as the root user; show a big scary warning
diff --git a/src/kitemviews/private/kdirectorycontentscounterworker.cpp b/src/kitemviews/private/kdirectorycontentscounterworker.cpp
index 73799e7..c63db41 100644
--- a/src/kitemviews/private/kdirectorycontentscounterworker.cpp
+++ b/src/kitemviews/private/kdirectorycontentscounterworker.cpp
@@ -39,6 +39,10 @@ KDirectoryContentsCounterWorker::CountResult walkDir(const QString &dirPath,
QT_STATBUF buf;
while ((dirEntry = QT_READDIR(dir))) {
+#ifdef Q_OS_HAIKU
+ struct stat sp;
+ stat(dirEntry->d_name, &sp);
+#endif
if (dirEntry->d_name[0] == '.') {
if (dirEntry->d_name[1] == '\0' || !countHiddenFiles) {
// Skip "." or hidden files
@@ -53,10 +57,16 @@ KDirectoryContentsCounterWorker::CountResult walkDir(const QString &dirPath,
// If only directories are counted, consider an unknown file type and links also
// as directory instead of trying to do an expensive stat()
// (see bugs 292642 and 299997).
+#ifdef Q_OS_HAIKU
+ const bool countEntry = !countDirectoriesOnly ||
+ S_ISDIR(sp.st_mode) ||
+ S_ISLNK(sp.st_mode);
+#else
const bool countEntry = !countDirectoriesOnly ||
dirEntry->d_type == DT_DIR ||
dirEntry->d_type == DT_LNK ||
dirEntry->d_type == DT_UNKNOWN;
+#endif
if (countEntry) {
++count;
}
@@ -65,8 +75,11 @@ KDirectoryContentsCounterWorker::CountResult walkDir(const QString &dirPath,
bool linkFound = false;
QString nameBuf = QStringLiteral("%1/%2").arg(dirPath, dirEntry->d_name);
-
+#ifdef Q_OS_HAIKU
+ if (S_ISDIR(sp.st_mode) || S_ISLNK(sp.st_mode)) {
+#else
if (dirEntry->d_type == DT_REG || dirEntry->d_type == DT_LNK) {
+#endif
if (QT_STAT(nameBuf.toLocal8Bit(), &buf) == 0) {
if (S_ISDIR(buf.st_mode)) {
// was a dir link, recurse
@@ -75,7 +88,11 @@ KDirectoryContentsCounterWorker::CountResult walkDir(const QString &dirPath,
size += buf.st_size;
}
}
+#ifdef Q_OS_HAIKU
+ if (S_ISDIR(sp.st_mode) || linkFound) {
+#else
if (dirEntry->d_type == DT_DIR || linkFound) {
+#endif
// recursion for dirs and dir links
size += walkDir(nameBuf, countHiddenFiles, countDirectoriesOnly, dirEntry, allowedRecursiveLevel - 1).size;
}
--
2.30.2