Skip to content

Commit

Permalink
speek: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
barracuda156 committed Dec 30, 2024
1 parent d98cc8a commit d2c2466
Show file tree
Hide file tree
Showing 3 changed files with 184 additions and 0 deletions.
43 changes: 43 additions & 0 deletions net/speek/Portfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem 1.0
PortGroup github 1.0

name speek
github.setup Speek-App Speek 1.7.0 v -release
revision 0
checksums rmd160 321c3524b7912494a4c2b6d470efe070f0d5a342 \
sha256 4715d10ad756b87f48ba523c3e7fa67d676fae3493deffe8d5977cc36447600a \
size 147133189
github.tarball_from archive
categories net security p2p
maintainers {@barracuda156 gmail.com:vital.had} openmaintainer

description Anonymous private secure open-source chat
long_description {*}${description} using end-to-end encrypted transport.
license GPL-2

if {${os.platform} eq "darwin" && ${os.major} < 11} {
PortGroup qmake 1.0

# patchfiles-append \
# patch-qt4.diff
#
# destroot {
# copy ${worksrcpath}/I2P-Messenger.app ${destroot}${applications_dir}
# }
} else {
PortGroup qmake5 1.0

qt5.depends_component qtmultimedia qtsvg

destroot {
copy ${worksrcpath}/I2PChat.app ${destroot}${applications_dir}
}
}

# compiler.cxx_standard 2011

# Avoid a silly error:
# https://github.com/vituperative/i2pchat/issues/32
# patchfiles-append 0001-Patch-gitversion.pri.patch
20 changes: 20 additions & 0 deletions net/speek/files/0001-Patch-gitversion.pri.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
From 07370e2c987f02853e367614de6beec285f814f2 Mon Sep 17 00:00:00 2001
From: Sergey Fedorov <[email protected]>
Date: Thu, 4 Apr 2024 03:31:56 +0800
Subject: [PATCH] Patch gitversion.pri

---
gitversion.pri | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git gitversion.pri gitversion.pri
index 7202f57..33f7c3b 100644
--- gitversion.pri
+++ gitversion.pri
@@ -53,5 +53,5 @@ DEFINES += GIT_COMMIT_COUNT=\\\"$$GIT_COMMIT_COUNT\\\"
# This will rewrite Info.plist with full version
macx {
INFO_PLIST_PATH = $$shell_quote($${OUT_PWD}/$${TARGET}.app/Contents/Info.plist)
- QMAKE_POST_LINK += /usr/libexec/PlistBuddy -c \"Set :CFBundleShortVersionString $${VERSION}\" $${INFO_PLIST_PATH}
+ # QMAKE_POST_LINK += /usr/libexec/PlistBuddy -c \"Set :CFBundleShortVersionString $${VERSION}\" $${INFO_PLIST_PATH}
}
121 changes: 121 additions & 0 deletions net/speek/files/patch-qt4.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
--- src/backend/Main.cpp 2020-06-15 06:47:34.000000000 +0800
+++ src/backend/Main.cpp 2024-04-24 19:08:39.000000000 +0800
@@ -27,7 +27,7 @@
#include <QSettings>
#include <QTime>
#include <QDir>
-#include <QStandardPaths>
+#include <QDesktopServices>

#include <unistd.h>
#include <getopt.h>
@@ -38,8 +38,8 @@
QString debugLogDir;

void enableDebugLogging(QString configPath);
-//void myMessageHandler(QtMsgType type, const char *msg);
-void myMessageHandler(QtMsgType type,const QMessageLogContext &context,const QString &msg);
+void myMessageHandler(QtMsgType type, const char *msg);
+//void myMessageHandler(QtMsgType type,const QMessageLogContext &context,const QString &msg);


