Skip to content

Commit

Permalink
qtsingleapplication-qt4: new port in devel
Browse files Browse the repository at this point in the history
  • Loading branch information
barracuda156 committed Sep 8, 2024
1 parent 6c882c5 commit 6326d62
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 0 deletions.
55 changes: 55 additions & 0 deletions devel/qtsingleapplication-qt4/Portfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# -*- 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
PortGroup qt4 1.0

set proj_name qtsingleapplication
name ${proj_name}-qt4
github.setup qtproject qt-solutions 777e95ba69952f11eaec0adfb0cb987fabcdecb3
version 2022.10.24
revision 0
categories devel aqua
license LGPL-2.1
maintainers {@barracuda156 gmail.com:vital.had} openmaintainer
description Qt Solutions Component: Single Application
long_description The QtSingleApplication component provides support \
for applications that can be only started once per user.

checksums rmd160 c3d7d6e23df54a38071005000981be50dd357343 \
sha256 4ae03c300a5e45ea9ff534414d1c5f9405df4da04d5df9e9b8a1cd5b83331f62 \
size 1371791
github.tarball_from archive

worksrcdir ${worksrcpath}/${proj_name}

# https://github.com/qtproject/qt-solutions/pull/23
patchfiles 0001-qtsingleapplication-unbreak-build-with-Qt4.patch

configure.pre_args
configure.args -library

pre-build {
system -W ${worksrcpath} "${qt_qmake_cmd}"
}

destroot {
xinstall -d ${destroot}${qt_dir}
move ${worksrcpath}/lib ${destroot}${qt_libs_dir}
set libname libQtSolutions_SingleApplication
system -W ${destroot}${qt_libs_dir} "install_name_tool -id \
${qt_libs_dir}/${libname}-head.1.0.0.dylib ${libname}-head.1.0.0.dylib"
system -W ${destroot}${qt_libs_dir} "install_name_tool -id \
${qt_libs_dir}/${libname}-head_debug.1.0.0.dylib ${libname}-head_debug.1.0.0.dylib"
ln -s ${qt_libs_dir}/${libname}-head.1.0.0.dylib \
${destroot}${qt_libs_dir}/libQtSingleApplication.dylib
set incdir ${qt_dir}/include/QtSingleApplication
xinstall -d ${destroot}${incdir}
xinstall -m 0644 -W ${worksrcpath}/src QtLockedFile QtSingleApplication \
${destroot}${incdir}/
fs-traverse h ${worksrcpath}/src {
if {[file isfile ${h}] && [file extension ${h}] == ".h"} {
copy ${h} ${destroot}${incdir}/
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
From 09f70b01a1fc016f259a881f13b7e231f0471588 Mon Sep 17 00:00:00 2001
From: Sergey Fedorov <[email protected]>
Date: Sun, 8 Sep 2024 16:09:08 +0800
Subject: [PATCH] qtsingleapplication: unbreak build with Qt4

diff --git qtsingleapplication/src/qtlocalpeer.cpp qtsingleapplication/src/qtlocalpeer.cpp
index 7e99171..d39355b 100644
--- src/qtlocalpeer.cpp
+++ src/qtlocalpeer.cpp
@@ -5,7 +5,9 @@
#include "qtlocalpeer.h"
#include <QCoreApplication>
#include <QDataStream>
+#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
#include <QRegularExpression>
+#endif
#include <QTime>

#if defined(Q_OS_WIN)
@@ -42,7 +44,11 @@ QtLocalPeer::QtLocalPeer(QObject* parent, const QString &appId)
#endif
prefix = id.section(QLatin1Char('/'), -1);
}
+#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
prefix.remove(QRegularExpression("[^a-zA-Z]"));
+#else
+ prefix.remove(QRegExp("[^a-zA-Z]"));
+#endif
prefix.truncate(6);

QByteArray idc = id.toUtf8();

0 comments on commit 6326d62

Please sign in to comment.