aboutsummaryrefslogtreecommitdiff
path: root/x11
diff options
context:
space:
mode:
authorJason W. Bacon <jwb@FreeBSD.org>2021-08-31 13:34:22 +0000
committerJason W. Bacon <jwb@FreeBSD.org>2021-08-31 13:34:22 +0000
commit5a521ba8f868526b63b62dad1e22fdec11a1dd42 (patch)
tree995f15ea467fed242257f0757273045f690f7832 /x11
parentac0b29bd214c46d909a56f4e210d24eeaa243bcd (diff)
downloadports-5a521ba8f868526b63b62dad1e22fdec11a1dd42.tar.gz
ports-5a521ba8f868526b63b62dad1e22fdec11a1dd42.zip
x11/coreterminal: Terminal emulator from the CoreApps family
Coreterminal is terminal emulator from the CuboCore suite of simple, lightweight Qt-base applications.
Diffstat (limited to 'x11')
-rw-r--r--x11/Makefile1
-rw-r--r--x11/coreterminal/Makefile31
-rw-r--r--x11/coreterminal/distinfo3
-rw-r--r--x11/coreterminal/files/patch-coreterminal.cpp69
-rw-r--r--x11/coreterminal/files/patch-coreterminal.hpp10
-rw-r--r--x11/coreterminal/files/patch-settings.cpp16
-rw-r--r--x11/coreterminal/pkg-descr4
7 files changed, 134 insertions, 0 deletions
diff --git a/x11/Makefile b/x11/Makefile
index 091775bf68ca..7a964eade35f 100644
--- a/x11/Makefile
+++ b/x11/Makefile
@@ -41,6 +41,7 @@
SUBDIR += conlecterm
SUBDIR += controllermap
SUBDIR += cool-retro-term
+ SUBDIR += coreterminal
SUBDIR += deforaos-desktop
SUBDIR += deforaos-keyboard
SUBDIR += deforaos-libdesktop
diff --git a/x11/coreterminal/Makefile b/x11/coreterminal/Makefile
new file mode 100644
index 000000000000..6de11ccaf53b
--- /dev/null
+++ b/x11/coreterminal/Makefile
@@ -0,0 +1,31 @@
+PORTNAME= coreterminal
+DISTVERSION= 4.3.0
+CATEGORIES= x11
+
+MAINTAINER= jwb@FreeBSD.org
+COMMENT= Terminal emulator from the CoreApps family
+
+LICENSE= GPLv3
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+LIB_DEPENDS= libqtermwidget5.so:x11-toolkits/qtermwidget \
+ libcprime-core.so:deskutils/libcprime
+RUN_DEPENDS= coregarage:deskutils/coregarage
+
+USES= cmake localbase:ldflags qt:5
+USE_QT= buildtools_build core gui qmake_build serialport widgets
+USE_GITLAB= yes
+
+GL_ACCOUNT= CuboCore
+GL_COMMIT= c61e5f8e0941dee2ab8920f2470fe93d21d717a2
+
+PLIST_FILES= bin/coreterminal \
+ share/applications/org.cubocore.CoreTerminal.desktop \
+ share/icons/hicolor/scalable/apps/org.cubocore.CoreTerminal.svg
+
+pre-configure:
+ @${REINPLACE_CMD} \
+ -e 's|/usr/bin/coreterminal|${PREFIX}/bin/coreterminal|g' \
+ ${WRKSRC}/org.cubocore.CoreTerminal.desktop
+
+.include <bsd.port.mk>
diff --git a/x11/coreterminal/distinfo b/x11/coreterminal/distinfo
new file mode 100644
index 000000000000..f83af4566883
--- /dev/null
+++ b/x11/coreterminal/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1629410989
+SHA256 (CuboCore-coreterminal-c61e5f8e0941dee2ab8920f2470fe93d21d717a2_GL0.tar.gz) = 01466f9dd7b8855f5f55b69c076a2310522da41a1a39de59893de9581d586d97
+SIZE (CuboCore-coreterminal-c61e5f8e0941dee2ab8920f2470fe93d21d717a2_GL0.tar.gz) = 73363
diff --git a/x11/coreterminal/files/patch-coreterminal.cpp b/x11/coreterminal/files/patch-coreterminal.cpp
new file mode 100644
index 000000000000..ae15e597e257
--- /dev/null
+++ b/x11/coreterminal/files/patch-coreterminal.cpp
@@ -0,0 +1,69 @@
+--- coreterminal.cpp.orig 2021-08-18 11:17:12 UTC
++++ coreterminal.cpp
+@@ -27,6 +27,7 @@
+ *
+ */
+
++#include <iostream>
+ #include <QWidget>
+ #include <QCloseEvent>
+ #include <QHBoxLayout>
+@@ -34,6 +35,8 @@
+ #include <QDir>
+ #include <QFileInfo>
+ #include <QMessageBox>
++#include <QTabBar>
++#include <QStyle>
+
+ #include <cprime/appopenfunc.h>
+ #include <cprime/variables.h>
+@@ -75,6 +78,7 @@ CoreTerminal::~CoreTerminal()
+ void CoreTerminal::loadSettings()
+ {
+ uiMode = smi->getValue("CoreApps", "UIMode");
++ terminalFont = smi->getValue("CoreTerminal", "Font");
+ }
+
+ void CoreTerminal::createGUI()
+@@ -239,7 +243,40 @@ void CoreTerminal::setWindowProperties()
+ // setStyleSheet( "#base { background-color: palette(Window); }" );
+ // }
+
+- resize( 800, 500 );
++ QFontMetrics fm( terminalFont );
++ std::cerr << "fm.boundingRect(\"M\").width() = " << fm.boundingRect( "M" ).width()
++ << "\nfm.boundingRect(\"M\").height() = " << fm.boundingRect("M").height()
++ << "\nfm.averageCharWidth() = " << fm.averageCharWidth()
++ << "\nfm.height() = " << fm.height()
++ << "\nfm.lineSpacing() = " << fm.lineSpacing()
++ << "\nfm.leading() = " << fm.leading()
++ << "\ntabBar.width() = " << TabWidget->tabBar()->width()
++ << "\ntabBar.height() = " << TabWidget->tabBar()->height()
++ << "\nframeGeometry.height() = " << frameGeometry().height()
++ << "\ngeometry.height() = " << geometry().height()
++ << "\nPM_ScrollBarExtent = " << qApp->style()->pixelMetric(QStyle::PM_ScrollBarExtent)
++ << "\nPM_TabBarTabOverlap = " << qApp->style()->pixelMetric(QStyle::PM_TabBarTabOverlap)
++ << "\nPM_TabBarTabVSpace = " << qApp->style()->pixelMetric(QStyle::PM_TabBarTabVSpace)
++ << "\nPM_TabBarBaseHeight = " << qApp->style()->pixelMetric(QStyle::PM_TabBarBaseHeight)
++ << "\nPM_TabBarBaseOverlap = " << qApp->style()->pixelMetric(QStyle::PM_TabBarBaseOverlap)
++ << "\ntabBar()->height() = " << TabWidget->tabBar()->height()
++ << "\ntabBar()->tabRect().height() = " << TabWidget->tabBar()->tabRect(0).height()
++ << '\n';
++
++ int width = fm.averageCharWidth() * 80
++ + qApp->style()->pixelMetric(QStyle::PM_ScrollBarExtent)
++ + 2;
++ /*
++ * Perfect size =
++ * tabBar->height() +7 for Fusion, +4 for QtCurve, +3 for Windows
++ * tabBar->tabRect(0).height() seems to align:
++ * 36 for Fusion, 33 for QtCurve, 32 for Windows using 12pt font
++ * Also verified with several other styles and font sizes
++ */
++ int height = fm.height() * 30
++ + TabWidget->tabBar()->tabRect(0).height()
++ + 1;
++ resize(width, height);
+
+ if (uiMode != 0) {
+ setWindowFlags( windowFlags() );
diff --git a/x11/coreterminal/files/patch-coreterminal.hpp b/x11/coreterminal/files/patch-coreterminal.hpp
new file mode 100644
index 000000000000..4629c46f023c
--- /dev/null
+++ b/x11/coreterminal/files/patch-coreterminal.hpp
@@ -0,0 +1,10 @@
+--- coreterminal.hpp.orig 2021-08-18 11:17:12 UTC
++++ coreterminal.hpp
+@@ -53,6 +53,7 @@ public :
+ private:
+ int uiMode;
+ settings *smi;
++ QFont terminalFont;
+
+ void loadSettings();
+ void createGUI();
diff --git a/x11/coreterminal/files/patch-settings.cpp b/x11/coreterminal/files/patch-settings.cpp
new file mode 100644
index 000000000000..3b6041ca7294
--- /dev/null
+++ b/x11/coreterminal/files/patch-settings.cpp
@@ -0,0 +1,16 @@
+--- settings.cpp.orig 2021-08-19 22:10:26 UTC
++++ settings.cpp
+@@ -92,11 +92,11 @@ void settings::setDefaultSettings()
+ QFont monoFont = QFontDatabase::systemFont(QFontDatabase::FixedFont);
+
+ if (not monoFont.family().count()) {
+- monoFont = QFont("monospace", 9);
++ monoFont = QFont("monospace", 12);
+ }
+
+ if (monoFont.styleHint() != QFont::Monospace) {
+- monoFont = QFont("monospace", 9);
++ monoFont = QFont("monospace", 12);
+ }
+
+ cSetting->setValue("CoreTerminal/Font", monoFont);
diff --git a/x11/coreterminal/pkg-descr b/x11/coreterminal/pkg-descr
new file mode 100644
index 000000000000..a8d9b76a2303
--- /dev/null
+++ b/x11/coreterminal/pkg-descr
@@ -0,0 +1,4 @@
+Coreterminal is terminal emulator from the CuboCore suite of simple,
+lightweight Qt-base applications.
+
+WWW: https://gitlab.com/cubocore/coreterminal