void help(void){
@@ -70,7 +70,7 @@


#ifdef ANDROID
- QStringList loc = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation);
+ QStringList loc = QDesktopServices::standardLocations(QDesktopServices::GenericDataLocation);
if(loc.size()<=0){
QMessageBox::critical(
NULL,
@@ -114,9 +114,9 @@


#ifdef _WIN32
- configPath = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
+ configPath = QDesktopServices::storageLocation(QDesktopServices::AppDataLocation);
#else
- configPath = QStandardPaths::writableLocation(QStandardPaths::HomeLocation)+NameOfConfigDirectoryOnLinux;
+ configPath = QDesktopServices::storageLocation(QDesktopServices::HomeLocation)+NameOfConfigDirectoryOnLinux;
#endif


@@ -167,7 +167,7 @@

//configPath=QApplication::applicationDirPath();
if(QFile::exists(configPath+"/UseHomeForConfigStore")==true){
- QStringList tmp=QStandardPaths::standardLocations(QStandardPaths::HomeLocation);
+ QString tmp=QDesktopServices::storageLocation(QDesktopServices::HomeLocation);
if(tmp.size()>=1){
configPath=tmp.at(0);
configPath+="/.I2PChat";
@@ -208,13 +208,13 @@
QSettings settings(configPath+"/application.ini",QSettings::IniFormat);
settings.beginGroup("General");
if(settings.value("DebugLogging","true").toBool()==true){
- qInstallMessageHandler(myMessageHandler);
+ qInstallMsgHandler(myMessageHandler);
}
settings.endGroup();
settings.sync();
}

-void myMessageHandler(QtMsgType type,const QMessageLogContext &context,const QString &msg)
+void myMessageHandler(QtMsgType type,const char *msg)
{
QString txt;

@@ -222,23 +222,23 @@

switch (type) {
case QtDebugMsg:{
- txt.append(QString(" Debug: %1 (%2:%3, %4)\n").arg(msg).arg(context.file).arg(context.line).arg(context.function));
+ txt.append(QString(" Debug: %1 (%2:%3, %4)\n").arg(msg));
break;
}
case QtWarningMsg:{
- txt.append(QString(" Warning: %1 (%2:%3, %4)\n").arg(msg).arg(context.file).arg(context.line).arg(context.function));
+ txt.append(QString(" Warning: %1 (%2:%3, %4)\n").arg(msg));
break;
}
case QtCriticalMsg:{
- txt.append(QString(" Critical: %1 (%2:%3, %4)\n").arg(msg).arg(context.file).arg(context.line).arg(context.function));
+ txt.append(QString(" Critical: %1 (%2:%3, %4)\n").arg(msg));
break;
}
case QtFatalMsg:{
- txt.append(QString(" Fatal: %1 (%2:%3, %4)\n").arg(msg).arg(context.file).arg(context.line).arg(context.function));
+ txt.append(QString(" Fatal: %1 (%2:%3, %4)\n").arg(msg));
break;
}
default:{
- txt.append(QString(" Message: %1 (%2:%3, %4)\n").arg(msg).arg(context.file).arg(context.line).arg(context.function));
+ txt.append(QString(" Message: %1 (%2:%3, %4)\n").arg(msg));
break;
}
}

--- src/backend/Core.cpp 2020-06-15 06:47:34.000000000 +0800
+++ src/backend/Core.cpp 2024-04-24 18:20:44.000000000 +0800
@@ -29,7 +29,7 @@
#include <QtGlobal>
#include <QMessageBox>
#include <QApplication>
-#include <QStandardPaths>
+#include <QDesktopServices>

CCore::CCore(QString configPath)
{

--- src/backend/TextEmotionChanger.cpp 2020-06-15 06:47:34.000000000 +0800
+++ src/backend/TextEmotionChanger.cpp 2024-04-24 18:32:19.000000000 +0800
@@ -171,7 +171,7 @@
{
if(tmp.isNull())
tmp = QPixmap(dirPath + "/" + fileName.at(0));
- QString text = emoticonString.text().toHtmlEscaped();
+ QString text = Qt::escape(emoticonString.text());
m_urls.insert(text,
QString("<img src=\"%1\" width=\"%2\" height=\"%3\" alt=\"%4\" title=\"%4\"/>")
.arg(dirPath + "/" + fileName.at(0)).arg(tmp.size().width())

0 comments on commit d2c2466

Please sign in to comment.