Skip to content

Commit

Permalink
dooble: set translations path on start up
Browse files Browse the repository at this point in the history
  • Loading branch information
korli committed Jan 8, 2024
1 parent 1c39675 commit c47ca39
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
4 changes: 3 additions & 1 deletion www-client/dooble/dooble-2023.12.25.recipe
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ manager, and many others."
HOMEPAGE="https://textbrowser.github.io/dooble/"
COPYRIGHT="2008-present Alexis Megas"
LICENSE="BSD (3-clause)"
REVISION="1"
REVISION="2"
SOURCE_URI="https://github.com/textbrowser/dooble/archive/$portVersion.tar.gz"
CHECKSUM_SHA256="f5e67fd052af762b7658f70e268dd73af8e1f39f2eb335a0848c34242ca70315"
SOURCE_DIR="dooble-$portVersion"
PATCHES="dooble-$portVersion.patchset"
ADDITIONAL_FILES="
dooble.rdef.in
haikuicons.zip
Expand Down Expand Up @@ -37,6 +38,7 @@ REQUIRES="
lib:libQt5WebEngine$secondaryArchSuffix
lib:libQt5Widgets$secondaryArchSuffix
lib:libsqlite3$secondaryArchSuffix
lib:libstdc++$secondaryArchSuffix
"

BUILD_REQUIRES="
Expand Down
42 changes: 42 additions & 0 deletions www-client/dooble/patches/dooble-2023.12.25.patchset
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
From 03ce595e89d5b6517c1c3d5dc3f23e00b435c174 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Mon, 8 Jan 2024 17:28:24 +0100
Subject: Haiku: set translations path


diff --git a/Source/dooble_main.cc b/Source/dooble_main.cc
index 17e1252..0e968f2 100644
--- a/Source/dooble_main.cc
+++ b/Source/dooble_main.cc
@@ -45,6 +45,10 @@ extern "C"
#if defined(Q_OS_MACOS)
#include <sys/resource.h>
#endif
+#if defined(Q_OS_HAIKU)
+#include<libgen.h>
+#include<OS.h>
+#endif
}

#ifdef Q_OS_MACOS
@@ -93,6 +97,17 @@ int main(int argc, char *argv[])
qputenv("QT_ENABLE_REGEXP_JIT", "0");
qputenv("QV4_FORCE_INTERPRETER", "1");

+#if defined(Q_OS_HAIKU)
+ char *binpath = realpath(argv[0], NULL);
+ if (binpath != NULL) {
+ char buffer[B_PATH_NAME_LENGTH + B_FILE_NAME_LENGTH];
+ strlcpy(buffer, dirname(binpath), sizeof(buffer));
+ strlcat(buffer, "/Translations", sizeof(buffer));
+ qputenv("DOOBLE_TRANSLATIONS_PATH", buffer);
+ free(binpath);
+ }
+#endif
+
QList<QUrl> urls;
auto attach = false;
auto full_screen = false;
--
2.42.1

0 comments on commit c47ca39

Please sign in to comment.