summaryrefslogtreecommitdiff
path: root/user/konsole
diff options
context:
space:
mode:
Diffstat (limited to 'user/konsole')
-rw-r--r--user/konsole/APKBUILD9
-rw-r--r--user/konsole/musl.patch87
2 files changed, 93 insertions, 3 deletions
diff --git a/user/konsole/APKBUILD b/user/konsole/APKBUILD
index 1cb2878d6..fdaabc40c 100644
--- a/user/konsole/APKBUILD
+++ b/user/konsole/APKBUILD
@@ -1,7 +1,7 @@
# Contributor: A. Wilcox <awilfox@adelielinux.org>
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=konsole
-pkgver=20.08.1
+pkgver=22.04.2
pkgrel=0
pkgdesc="Terminal emulator for Qt/KDE"
url="https://konsole.kde.org/"
@@ -16,7 +16,9 @@ makedepends="cmake extra-cmake-modules qt5-qtbase-dev kbookmarks-dev
kpty-dev kservice-dev ktextwidgets-dev kwidgetsaddons-dev python3
kwindowsystem-dev kxmlgui-dev kdbusaddons-dev knewstuff-dev"
subpackages="$pkgname-doc $pkgname-lang"
-source="https://download.kde.org/stable/release-service/$pkgver/src/konsole-$pkgver.tar.xz"
+source="https://download.kde.org/stable/release-service/$pkgver/src/konsole-$pkgver.tar.xz
+ musl.patch
+ "
build() {
if [ "$CBUILD" != "$CHOST" ]; then
@@ -41,4 +43,5 @@ package() {
make DESTDIR="$pkgdir" install
}
-sha512sums="3321b97ee738eee10a7bc7f1085b1180a4cbbad67c587149a9acacd96439b89ec5e463028a44f9b9590308614d2c37acca7b31748e290274021031528ec7b995 konsole-20.08.1.tar.xz"
+sha512sums="cd8ecc3e494cc2c087e03b4537b822986d36a04d75edf9c8d053a79578e148498582238f96018262cc74cdf86fe7abf7a0a4408e220ec0a9a49bb94d8aa10a76 konsole-22.04.2.tar.xz
+7f39e9e026cc17214eb0338f90fd9e2c007875813a0fdbd1fae421b779083d94ebe83df5226fc67b451ac3ab3f8aa9501f996551519c718ca23c3de5a7c16fbe musl.patch"
diff --git a/user/konsole/musl.patch b/user/konsole/musl.patch
new file mode 100644
index 000000000..818b71c50
--- /dev/null
+++ b/user/konsole/musl.patch
@@ -0,0 +1,87 @@
+From f6310c2b791275f3727f2240ca7fab9f58db943d Mon Sep 17 00:00:00 2001
+From: Heiko Becker <heiko.becker@kde.org>
+Date: Tue, 22 Mar 2022 22:08:10 +0100
+Subject: [PATCH] Detect the presence of malloc_trim to fix the build with musl
+
+malloc_trim is indeed a GNU extension, but an extension of glibc.
+Relying on __GNUC__ unfortunately doesn't help with that. Check for
+the actual presence of malloc_trim with cmake's check_function_exists
+instead.
+This fixes the build with musl libc, which doesn't come with
+malloc_trim.
+
+Co-authored-by: Ahmad Samir <a.samirh78@gmail.com>
+---
+ CMakeLists.txt | 2 +-
+ src/Screen.cpp | 17 +++++++----------
+ src/config-konsole.h.cmake | 4 ++--
+ 3 files changed, 10 insertions(+), 13 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index e6775aeef..9e990c37d 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -94,7 +94,7 @@ set(HAVE_X11 ${X11_FOUND})
+ # Check for function GETPWUID
+ check_symbol_exists(getpwuid "pwd.h" HAVE_GETPWUID)
+
+-check_include_files(malloc.h HAVE_MALLOC_H)
++check_function_exists(malloc_trim HAVE_MALLOC_TRIM)
+
+ # See above includes for defaults
+ add_definitions(
+diff --git a/src/Screen.cpp b/src/Screen.cpp
+index ad578b4fd..10876f988 100644
+--- a/src/Screen.cpp
++++ b/src/Screen.cpp
+@@ -28,13 +28,11 @@
+ #include "history/HistoryType.h"
+ #include "profile/Profile.h"
+
+-#ifdef HAVE_MALLOC_H
+- // For malloc_trim, which is a GNU extension
+- #ifdef __GNUC__
+- extern "C" {
+- #include <malloc.h>
+- }
+- #endif
++#ifdef HAVE_MALLOC_TRIM
++// For malloc_trim, which is a GNU extension
++extern "C" {
++#include <malloc.h>
++}
+ #endif
+
+ using namespace Konsole;
+@@ -1799,14 +1797,13 @@ void Screen::setScroll(const HistoryType &t, bool copyPreviousScroll)
+ t.scroll(_history);
+ }
+
+-#ifdef HAVE_MALLOC_H
++#ifdef HAVE_MALLOC_TRIM
++
+ #ifdef Q_OS_LINUX
+-#ifdef __GNUC__
+ // We might have been using gigabytes of memory, so make sure it is actually released
+ malloc_trim(0);
+ #endif
+ #endif
+-#endif
+ }
+
+ bool Screen::hasScroll() const
+diff --git a/src/config-konsole.h.cmake b/src/config-konsole.h.cmake
+index b74992b0a..4b1d9b515 100644
+--- a/src/config-konsole.h.cmake
++++ b/src/config-konsole.h.cmake
+@@ -15,5 +15,5 @@
+
+ #cmakedefine HAVE_GETPWUID ${HAVE_GETPWUID}
+
+-/* Define to 1 if you have the <malloc.h> header file. */
+-#cmakedefine HAVE_MALLOC_H 1
++/* Defined if system has the malloc_trim function, which is a GNU extension */
++#cmakedefine HAVE_MALLOC_TRIM
+--
+GitLab
+