Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] New package: heaptrack-1.1.0
@ 2019-06-19 11:06 voidlinux-github
  2019-06-19 14:30 ` voidlinux-github
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: voidlinux-github @ 2019-06-19 11:06 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 313 bytes --]

There is a new pull request by Piraty against master on the void-packages repository

https://github.com/Piraty/void-packages heaptrack
https://github.com/void-linux/void-packages/pull/12549

New package: heaptrack-1.1.0


A patch file from https://github.com/void-linux/void-packages/pull/12549.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-heaptrack-12549.patch --]
[-- Type: application/text/x-diff, Size: 11045 bytes --]

From bdaea2af007d9334091c6c500cb4605b4b390a0a Mon Sep 17 00:00:00 2001
From: Piraty <piraty1@inbox.ru>
Date: Mon, 20 May 2019 21:08:27 +0200
Subject: [PATCH] New package: heaptrack-1.1.0

---
 srcpkgs/heaptrack-gui                         |  1 +
 .../patches/001.compile-on-32bit.patch        | 70 +++++++++++++++++++
 .../heaptrack/patches/002.musl-fixes.patch    | 68 ++++++++++++++++++
 srcpkgs/heaptrack/patches/003.uint.patch      | 49 +++++++++++++
 srcpkgs/heaptrack/patches/004.desktop.patch   | 61 ++++++++++++++++
 srcpkgs/heaptrack/template                    | 28 ++++++++
 6 files changed, 277 insertions(+)
 create mode 120000 srcpkgs/heaptrack-gui
 create mode 100644 srcpkgs/heaptrack/patches/001.compile-on-32bit.patch
 create mode 100644 srcpkgs/heaptrack/patches/002.musl-fixes.patch
 create mode 100644 srcpkgs/heaptrack/patches/003.uint.patch
 create mode 100644 srcpkgs/heaptrack/patches/004.desktop.patch
 create mode 100644 srcpkgs/heaptrack/template

diff --git a/srcpkgs/heaptrack-gui b/srcpkgs/heaptrack-gui
new file mode 120000
index 00000000000..9a8c22eb92e
--- /dev/null
+++ b/srcpkgs/heaptrack-gui
@@ -0,0 +1 @@
+heaptrack
\ No newline at end of file
diff --git a/srcpkgs/heaptrack/patches/001.compile-on-32bit.patch b/srcpkgs/heaptrack/patches/001.compile-on-32bit.patch
new file mode 100644
index 00000000000..f7016cc6336
--- /dev/null
+++ b/srcpkgs/heaptrack/patches/001.compile-on-32bit.patch
@@ -0,0 +1,70 @@
+# reason: current release is unable to build on 32bit arches
+# src: upstream/master
+
+From 76fd2e84ba133e96d2cfdf90cb715e66e923eb8f Mon Sep 17 00:00:00 2001
+From: Milian Wolff <mail@milianw.de>
+Date: Thu, 17 May 2018 13:31:25 +0200
+Subject: [PATCH] Fix compile on 32bit
+
+BUG: 394330
+---
+ src/util/linewriter.h | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/src/util/linewriter.h b/src/util/linewriter.h
+index 73a7930..e895e87 100644
+--- src/util/linewriter.h
++++ src/util/linewriter.h
+@@ -158,6 +158,11 @@ class LineWriter
+         return __builtin_clzl(V);
+     }
+ 
++    inline static unsigned clz(long long unsigned V)
++    {
++        return __builtin_clzll(V);
++    }
++
+     template <typename V>
+     static char* writeHexNumber(char* buffer, V value)
+     {
+
+
+
+From 49577e019ea791ee63962cdfe7e9c0c5b5c6ea4b Mon Sep 17 00:00:00 2001
+From: Milian Wolff <milian.wolff@kdab.com>
+Date: Tue, 29 May 2018 10:41:10 +0200
+Subject: [PATCH] Fix another compile error on 32bit
+
+Introduce a user-defined _u64 literal for uint64_t
+and use that instead of ul/ull.
+
+BUG: 394330
+---
+ tests/auto/tst_io.cpp | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/tests/auto/tst_io.cpp b/tests/auto/tst_io.cpp
+index 48abda6..fd31b31 100644
+--- tests/auto/tst_io.cpp
++++ tests/auto/tst_io.cpp
+@@ -27,6 +27,11 @@
+ 
+ using namespace std;
+ 
++constexpr uint64_t operator"" _u64(unsigned long long v)
++{
++    return static_cast<uint64_t>(v);
++}
++
+ TEST_CASE ("write data", "[write]") {
+     TempFile file;
+     REQUIRE(file.open());
+@@ -124,7 +129,7 @@ TEST_CASE ("read line 64bit", "[read]") {
+     REQUIRE(reader >> module);
+     REQUIRE(module == "/tmp/KDevelop-5.2.1-x86_64/usr/lib/libKF5Completion.so.5");
+ 
+-    for (uint64_t expected : {0x7f48beedc00ul, 0x0ul, 0x36854ul, 0x236858ul, 0x2700ul}) {
++    for (auto expected : {0x7f48beedc00_u64, 0x0_u64, 0x36854_u64, 0x236858_u64, 0x2700_u64}) {
+         uint64_t addr = 0;
+         REQUIRE(reader >> addr);
+         REQUIRE(addr == expected);
diff --git a/srcpkgs/heaptrack/patches/002.musl-fixes.patch b/srcpkgs/heaptrack/patches/002.musl-fixes.patch
new file mode 100644
index 00000000000..5dde897ae18
--- /dev/null
+++ b/srcpkgs/heaptrack/patches/002.musl-fixes.patch
@@ -0,0 +1,68 @@
+# reason: fix sources to work correctly with musl
+
+--- src/track/heaptrack_inject.cpp
++++ src/track/heaptrack_inject.cpp
+@@ -27,6 +27,7 @@
+ #include <link.h>
+ #include <malloc.h>
+ #include <unistd.h>
++#include <dlfcn.h>
+ 
+ #include <sys/mman.h>
+ 
+--- src/track/libheaptrack.cpp
++++ src/track/libheaptrack.cpp
+@@ -72,7 +72,7 @@
+     return chrono::duration_cast<chrono::milliseconds>(clock::now() - startTime());
+ }
+ 
+-__pid_t gettid()
++pid_t gettid()
+ {
+     return syscall(SYS_gettid);
+ }
+
+--- src/track/heaptrack_inject.cpp
++++ src/track/heaptrack_inject.cpp
+@@ -38,9 +38,10 @@
+  * @brief Experimental support for symbol overloading after runtime injection.
+  */
+ 
+-#if __WORDSIZE == 64
++#include <limits.h>
++#if ULONG_MAX == 0xffffffffffffffff
+ #define ELF_R_SYM(i) ELF64_R_SYM(i)
+-#elif __WORDSIZE == 32
++#elif ULONG_MAX == 0xffffffff
+ #define ELF_R_SYM(i) ELF32_R_SYM(i)
+ #else
+ #error unsupported word size
+
+# simplify stdint.h include which failed on musl due to obscure assumptions
+--- 3rdparty/libbacktrace/backtrace.h
++++ 3rdparty/libbacktrace/backtrace.h
+@@ -36,24 +36,8 @@
+ #include <stddef.h>
+ #include <stdio.h>
+ 
+-/* We want to get a definition for uintptr_t, but we still care about
+-   systems that don't have <stdint.h>.  */
+-#if defined(__GLIBC__) && __GLIBC__ >= 2
+-
+-#include <stdint.h>
+-
+-#elif defined(HAVE_STDINT_H)
+-
+ #include <stdint.h>
+ 
+-#else
+-
+-/* Systems that don't have <stdint.h> must provide gstdint.h, e.g.,
+-   from GCC_HEADER_STDINT in configure.ac.  */
+-#include "gstdint.h"
+-
+-#endif
+-
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
diff --git a/srcpkgs/heaptrack/patches/003.uint.patch b/srcpkgs/heaptrack/patches/003.uint.patch
new file mode 100644
index 00000000000..ccf4821a5d3
--- /dev/null
+++ b/srcpkgs/heaptrack/patches/003.uint.patch
@@ -0,0 +1,49 @@
+# src: upstream/master
+
+From f540b95cc7446fbf41b4b3fa9b6f275b580de638 Mon Sep 17 00:00:00 2001
+From: Sergio Martins <smartins@kde.org>
+Date: Sun, 26 May 2019 01:48:21 +0100
+Subject: [PATCH] Use 'unsigned int' instead of 'uint'
+
+The former is cross platform and makes it buildable with MSVC.
+As it's just a couple of places there's no need for a typedef.
+---
+ src/analyze/accumulatedtracedata.cpp | 4 ++--
+ src/util/indices.h                   | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/analyze/accumulatedtracedata.cpp b/src/analyze/accumulatedtracedata.cpp
+index f3f07a7..268c17f 100644
+--- src/analyze/accumulatedtracedata.cpp
++++ src/analyze/accumulatedtracedata.cpp
+@@ -186,7 +186,7 @@ bool AccumulatedTraceData::read(istream& in, const ParsePass pass)
+     for (auto& allocation : allocations) {
+         allocation.clearCost();
+     }
+-    uint fileVersion = 0;
++    unsigned int fileVersion = 0;
+     bool debuggeeEncountered = false;
+ 
+     // required for backwards compatibility
+@@ -385,7 +385,7 @@ bool AccumulatedTraceData::read(istream& in, const ParsePass pass)
+             totalCost = {};
+             fromAttached = true;
+         } else if (reader.mode() == 'v') {
+-            uint heaptrackVersion = 0;
++            unsigned int heaptrackVersion = 0;
+             reader >> heaptrackVersion;
+             if (!(reader >> fileVersion) && heaptrackVersion == 0x010200) {
+                 // backwards compatibility: before the 1.0.0, I actually
+diff --git a/src/util/indices.h b/src/util/indices.h
+index ee1f777..8f21bba 100644
+--- src/util/indices.h
++++ src/util/indices.h
+@@ -64,7 +64,7 @@ struct Index
+ };
+ 
+ template <typename Base>
+-uint qHash(const Index<Base> index, uint seed = 0) noexcept
++unsigned int qHash(const Index<Base> index, unsigned int seed = 0) noexcept
+ {
+     return qHash(index.index, seed);
+ }
diff --git a/srcpkgs/heaptrack/patches/004.desktop.patch b/srcpkgs/heaptrack/patches/004.desktop.patch
new file mode 100644
index 00000000000..3493481e86b
--- /dev/null
+++ b/srcpkgs/heaptrack/patches/004.desktop.patch
@@ -0,0 +1,61 @@
+# src: upstream/master
+
+From f2349d480fc30cf55281218b2b8063c4e5207abb Mon Sep 17 00:00:00 2001
+From: "Friedrich W. H. Kossebau" <kossebau@kde.org>
+Date: Tue, 5 Feb 2019 04:08:55 +0100
+Subject: [PATCH] Set StartupWMClass in desktop file
+
+Used by non-Plasma unixoid X-based shells to map windows to desktop files
+e.g. in launcher UIs, which do not know about _KDE_NET_WM_DESKTOP_FILE and
+instead expect (one of) the WM_CLASS entries to match the basename of the
+desktop file by default. StartupWMClass overwrites that default.
+---
+ src/analyze/gui/org.kde.heaptrack.desktop | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/analyze/gui/org.kde.heaptrack.desktop b/src/analyze/gui/org.kde.heaptrack.desktop
+index 8c92706..ddae134 100644
+--- src/analyze/gui/org.kde.heaptrack.desktop
++++ src/analyze/gui/org.kde.heaptrack.desktop
+@@ -7,6 +7,7 @@ MimeType=application/x-heaptrack;
+ Icon=heaptrack
+ # FIXME: write docs!
+ # X-DocPath=kcachegrind/index.html
++StartupWMClass=heaptrack_gui
+ Terminal=false
+ Name=Heaptrack
+ Name[ca]=Heaptrack
+
+
+From 30ca42deadcb3bf0a73cd37806ceca5d290fbbce Mon Sep 17 00:00:00 2001
+From: "Friedrich W. H. Kossebau" <kossebau@kde.org>
+Date: Tue, 5 Feb 2019 04:23:58 +0100
+Subject: [PATCH] Add correct desktopfilename property for heaptrack_gui
+
+---
+ src/analyze/gui/gui.cpp | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/analyze/gui/gui.cpp b/src/analyze/gui/gui.cpp
+index 96048b1..846d5fb 100644
+--- src/analyze/gui/gui.cpp
++++ src/analyze/gui/gui.cpp
+@@ -19,6 +19,7 @@
+ #include <QApplication>
+ #include <QCommandLineParser>
+ 
++#include <kcoreaddons_version.h>
+ #include <KAboutData>
+ #include <KLocalizedString>
+ 
+@@ -45,7 +46,9 @@ int main(int argc, char** argv)
+                         QStringLiteral("http://milianw.de"));
+ 
+     aboutData.setOrganizationDomain("kde.org");
+-
++#if KCOREADDONS_VERSION >= QT_VERSION_CHECK(5, 16, 0)
++    aboutData.setDesktopFileName(QStringLiteral("org.kde.heaptrack"));
++#endif
+     KAboutData::setApplicationData(aboutData);
+     app.setWindowIcon(QIcon::fromTheme(QStringLiteral("office-chart-area")));
+ 
diff --git a/srcpkgs/heaptrack/template b/srcpkgs/heaptrack/template
new file mode 100644
index 00000000000..958e0b27c1c
--- /dev/null
+++ b/srcpkgs/heaptrack/template
@@ -0,0 +1,28 @@
+# Template file for 'heaptrack'
+pkgname=heaptrack
+version=1.1.0
+revision=1
+build_style=cmake
+# one test fails
+configure_args="-DBUILD_TESTING=OFF"
+makedepends="boost-devel libunwind-devel zlib-devel libdwarf-devel
+ qt5-devel libzstd-devel ecm-devel"
+#gui depends
+hostmakedepends+="qt5-qmake qt5-host-tools extra-cmake-modules kcoreaddons"
+makedepends+=" ki18n-devel kitemmodels-devel kio-devel
+ kconfigwidgets-devel threadweaver-devel kdiagram-devel"
+depends="gdb"
+short_desc="Heap memory profiler for Linux"
+maintainer="Piraty <piraty1@inbox.ru>"
+license="LGPL-2.1-or-later"
+homepage="https://github.com/KDE/heaptrack"
+distfiles="https://github.com/KDE/heaptrack/archive/v${version}.tar.gz"
+checksum=bd247ac67d1ecf023ec7e2a2888764bfc03e2f8b24876928ca6aa0cdb3a07309
+
+heaptrack-gui_package() {
+	short_desc+=" - GUI"
+	pkg_install() {
+		vmove usr/bin/heaptrack_gui
+		vmove usr/share
+	}
+}

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: New package: heaptrack-1.1.0
  2019-06-19 11:06 [PR PATCH] New package: heaptrack-1.1.0 voidlinux-github
@ 2019-06-19 14:30 ` voidlinux-github
  2019-06-19 14:36 ` voidlinux-github
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: voidlinux-github @ 2019-06-19 14:30 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 287 bytes --]

New comment by Piraty on void-packages repository

https://github.com/void-linux/void-packages/pull/12549#issuecomment-503585854
Comment:
I preferred to state the dependencies for the GUI separately in case the project is split in the future (as comments in upstream/master may suggest)

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: New package: heaptrack-1.1.0
  2019-06-19 11:06 [PR PATCH] New package: heaptrack-1.1.0 voidlinux-github
  2019-06-19 14:30 ` voidlinux-github
@ 2019-06-19 14:36 ` voidlinux-github
  2019-06-19 19:20 ` [PR PATCH] [Updated] " voidlinux-github
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: voidlinux-github @ 2019-06-19 14:36 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 248 bytes --]

New comment by xtraeme on void-packages repository

https://github.com/void-linux/void-packages/pull/12549#issuecomment-503588461
Comment:
@Piraty what I'm saying is that `hostmakedepends` is only declared once. And it's using `+=` rather than `=`

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PR PATCH] [Updated] New package: heaptrack-1.1.0
  2019-06-19 11:06 [PR PATCH] New package: heaptrack-1.1.0 voidlinux-github
  2019-06-19 14:30 ` voidlinux-github
  2019-06-19 14:36 ` voidlinux-github
@ 2019-06-19 19:20 ` voidlinux-github
  2019-06-19 19:20 ` voidlinux-github
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: voidlinux-github @ 2019-06-19 19:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 318 bytes --]

There is an updated pull request by Piraty against master on the void-packages repository

https://github.com/Piraty/void-packages heaptrack
https://github.com/void-linux/void-packages/pull/12549

New package: heaptrack-1.1.0


A patch file from https://github.com/void-linux/void-packages/pull/12549.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-heaptrack-12549.patch --]
[-- Type: application/text/x-diff, Size: 11044 bytes --]

From dd42b4fccefcba3caaea3dc3b870247a82ad5a5c Mon Sep 17 00:00:00 2001
From: Piraty <piraty1@inbox.ru>
Date: Mon, 20 May 2019 21:08:27 +0200
Subject: [PATCH] New package: heaptrack-1.1.0

---
 srcpkgs/heaptrack-gui                         |  1 +
 .../patches/001.compile-on-32bit.patch        | 70 +++++++++++++++++++
 .../heaptrack/patches/002.musl-fixes.patch    | 68 ++++++++++++++++++
 srcpkgs/heaptrack/patches/003.uint.patch      | 49 +++++++++++++
 srcpkgs/heaptrack/patches/004.desktop.patch   | 61 ++++++++++++++++
 srcpkgs/heaptrack/template                    | 28 ++++++++
 6 files changed, 277 insertions(+)
 create mode 120000 srcpkgs/heaptrack-gui
 create mode 100644 srcpkgs/heaptrack/patches/001.compile-on-32bit.patch
 create mode 100644 srcpkgs/heaptrack/patches/002.musl-fixes.patch
 create mode 100644 srcpkgs/heaptrack/patches/003.uint.patch
 create mode 100644 srcpkgs/heaptrack/patches/004.desktop.patch
 create mode 100644 srcpkgs/heaptrack/template

diff --git a/srcpkgs/heaptrack-gui b/srcpkgs/heaptrack-gui
new file mode 120000
index 00000000000..9a8c22eb92e
--- /dev/null
+++ b/srcpkgs/heaptrack-gui
@@ -0,0 +1 @@
+heaptrack
\ No newline at end of file
diff --git a/srcpkgs/heaptrack/patches/001.compile-on-32bit.patch b/srcpkgs/heaptrack/patches/001.compile-on-32bit.patch
new file mode 100644
index 00000000000..f7016cc6336
--- /dev/null
+++ b/srcpkgs/heaptrack/patches/001.compile-on-32bit.patch
@@ -0,0 +1,70 @@
+# reason: current release is unable to build on 32bit arches
+# src: upstream/master
+
+From 76fd2e84ba133e96d2cfdf90cb715e66e923eb8f Mon Sep 17 00:00:00 2001
+From: Milian Wolff <mail@milianw.de>
+Date: Thu, 17 May 2018 13:31:25 +0200
+Subject: [PATCH] Fix compile on 32bit
+
+BUG: 394330
+---
+ src/util/linewriter.h | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/src/util/linewriter.h b/src/util/linewriter.h
+index 73a7930..e895e87 100644
+--- src/util/linewriter.h
++++ src/util/linewriter.h
+@@ -158,6 +158,11 @@ class LineWriter
+         return __builtin_clzl(V);
+     }
+ 
++    inline static unsigned clz(long long unsigned V)
++    {
++        return __builtin_clzll(V);
++    }
++
+     template <typename V>
+     static char* writeHexNumber(char* buffer, V value)
+     {
+
+
+
+From 49577e019ea791ee63962cdfe7e9c0c5b5c6ea4b Mon Sep 17 00:00:00 2001
+From: Milian Wolff <milian.wolff@kdab.com>
+Date: Tue, 29 May 2018 10:41:10 +0200
+Subject: [PATCH] Fix another compile error on 32bit
+
+Introduce a user-defined _u64 literal for uint64_t
+and use that instead of ul/ull.
+
+BUG: 394330
+---
+ tests/auto/tst_io.cpp | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/tests/auto/tst_io.cpp b/tests/auto/tst_io.cpp
+index 48abda6..fd31b31 100644
+--- tests/auto/tst_io.cpp
++++ tests/auto/tst_io.cpp
+@@ -27,6 +27,11 @@
+ 
+ using namespace std;
+ 
++constexpr uint64_t operator"" _u64(unsigned long long v)
++{
++    return static_cast<uint64_t>(v);
++}
++
+ TEST_CASE ("write data", "[write]") {
+     TempFile file;
+     REQUIRE(file.open());
+@@ -124,7 +129,7 @@ TEST_CASE ("read line 64bit", "[read]") {
+     REQUIRE(reader >> module);
+     REQUIRE(module == "/tmp/KDevelop-5.2.1-x86_64/usr/lib/libKF5Completion.so.5");
+ 
+-    for (uint64_t expected : {0x7f48beedc00ul, 0x0ul, 0x36854ul, 0x236858ul, 0x2700ul}) {
++    for (auto expected : {0x7f48beedc00_u64, 0x0_u64, 0x36854_u64, 0x236858_u64, 0x2700_u64}) {
+         uint64_t addr = 0;
+         REQUIRE(reader >> addr);
+         REQUIRE(addr == expected);
diff --git a/srcpkgs/heaptrack/patches/002.musl-fixes.patch b/srcpkgs/heaptrack/patches/002.musl-fixes.patch
new file mode 100644
index 00000000000..5dde897ae18
--- /dev/null
+++ b/srcpkgs/heaptrack/patches/002.musl-fixes.patch
@@ -0,0 +1,68 @@
+# reason: fix sources to work correctly with musl
+
+--- src/track/heaptrack_inject.cpp
++++ src/track/heaptrack_inject.cpp
+@@ -27,6 +27,7 @@
+ #include <link.h>
+ #include <malloc.h>
+ #include <unistd.h>
++#include <dlfcn.h>
+ 
+ #include <sys/mman.h>
+ 
+--- src/track/libheaptrack.cpp
++++ src/track/libheaptrack.cpp
+@@ -72,7 +72,7 @@
+     return chrono::duration_cast<chrono::milliseconds>(clock::now() - startTime());
+ }
+ 
+-__pid_t gettid()
++pid_t gettid()
+ {
+     return syscall(SYS_gettid);
+ }
+
+--- src/track/heaptrack_inject.cpp
++++ src/track/heaptrack_inject.cpp
+@@ -38,9 +38,10 @@
+  * @brief Experimental support for symbol overloading after runtime injection.
+  */
+ 
+-#if __WORDSIZE == 64
++#include <limits.h>
++#if ULONG_MAX == 0xffffffffffffffff
+ #define ELF_R_SYM(i) ELF64_R_SYM(i)
+-#elif __WORDSIZE == 32
++#elif ULONG_MAX == 0xffffffff
+ #define ELF_R_SYM(i) ELF32_R_SYM(i)
+ #else
+ #error unsupported word size
+
+# simplify stdint.h include which failed on musl due to obscure assumptions
+--- 3rdparty/libbacktrace/backtrace.h
++++ 3rdparty/libbacktrace/backtrace.h
+@@ -36,24 +36,8 @@
+ #include <stddef.h>
+ #include <stdio.h>
+ 
+-/* We want to get a definition for uintptr_t, but we still care about
+-   systems that don't have <stdint.h>.  */
+-#if defined(__GLIBC__) && __GLIBC__ >= 2
+-
+-#include <stdint.h>
+-
+-#elif defined(HAVE_STDINT_H)
+-
+ #include <stdint.h>
+ 
+-#else
+-
+-/* Systems that don't have <stdint.h> must provide gstdint.h, e.g.,
+-   from GCC_HEADER_STDINT in configure.ac.  */
+-#include "gstdint.h"
+-
+-#endif
+-
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
diff --git a/srcpkgs/heaptrack/patches/003.uint.patch b/srcpkgs/heaptrack/patches/003.uint.patch
new file mode 100644
index 00000000000..ccf4821a5d3
--- /dev/null
+++ b/srcpkgs/heaptrack/patches/003.uint.patch
@@ -0,0 +1,49 @@
+# src: upstream/master
+
+From f540b95cc7446fbf41b4b3fa9b6f275b580de638 Mon Sep 17 00:00:00 2001
+From: Sergio Martins <smartins@kde.org>
+Date: Sun, 26 May 2019 01:48:21 +0100
+Subject: [PATCH] Use 'unsigned int' instead of 'uint'
+
+The former is cross platform and makes it buildable with MSVC.
+As it's just a couple of places there's no need for a typedef.
+---
+ src/analyze/accumulatedtracedata.cpp | 4 ++--
+ src/util/indices.h                   | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/analyze/accumulatedtracedata.cpp b/src/analyze/accumulatedtracedata.cpp
+index f3f07a7..268c17f 100644
+--- src/analyze/accumulatedtracedata.cpp
++++ src/analyze/accumulatedtracedata.cpp
+@@ -186,7 +186,7 @@ bool AccumulatedTraceData::read(istream& in, const ParsePass pass)
+     for (auto& allocation : allocations) {
+         allocation.clearCost();
+     }
+-    uint fileVersion = 0;
++    unsigned int fileVersion = 0;
+     bool debuggeeEncountered = false;
+ 
+     // required for backwards compatibility
+@@ -385,7 +385,7 @@ bool AccumulatedTraceData::read(istream& in, const ParsePass pass)
+             totalCost = {};
+             fromAttached = true;
+         } else if (reader.mode() == 'v') {
+-            uint heaptrackVersion = 0;
++            unsigned int heaptrackVersion = 0;
+             reader >> heaptrackVersion;
+             if (!(reader >> fileVersion) && heaptrackVersion == 0x010200) {
+                 // backwards compatibility: before the 1.0.0, I actually
+diff --git a/src/util/indices.h b/src/util/indices.h
+index ee1f777..8f21bba 100644
+--- src/util/indices.h
++++ src/util/indices.h
+@@ -64,7 +64,7 @@ struct Index
+ };
+ 
+ template <typename Base>
+-uint qHash(const Index<Base> index, uint seed = 0) noexcept
++unsigned int qHash(const Index<Base> index, unsigned int seed = 0) noexcept
+ {
+     return qHash(index.index, seed);
+ }
diff --git a/srcpkgs/heaptrack/patches/004.desktop.patch b/srcpkgs/heaptrack/patches/004.desktop.patch
new file mode 100644
index 00000000000..3493481e86b
--- /dev/null
+++ b/srcpkgs/heaptrack/patches/004.desktop.patch
@@ -0,0 +1,61 @@
+# src: upstream/master
+
+From f2349d480fc30cf55281218b2b8063c4e5207abb Mon Sep 17 00:00:00 2001
+From: "Friedrich W. H. Kossebau" <kossebau@kde.org>
+Date: Tue, 5 Feb 2019 04:08:55 +0100
+Subject: [PATCH] Set StartupWMClass in desktop file
+
+Used by non-Plasma unixoid X-based shells to map windows to desktop files
+e.g. in launcher UIs, which do not know about _KDE_NET_WM_DESKTOP_FILE and
+instead expect (one of) the WM_CLASS entries to match the basename of the
+desktop file by default. StartupWMClass overwrites that default.
+---
+ src/analyze/gui/org.kde.heaptrack.desktop | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/analyze/gui/org.kde.heaptrack.desktop b/src/analyze/gui/org.kde.heaptrack.desktop
+index 8c92706..ddae134 100644
+--- src/analyze/gui/org.kde.heaptrack.desktop
++++ src/analyze/gui/org.kde.heaptrack.desktop
+@@ -7,6 +7,7 @@ MimeType=application/x-heaptrack;
+ Icon=heaptrack
+ # FIXME: write docs!
+ # X-DocPath=kcachegrind/index.html
++StartupWMClass=heaptrack_gui
+ Terminal=false
+ Name=Heaptrack
+ Name[ca]=Heaptrack
+
+
+From 30ca42deadcb3bf0a73cd37806ceca5d290fbbce Mon Sep 17 00:00:00 2001
+From: "Friedrich W. H. Kossebau" <kossebau@kde.org>
+Date: Tue, 5 Feb 2019 04:23:58 +0100
+Subject: [PATCH] Add correct desktopfilename property for heaptrack_gui
+
+---
+ src/analyze/gui/gui.cpp | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/analyze/gui/gui.cpp b/src/analyze/gui/gui.cpp
+index 96048b1..846d5fb 100644
+--- src/analyze/gui/gui.cpp
++++ src/analyze/gui/gui.cpp
+@@ -19,6 +19,7 @@
+ #include <QApplication>
+ #include <QCommandLineParser>
+ 
++#include <kcoreaddons_version.h>
+ #include <KAboutData>
+ #include <KLocalizedString>
+ 
+@@ -45,7 +46,9 @@ int main(int argc, char** argv)
+                         QStringLiteral("http://milianw.de"));
+ 
+     aboutData.setOrganizationDomain("kde.org");
+-
++#if KCOREADDONS_VERSION >= QT_VERSION_CHECK(5, 16, 0)
++    aboutData.setDesktopFileName(QStringLiteral("org.kde.heaptrack"));
++#endif
+     KAboutData::setApplicationData(aboutData);
+     app.setWindowIcon(QIcon::fromTheme(QStringLiteral("office-chart-area")));
+ 
diff --git a/srcpkgs/heaptrack/template b/srcpkgs/heaptrack/template
new file mode 100644
index 00000000000..0840fb6388f
--- /dev/null
+++ b/srcpkgs/heaptrack/template
@@ -0,0 +1,28 @@
+# Template file for 'heaptrack'
+pkgname=heaptrack
+version=1.1.0
+revision=1
+build_style=cmake
+# one test fails
+configure_args="-DBUILD_TESTING=OFF"
+makedepends="boost-devel libunwind-devel zlib-devel libdwarf-devel
+ qt5-devel libzstd-devel ecm-devel"
+#gui depends
+hostmakedepends="qt5-qmake qt5-host-tools extra-cmake-modules kcoreaddons"
+makedepends+=" ki18n-devel kitemmodels-devel kio-devel
+ kconfigwidgets-devel threadweaver-devel kdiagram-devel"
+depends="gdb"
+short_desc="Heap memory profiler for Linux"
+maintainer="Piraty <piraty1@inbox.ru>"
+license="LGPL-2.1-or-later"
+homepage="https://github.com/KDE/heaptrack"
+distfiles="https://github.com/KDE/heaptrack/archive/v${version}.tar.gz"
+checksum=bd247ac67d1ecf023ec7e2a2888764bfc03e2f8b24876928ca6aa0cdb3a07309
+
+heaptrack-gui_package() {
+	short_desc+=" - GUI"
+	pkg_install() {
+		vmove usr/bin/heaptrack_gui
+		vmove usr/share
+	}
+}

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PR PATCH] [Updated] New package: heaptrack-1.1.0
  2019-06-19 11:06 [PR PATCH] New package: heaptrack-1.1.0 voidlinux-github
                   ` (2 preceding siblings ...)
  2019-06-19 19:20 ` [PR PATCH] [Updated] " voidlinux-github
@ 2019-06-19 19:20 ` voidlinux-github
  2019-06-19 19:21 ` voidlinux-github
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: voidlinux-github @ 2019-06-19 19:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 318 bytes --]

There is an updated pull request by Piraty against master on the void-packages repository

https://github.com/Piraty/void-packages heaptrack
https://github.com/void-linux/void-packages/pull/12549

New package: heaptrack-1.1.0


A patch file from https://github.com/void-linux/void-packages/pull/12549.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-heaptrack-12549.patch --]
[-- Type: application/text/x-diff, Size: 11044 bytes --]

From dd42b4fccefcba3caaea3dc3b870247a82ad5a5c Mon Sep 17 00:00:00 2001
From: Piraty <piraty1@inbox.ru>
Date: Mon, 20 May 2019 21:08:27 +0200
Subject: [PATCH] New package: heaptrack-1.1.0

---
 srcpkgs/heaptrack-gui                         |  1 +
 .../patches/001.compile-on-32bit.patch        | 70 +++++++++++++++++++
 .../heaptrack/patches/002.musl-fixes.patch    | 68 ++++++++++++++++++
 srcpkgs/heaptrack/patches/003.uint.patch      | 49 +++++++++++++
 srcpkgs/heaptrack/patches/004.desktop.patch   | 61 ++++++++++++++++
 srcpkgs/heaptrack/template                    | 28 ++++++++
 6 files changed, 277 insertions(+)
 create mode 120000 srcpkgs/heaptrack-gui
 create mode 100644 srcpkgs/heaptrack/patches/001.compile-on-32bit.patch
 create mode 100644 srcpkgs/heaptrack/patches/002.musl-fixes.patch
 create mode 100644 srcpkgs/heaptrack/patches/003.uint.patch
 create mode 100644 srcpkgs/heaptrack/patches/004.desktop.patch
 create mode 100644 srcpkgs/heaptrack/template

diff --git a/srcpkgs/heaptrack-gui b/srcpkgs/heaptrack-gui
new file mode 120000
index 00000000000..9a8c22eb92e
--- /dev/null
+++ b/srcpkgs/heaptrack-gui
@@ -0,0 +1 @@
+heaptrack
\ No newline at end of file
diff --git a/srcpkgs/heaptrack/patches/001.compile-on-32bit.patch b/srcpkgs/heaptrack/patches/001.compile-on-32bit.patch
new file mode 100644
index 00000000000..f7016cc6336
--- /dev/null
+++ b/srcpkgs/heaptrack/patches/001.compile-on-32bit.patch
@@ -0,0 +1,70 @@
+# reason: current release is unable to build on 32bit arches
+# src: upstream/master
+
+From 76fd2e84ba133e96d2cfdf90cb715e66e923eb8f Mon Sep 17 00:00:00 2001
+From: Milian Wolff <mail@milianw.de>
+Date: Thu, 17 May 2018 13:31:25 +0200
+Subject: [PATCH] Fix compile on 32bit
+
+BUG: 394330
+---
+ src/util/linewriter.h | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/src/util/linewriter.h b/src/util/linewriter.h
+index 73a7930..e895e87 100644
+--- src/util/linewriter.h
++++ src/util/linewriter.h
+@@ -158,6 +158,11 @@ class LineWriter
+         return __builtin_clzl(V);
+     }
+ 
++    inline static unsigned clz(long long unsigned V)
++    {
++        return __builtin_clzll(V);
++    }
++
+     template <typename V>
+     static char* writeHexNumber(char* buffer, V value)
+     {
+
+
+
+From 49577e019ea791ee63962cdfe7e9c0c5b5c6ea4b Mon Sep 17 00:00:00 2001
+From: Milian Wolff <milian.wolff@kdab.com>
+Date: Tue, 29 May 2018 10:41:10 +0200
+Subject: [PATCH] Fix another compile error on 32bit
+
+Introduce a user-defined _u64 literal for uint64_t
+and use that instead of ul/ull.
+
+BUG: 394330
+---
+ tests/auto/tst_io.cpp | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/tests/auto/tst_io.cpp b/tests/auto/tst_io.cpp
+index 48abda6..fd31b31 100644
+--- tests/auto/tst_io.cpp
++++ tests/auto/tst_io.cpp
+@@ -27,6 +27,11 @@
+ 
+ using namespace std;
+ 
++constexpr uint64_t operator"" _u64(unsigned long long v)
++{
++    return static_cast<uint64_t>(v);
++}
++
+ TEST_CASE ("write data", "[write]") {
+     TempFile file;
+     REQUIRE(file.open());
+@@ -124,7 +129,7 @@ TEST_CASE ("read line 64bit", "[read]") {
+     REQUIRE(reader >> module);
+     REQUIRE(module == "/tmp/KDevelop-5.2.1-x86_64/usr/lib/libKF5Completion.so.5");
+ 
+-    for (uint64_t expected : {0x7f48beedc00ul, 0x0ul, 0x36854ul, 0x236858ul, 0x2700ul}) {
++    for (auto expected : {0x7f48beedc00_u64, 0x0_u64, 0x36854_u64, 0x236858_u64, 0x2700_u64}) {
+         uint64_t addr = 0;
+         REQUIRE(reader >> addr);
+         REQUIRE(addr == expected);
diff --git a/srcpkgs/heaptrack/patches/002.musl-fixes.patch b/srcpkgs/heaptrack/patches/002.musl-fixes.patch
new file mode 100644
index 00000000000..5dde897ae18
--- /dev/null
+++ b/srcpkgs/heaptrack/patches/002.musl-fixes.patch
@@ -0,0 +1,68 @@
+# reason: fix sources to work correctly with musl
+
+--- src/track/heaptrack_inject.cpp
++++ src/track/heaptrack_inject.cpp
+@@ -27,6 +27,7 @@
+ #include <link.h>
+ #include <malloc.h>
+ #include <unistd.h>
++#include <dlfcn.h>
+ 
+ #include <sys/mman.h>
+ 
+--- src/track/libheaptrack.cpp
++++ src/track/libheaptrack.cpp
+@@ -72,7 +72,7 @@
+     return chrono::duration_cast<chrono::milliseconds>(clock::now() - startTime());
+ }
+ 
+-__pid_t gettid()
++pid_t gettid()
+ {
+     return syscall(SYS_gettid);
+ }
+
+--- src/track/heaptrack_inject.cpp
++++ src/track/heaptrack_inject.cpp
+@@ -38,9 +38,10 @@
+  * @brief Experimental support for symbol overloading after runtime injection.
+  */
+ 
+-#if __WORDSIZE == 64
++#include <limits.h>
++#if ULONG_MAX == 0xffffffffffffffff
+ #define ELF_R_SYM(i) ELF64_R_SYM(i)
+-#elif __WORDSIZE == 32
++#elif ULONG_MAX == 0xffffffff
+ #define ELF_R_SYM(i) ELF32_R_SYM(i)
+ #else
+ #error unsupported word size
+
+# simplify stdint.h include which failed on musl due to obscure assumptions
+--- 3rdparty/libbacktrace/backtrace.h
++++ 3rdparty/libbacktrace/backtrace.h
+@@ -36,24 +36,8 @@
+ #include <stddef.h>
+ #include <stdio.h>
+ 
+-/* We want to get a definition for uintptr_t, but we still care about
+-   systems that don't have <stdint.h>.  */
+-#if defined(__GLIBC__) && __GLIBC__ >= 2
+-
+-#include <stdint.h>
+-
+-#elif defined(HAVE_STDINT_H)
+-
+ #include <stdint.h>
+ 
+-#else
+-
+-/* Systems that don't have <stdint.h> must provide gstdint.h, e.g.,
+-   from GCC_HEADER_STDINT in configure.ac.  */
+-#include "gstdint.h"
+-
+-#endif
+-
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
diff --git a/srcpkgs/heaptrack/patches/003.uint.patch b/srcpkgs/heaptrack/patches/003.uint.patch
new file mode 100644
index 00000000000..ccf4821a5d3
--- /dev/null
+++ b/srcpkgs/heaptrack/patches/003.uint.patch
@@ -0,0 +1,49 @@
+# src: upstream/master
+
+From f540b95cc7446fbf41b4b3fa9b6f275b580de638 Mon Sep 17 00:00:00 2001
+From: Sergio Martins <smartins@kde.org>
+Date: Sun, 26 May 2019 01:48:21 +0100
+Subject: [PATCH] Use 'unsigned int' instead of 'uint'
+
+The former is cross platform and makes it buildable with MSVC.
+As it's just a couple of places there's no need for a typedef.
+---
+ src/analyze/accumulatedtracedata.cpp | 4 ++--
+ src/util/indices.h                   | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/analyze/accumulatedtracedata.cpp b/src/analyze/accumulatedtracedata.cpp
+index f3f07a7..268c17f 100644
+--- src/analyze/accumulatedtracedata.cpp
++++ src/analyze/accumulatedtracedata.cpp
+@@ -186,7 +186,7 @@ bool AccumulatedTraceData::read(istream& in, const ParsePass pass)
+     for (auto& allocation : allocations) {
+         allocation.clearCost();
+     }
+-    uint fileVersion = 0;
++    unsigned int fileVersion = 0;
+     bool debuggeeEncountered = false;
+ 
+     // required for backwards compatibility
+@@ -385,7 +385,7 @@ bool AccumulatedTraceData::read(istream& in, const ParsePass pass)
+             totalCost = {};
+             fromAttached = true;
+         } else if (reader.mode() == 'v') {
+-            uint heaptrackVersion = 0;
++            unsigned int heaptrackVersion = 0;
+             reader >> heaptrackVersion;
+             if (!(reader >> fileVersion) && heaptrackVersion == 0x010200) {
+                 // backwards compatibility: before the 1.0.0, I actually
+diff --git a/src/util/indices.h b/src/util/indices.h
+index ee1f777..8f21bba 100644
+--- src/util/indices.h
++++ src/util/indices.h
+@@ -64,7 +64,7 @@ struct Index
+ };
+ 
+ template <typename Base>
+-uint qHash(const Index<Base> index, uint seed = 0) noexcept
++unsigned int qHash(const Index<Base> index, unsigned int seed = 0) noexcept
+ {
+     return qHash(index.index, seed);
+ }
diff --git a/srcpkgs/heaptrack/patches/004.desktop.patch b/srcpkgs/heaptrack/patches/004.desktop.patch
new file mode 100644
index 00000000000..3493481e86b
--- /dev/null
+++ b/srcpkgs/heaptrack/patches/004.desktop.patch
@@ -0,0 +1,61 @@
+# src: upstream/master
+
+From f2349d480fc30cf55281218b2b8063c4e5207abb Mon Sep 17 00:00:00 2001
+From: "Friedrich W. H. Kossebau" <kossebau@kde.org>
+Date: Tue, 5 Feb 2019 04:08:55 +0100
+Subject: [PATCH] Set StartupWMClass in desktop file
+
+Used by non-Plasma unixoid X-based shells to map windows to desktop files
+e.g. in launcher UIs, which do not know about _KDE_NET_WM_DESKTOP_FILE and
+instead expect (one of) the WM_CLASS entries to match the basename of the
+desktop file by default. StartupWMClass overwrites that default.
+---
+ src/analyze/gui/org.kde.heaptrack.desktop | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/analyze/gui/org.kde.heaptrack.desktop b/src/analyze/gui/org.kde.heaptrack.desktop
+index 8c92706..ddae134 100644
+--- src/analyze/gui/org.kde.heaptrack.desktop
++++ src/analyze/gui/org.kde.heaptrack.desktop
+@@ -7,6 +7,7 @@ MimeType=application/x-heaptrack;
+ Icon=heaptrack
+ # FIXME: write docs!
+ # X-DocPath=kcachegrind/index.html
++StartupWMClass=heaptrack_gui
+ Terminal=false
+ Name=Heaptrack
+ Name[ca]=Heaptrack
+
+
+From 30ca42deadcb3bf0a73cd37806ceca5d290fbbce Mon Sep 17 00:00:00 2001
+From: "Friedrich W. H. Kossebau" <kossebau@kde.org>
+Date: Tue, 5 Feb 2019 04:23:58 +0100
+Subject: [PATCH] Add correct desktopfilename property for heaptrack_gui
+
+---
+ src/analyze/gui/gui.cpp | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/analyze/gui/gui.cpp b/src/analyze/gui/gui.cpp
+index 96048b1..846d5fb 100644
+--- src/analyze/gui/gui.cpp
++++ src/analyze/gui/gui.cpp
+@@ -19,6 +19,7 @@
+ #include <QApplication>
+ #include <QCommandLineParser>
+ 
++#include <kcoreaddons_version.h>
+ #include <KAboutData>
+ #include <KLocalizedString>
+ 
+@@ -45,7 +46,9 @@ int main(int argc, char** argv)
+                         QStringLiteral("http://milianw.de"));
+ 
+     aboutData.setOrganizationDomain("kde.org");
+-
++#if KCOREADDONS_VERSION >= QT_VERSION_CHECK(5, 16, 0)
++    aboutData.setDesktopFileName(QStringLiteral("org.kde.heaptrack"));
++#endif
+     KAboutData::setApplicationData(aboutData);
+     app.setWindowIcon(QIcon::fromTheme(QStringLiteral("office-chart-area")));
+ 
diff --git a/srcpkgs/heaptrack/template b/srcpkgs/heaptrack/template
new file mode 100644
index 00000000000..0840fb6388f
--- /dev/null
+++ b/srcpkgs/heaptrack/template
@@ -0,0 +1,28 @@
+# Template file for 'heaptrack'
+pkgname=heaptrack
+version=1.1.0
+revision=1
+build_style=cmake
+# one test fails
+configure_args="-DBUILD_TESTING=OFF"
+makedepends="boost-devel libunwind-devel zlib-devel libdwarf-devel
+ qt5-devel libzstd-devel ecm-devel"
+#gui depends
+hostmakedepends="qt5-qmake qt5-host-tools extra-cmake-modules kcoreaddons"
+makedepends+=" ki18n-devel kitemmodels-devel kio-devel
+ kconfigwidgets-devel threadweaver-devel kdiagram-devel"
+depends="gdb"
+short_desc="Heap memory profiler for Linux"
+maintainer="Piraty <piraty1@inbox.ru>"
+license="LGPL-2.1-or-later"
+homepage="https://github.com/KDE/heaptrack"
+distfiles="https://github.com/KDE/heaptrack/archive/v${version}.tar.gz"
+checksum=bd247ac67d1ecf023ec7e2a2888764bfc03e2f8b24876928ca6aa0cdb3a07309
+
+heaptrack-gui_package() {
+	short_desc+=" - GUI"
+	pkg_install() {
+		vmove usr/bin/heaptrack_gui
+		vmove usr/share
+	}
+}

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: New package: heaptrack-1.1.0
  2019-06-19 11:06 [PR PATCH] New package: heaptrack-1.1.0 voidlinux-github
                   ` (3 preceding siblings ...)
  2019-06-19 19:20 ` voidlinux-github
@ 2019-06-19 19:21 ` voidlinux-github
  2019-09-26 20:20 ` [PR PATCH] [Updated] " voidlinux-github
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: voidlinux-github @ 2019-06-19 19:21 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 219 bytes --]

New comment by Piraty on void-packages repository

https://github.com/void-linux/void-packages/pull/12549#issuecomment-503712208
Comment:
I know. I just wanted to justify the split of the vars, in case that's disliked.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PR PATCH] [Updated] New package: heaptrack-1.1.0
  2019-06-19 11:06 [PR PATCH] New package: heaptrack-1.1.0 voidlinux-github
                   ` (4 preceding siblings ...)
  2019-06-19 19:21 ` voidlinux-github
@ 2019-09-26 20:20 ` voidlinux-github
  2019-09-26 20:20 ` voidlinux-github
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: voidlinux-github @ 2019-09-26 20:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 318 bytes --]

There is an updated pull request by Piraty against master on the void-packages repository

https://github.com/Piraty/void-packages heaptrack
https://github.com/void-linux/void-packages/pull/12549

New package: heaptrack-1.1.0


A patch file from https://github.com/void-linux/void-packages/pull/12549.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-heaptrack-12549.patch --]
[-- Type: text/x-diff, Size: 11047 bytes --]

From 6f1a346885fc6d066c574b59f775be175a33f0b5 Mon Sep 17 00:00:00 2001
From: Piraty <piraty1@inbox.ru>
Date: Mon, 20 May 2019 21:08:27 +0200
Subject: [PATCH] New package: heaptrack-1.1.0

---
 srcpkgs/heaptrack-gui                         |  1 +
 .../patches/001.compile-on-32bit.patch        | 70 +++++++++++++++++++
 .../heaptrack/patches/002.musl-fixes.patch    | 68 ++++++++++++++++++
 srcpkgs/heaptrack/patches/003.uint.patch      | 49 +++++++++++++
 srcpkgs/heaptrack/patches/004.desktop.patch   | 61 ++++++++++++++++
 srcpkgs/heaptrack/template                    | 27 +++++++
 6 files changed, 276 insertions(+)
 create mode 120000 srcpkgs/heaptrack-gui
 create mode 100644 srcpkgs/heaptrack/patches/001.compile-on-32bit.patch
 create mode 100644 srcpkgs/heaptrack/patches/002.musl-fixes.patch
 create mode 100644 srcpkgs/heaptrack/patches/003.uint.patch
 create mode 100644 srcpkgs/heaptrack/patches/004.desktop.patch
 create mode 100644 srcpkgs/heaptrack/template

diff --git a/srcpkgs/heaptrack-gui b/srcpkgs/heaptrack-gui
new file mode 120000
index 00000000000..9a8c22eb92e
--- /dev/null
+++ b/srcpkgs/heaptrack-gui
@@ -0,0 +1 @@
+heaptrack
\ No newline at end of file
diff --git a/srcpkgs/heaptrack/patches/001.compile-on-32bit.patch b/srcpkgs/heaptrack/patches/001.compile-on-32bit.patch
new file mode 100644
index 00000000000..f7016cc6336
--- /dev/null
+++ b/srcpkgs/heaptrack/patches/001.compile-on-32bit.patch
@@ -0,0 +1,70 @@
+# reason: current release is unable to build on 32bit arches
+# src: upstream/master
+
+From 76fd2e84ba133e96d2cfdf90cb715e66e923eb8f Mon Sep 17 00:00:00 2001
+From: Milian Wolff <mail@milianw.de>
+Date: Thu, 17 May 2018 13:31:25 +0200
+Subject: [PATCH] Fix compile on 32bit
+
+BUG: 394330
+---
+ src/util/linewriter.h | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/src/util/linewriter.h b/src/util/linewriter.h
+index 73a7930..e895e87 100644
+--- src/util/linewriter.h
++++ src/util/linewriter.h
+@@ -158,6 +158,11 @@ class LineWriter
+         return __builtin_clzl(V);
+     }
+ 
++    inline static unsigned clz(long long unsigned V)
++    {
++        return __builtin_clzll(V);
++    }
++
+     template <typename V>
+     static char* writeHexNumber(char* buffer, V value)
+     {
+
+
+
+From 49577e019ea791ee63962cdfe7e9c0c5b5c6ea4b Mon Sep 17 00:00:00 2001
+From: Milian Wolff <milian.wolff@kdab.com>
+Date: Tue, 29 May 2018 10:41:10 +0200
+Subject: [PATCH] Fix another compile error on 32bit
+
+Introduce a user-defined _u64 literal for uint64_t
+and use that instead of ul/ull.
+
+BUG: 394330
+---
+ tests/auto/tst_io.cpp | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/tests/auto/tst_io.cpp b/tests/auto/tst_io.cpp
+index 48abda6..fd31b31 100644
+--- tests/auto/tst_io.cpp
++++ tests/auto/tst_io.cpp
+@@ -27,6 +27,11 @@
+ 
+ using namespace std;
+ 
++constexpr uint64_t operator"" _u64(unsigned long long v)
++{
++    return static_cast<uint64_t>(v);
++}
++
+ TEST_CASE ("write data", "[write]") {
+     TempFile file;
+     REQUIRE(file.open());
+@@ -124,7 +129,7 @@ TEST_CASE ("read line 64bit", "[read]") {
+     REQUIRE(reader >> module);
+     REQUIRE(module == "/tmp/KDevelop-5.2.1-x86_64/usr/lib/libKF5Completion.so.5");
+ 
+-    for (uint64_t expected : {0x7f48beedc00ul, 0x0ul, 0x36854ul, 0x236858ul, 0x2700ul}) {
++    for (auto expected : {0x7f48beedc00_u64, 0x0_u64, 0x36854_u64, 0x236858_u64, 0x2700_u64}) {
+         uint64_t addr = 0;
+         REQUIRE(reader >> addr);
+         REQUIRE(addr == expected);
diff --git a/srcpkgs/heaptrack/patches/002.musl-fixes.patch b/srcpkgs/heaptrack/patches/002.musl-fixes.patch
new file mode 100644
index 00000000000..5dde897ae18
--- /dev/null
+++ b/srcpkgs/heaptrack/patches/002.musl-fixes.patch
@@ -0,0 +1,68 @@
+# reason: fix sources to work correctly with musl
+
+--- src/track/heaptrack_inject.cpp
++++ src/track/heaptrack_inject.cpp
+@@ -27,6 +27,7 @@
+ #include <link.h>
+ #include <malloc.h>
+ #include <unistd.h>
++#include <dlfcn.h>
+ 
+ #include <sys/mman.h>
+ 
+--- src/track/libheaptrack.cpp
++++ src/track/libheaptrack.cpp
+@@ -72,7 +72,7 @@
+     return chrono::duration_cast<chrono::milliseconds>(clock::now() - startTime());
+ }
+ 
+-__pid_t gettid()
++pid_t gettid()
+ {
+     return syscall(SYS_gettid);
+ }
+
+--- src/track/heaptrack_inject.cpp
++++ src/track/heaptrack_inject.cpp
+@@ -38,9 +38,10 @@
+  * @brief Experimental support for symbol overloading after runtime injection.
+  */
+ 
+-#if __WORDSIZE == 64
++#include <limits.h>
++#if ULONG_MAX == 0xffffffffffffffff
+ #define ELF_R_SYM(i) ELF64_R_SYM(i)
+-#elif __WORDSIZE == 32
++#elif ULONG_MAX == 0xffffffff
+ #define ELF_R_SYM(i) ELF32_R_SYM(i)
+ #else
+ #error unsupported word size
+
+# simplify stdint.h include which failed on musl due to obscure assumptions
+--- 3rdparty/libbacktrace/backtrace.h
++++ 3rdparty/libbacktrace/backtrace.h
+@@ -36,24 +36,8 @@
+ #include <stddef.h>
+ #include <stdio.h>
+ 
+-/* We want to get a definition for uintptr_t, but we still care about
+-   systems that don't have <stdint.h>.  */
+-#if defined(__GLIBC__) && __GLIBC__ >= 2
+-
+-#include <stdint.h>
+-
+-#elif defined(HAVE_STDINT_H)
+-
+ #include <stdint.h>
+ 
+-#else
+-
+-/* Systems that don't have <stdint.h> must provide gstdint.h, e.g.,
+-   from GCC_HEADER_STDINT in configure.ac.  */
+-#include "gstdint.h"
+-
+-#endif
+-
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
diff --git a/srcpkgs/heaptrack/patches/003.uint.patch b/srcpkgs/heaptrack/patches/003.uint.patch
new file mode 100644
index 00000000000..ccf4821a5d3
--- /dev/null
+++ b/srcpkgs/heaptrack/patches/003.uint.patch
@@ -0,0 +1,49 @@
+# src: upstream/master
+
+From f540b95cc7446fbf41b4b3fa9b6f275b580de638 Mon Sep 17 00:00:00 2001
+From: Sergio Martins <smartins@kde.org>
+Date: Sun, 26 May 2019 01:48:21 +0100
+Subject: [PATCH] Use 'unsigned int' instead of 'uint'
+
+The former is cross platform and makes it buildable with MSVC.
+As it's just a couple of places there's no need for a typedef.
+---
+ src/analyze/accumulatedtracedata.cpp | 4 ++--
+ src/util/indices.h                   | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/analyze/accumulatedtracedata.cpp b/src/analyze/accumulatedtracedata.cpp
+index f3f07a7..268c17f 100644
+--- src/analyze/accumulatedtracedata.cpp
++++ src/analyze/accumulatedtracedata.cpp
+@@ -186,7 +186,7 @@ bool AccumulatedTraceData::read(istream& in, const ParsePass pass)
+     for (auto& allocation : allocations) {
+         allocation.clearCost();
+     }
+-    uint fileVersion = 0;
++    unsigned int fileVersion = 0;
+     bool debuggeeEncountered = false;
+ 
+     // required for backwards compatibility
+@@ -385,7 +385,7 @@ bool AccumulatedTraceData::read(istream& in, const ParsePass pass)
+             totalCost = {};
+             fromAttached = true;
+         } else if (reader.mode() == 'v') {
+-            uint heaptrackVersion = 0;
++            unsigned int heaptrackVersion = 0;
+             reader >> heaptrackVersion;
+             if (!(reader >> fileVersion) && heaptrackVersion == 0x010200) {
+                 // backwards compatibility: before the 1.0.0, I actually
+diff --git a/src/util/indices.h b/src/util/indices.h
+index ee1f777..8f21bba 100644
+--- src/util/indices.h
++++ src/util/indices.h
+@@ -64,7 +64,7 @@ struct Index
+ };
+ 
+ template <typename Base>
+-uint qHash(const Index<Base> index, uint seed = 0) noexcept
++unsigned int qHash(const Index<Base> index, unsigned int seed = 0) noexcept
+ {
+     return qHash(index.index, seed);
+ }
diff --git a/srcpkgs/heaptrack/patches/004.desktop.patch b/srcpkgs/heaptrack/patches/004.desktop.patch
new file mode 100644
index 00000000000..3493481e86b
--- /dev/null
+++ b/srcpkgs/heaptrack/patches/004.desktop.patch
@@ -0,0 +1,61 @@
+# src: upstream/master
+
+From f2349d480fc30cf55281218b2b8063c4e5207abb Mon Sep 17 00:00:00 2001
+From: "Friedrich W. H. Kossebau" <kossebau@kde.org>
+Date: Tue, 5 Feb 2019 04:08:55 +0100
+Subject: [PATCH] Set StartupWMClass in desktop file
+
+Used by non-Plasma unixoid X-based shells to map windows to desktop files
+e.g. in launcher UIs, which do not know about _KDE_NET_WM_DESKTOP_FILE and
+instead expect (one of) the WM_CLASS entries to match the basename of the
+desktop file by default. StartupWMClass overwrites that default.
+---
+ src/analyze/gui/org.kde.heaptrack.desktop | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/analyze/gui/org.kde.heaptrack.desktop b/src/analyze/gui/org.kde.heaptrack.desktop
+index 8c92706..ddae134 100644
+--- src/analyze/gui/org.kde.heaptrack.desktop
++++ src/analyze/gui/org.kde.heaptrack.desktop
+@@ -7,6 +7,7 @@ MimeType=application/x-heaptrack;
+ Icon=heaptrack
+ # FIXME: write docs!
+ # X-DocPath=kcachegrind/index.html
++StartupWMClass=heaptrack_gui
+ Terminal=false
+ Name=Heaptrack
+ Name[ca]=Heaptrack
+
+
+From 30ca42deadcb3bf0a73cd37806ceca5d290fbbce Mon Sep 17 00:00:00 2001
+From: "Friedrich W. H. Kossebau" <kossebau@kde.org>
+Date: Tue, 5 Feb 2019 04:23:58 +0100
+Subject: [PATCH] Add correct desktopfilename property for heaptrack_gui
+
+---
+ src/analyze/gui/gui.cpp | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/analyze/gui/gui.cpp b/src/analyze/gui/gui.cpp
+index 96048b1..846d5fb 100644
+--- src/analyze/gui/gui.cpp
++++ src/analyze/gui/gui.cpp
+@@ -19,6 +19,7 @@
+ #include <QApplication>
+ #include <QCommandLineParser>
+ 
++#include <kcoreaddons_version.h>
+ #include <KAboutData>
+ #include <KLocalizedString>
+ 
+@@ -45,7 +46,9 @@ int main(int argc, char** argv)
+                         QStringLiteral("http://milianw.de"));
+ 
+     aboutData.setOrganizationDomain("kde.org");
+-
++#if KCOREADDONS_VERSION >= QT_VERSION_CHECK(5, 16, 0)
++    aboutData.setDesktopFileName(QStringLiteral("org.kde.heaptrack"));
++#endif
+     KAboutData::setApplicationData(aboutData);
+     app.setWindowIcon(QIcon::fromTheme(QStringLiteral("office-chart-area")));
+ 
diff --git a/srcpkgs/heaptrack/template b/srcpkgs/heaptrack/template
new file mode 100644
index 00000000000..105fcaf5375
--- /dev/null
+++ b/srcpkgs/heaptrack/template
@@ -0,0 +1,27 @@
+# Template file for 'heaptrack'
+pkgname=heaptrack
+version=1.1.0
+revision=1
+build_style=cmake
+makedepends="boost-devel libunwind-devel zlib-devel libdwarf-devel
+ qt5-devel libzstd-devel ecm-devel"
+#gui depends (the next releases will probably split the gui)
+hostmakedepends="qt5-qmake qt5-host-tools extra-cmake-modules kcoreaddons"
+makedepends+=" ki18n-devel kitemmodels-devel kio-devel
+ kconfigwidgets-devel threadweaver-devel kdiagram-devel"
+#depends="gdb"
+short_desc="Heap memory profiler for Linux"
+maintainer="Piraty <piraty1@inbox.ru>"
+license="LGPL-2.1-or-later"
+homepage="https://github.com/KDE/heaptrack"
+distfiles="https://github.com/KDE/heaptrack/archive/v${version}.tar.gz"
+checksum=bd247ac67d1ecf023ec7e2a2888764bfc03e2f8b24876928ca6aa0cdb3a07309
+
+heaptrack-gui_package() {
+	short_desc+=" - GUI"
+	depends=
+	pkg_install() {
+		vmove usr/bin/heaptrack_gui
+		vmove usr/share
+	}
+}

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PR PATCH] [Updated] New package: heaptrack-1.1.0
  2019-06-19 11:06 [PR PATCH] New package: heaptrack-1.1.0 voidlinux-github
                   ` (5 preceding siblings ...)
  2019-09-26 20:20 ` [PR PATCH] [Updated] " voidlinux-github
@ 2019-09-26 20:20 ` voidlinux-github
  2019-09-26 22:20 ` voidlinux-github
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: voidlinux-github @ 2019-09-26 20:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 318 bytes --]

There is an updated pull request by Piraty against master on the void-packages repository

https://github.com/Piraty/void-packages heaptrack
https://github.com/void-linux/void-packages/pull/12549

New package: heaptrack-1.1.0


A patch file from https://github.com/void-linux/void-packages/pull/12549.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-heaptrack-12549.patch --]
[-- Type: text/x-diff, Size: 11047 bytes --]

From 6f1a346885fc6d066c574b59f775be175a33f0b5 Mon Sep 17 00:00:00 2001
From: Piraty <piraty1@inbox.ru>
Date: Mon, 20 May 2019 21:08:27 +0200
Subject: [PATCH] New package: heaptrack-1.1.0

---
 srcpkgs/heaptrack-gui                         |  1 +
 .../patches/001.compile-on-32bit.patch        | 70 +++++++++++++++++++
 .../heaptrack/patches/002.musl-fixes.patch    | 68 ++++++++++++++++++
 srcpkgs/heaptrack/patches/003.uint.patch      | 49 +++++++++++++
 srcpkgs/heaptrack/patches/004.desktop.patch   | 61 ++++++++++++++++
 srcpkgs/heaptrack/template                    | 27 +++++++
 6 files changed, 276 insertions(+)
 create mode 120000 srcpkgs/heaptrack-gui
 create mode 100644 srcpkgs/heaptrack/patches/001.compile-on-32bit.patch
 create mode 100644 srcpkgs/heaptrack/patches/002.musl-fixes.patch
 create mode 100644 srcpkgs/heaptrack/patches/003.uint.patch
 create mode 100644 srcpkgs/heaptrack/patches/004.desktop.patch
 create mode 100644 srcpkgs/heaptrack/template

diff --git a/srcpkgs/heaptrack-gui b/srcpkgs/heaptrack-gui
new file mode 120000
index 00000000000..9a8c22eb92e
--- /dev/null
+++ b/srcpkgs/heaptrack-gui
@@ -0,0 +1 @@
+heaptrack
\ No newline at end of file
diff --git a/srcpkgs/heaptrack/patches/001.compile-on-32bit.patch b/srcpkgs/heaptrack/patches/001.compile-on-32bit.patch
new file mode 100644
index 00000000000..f7016cc6336
--- /dev/null
+++ b/srcpkgs/heaptrack/patches/001.compile-on-32bit.patch
@@ -0,0 +1,70 @@
+# reason: current release is unable to build on 32bit arches
+# src: upstream/master
+
+From 76fd2e84ba133e96d2cfdf90cb715e66e923eb8f Mon Sep 17 00:00:00 2001
+From: Milian Wolff <mail@milianw.de>
+Date: Thu, 17 May 2018 13:31:25 +0200
+Subject: [PATCH] Fix compile on 32bit
+
+BUG: 394330
+---
+ src/util/linewriter.h | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/src/util/linewriter.h b/src/util/linewriter.h
+index 73a7930..e895e87 100644
+--- src/util/linewriter.h
++++ src/util/linewriter.h
+@@ -158,6 +158,11 @@ class LineWriter
+         return __builtin_clzl(V);
+     }
+ 
++    inline static unsigned clz(long long unsigned V)
++    {
++        return __builtin_clzll(V);
++    }
++
+     template <typename V>
+     static char* writeHexNumber(char* buffer, V value)
+     {
+
+
+
+From 49577e019ea791ee63962cdfe7e9c0c5b5c6ea4b Mon Sep 17 00:00:00 2001
+From: Milian Wolff <milian.wolff@kdab.com>
+Date: Tue, 29 May 2018 10:41:10 +0200
+Subject: [PATCH] Fix another compile error on 32bit
+
+Introduce a user-defined _u64 literal for uint64_t
+and use that instead of ul/ull.
+
+BUG: 394330
+---
+ tests/auto/tst_io.cpp | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/tests/auto/tst_io.cpp b/tests/auto/tst_io.cpp
+index 48abda6..fd31b31 100644
+--- tests/auto/tst_io.cpp
++++ tests/auto/tst_io.cpp
+@@ -27,6 +27,11 @@
+ 
+ using namespace std;
+ 
++constexpr uint64_t operator"" _u64(unsigned long long v)
++{
++    return static_cast<uint64_t>(v);
++}
++
+ TEST_CASE ("write data", "[write]") {
+     TempFile file;
+     REQUIRE(file.open());
+@@ -124,7 +129,7 @@ TEST_CASE ("read line 64bit", "[read]") {
+     REQUIRE(reader >> module);
+     REQUIRE(module == "/tmp/KDevelop-5.2.1-x86_64/usr/lib/libKF5Completion.so.5");
+ 
+-    for (uint64_t expected : {0x7f48beedc00ul, 0x0ul, 0x36854ul, 0x236858ul, 0x2700ul}) {
++    for (auto expected : {0x7f48beedc00_u64, 0x0_u64, 0x36854_u64, 0x236858_u64, 0x2700_u64}) {
+         uint64_t addr = 0;
+         REQUIRE(reader >> addr);
+         REQUIRE(addr == expected);
diff --git a/srcpkgs/heaptrack/patches/002.musl-fixes.patch b/srcpkgs/heaptrack/patches/002.musl-fixes.patch
new file mode 100644
index 00000000000..5dde897ae18
--- /dev/null
+++ b/srcpkgs/heaptrack/patches/002.musl-fixes.patch
@@ -0,0 +1,68 @@
+# reason: fix sources to work correctly with musl
+
+--- src/track/heaptrack_inject.cpp
++++ src/track/heaptrack_inject.cpp
+@@ -27,6 +27,7 @@
+ #include <link.h>
+ #include <malloc.h>
+ #include <unistd.h>
++#include <dlfcn.h>
+ 
+ #include <sys/mman.h>
+ 
+--- src/track/libheaptrack.cpp
++++ src/track/libheaptrack.cpp
+@@ -72,7 +72,7 @@
+     return chrono::duration_cast<chrono::milliseconds>(clock::now() - startTime());
+ }
+ 
+-__pid_t gettid()
++pid_t gettid()
+ {
+     return syscall(SYS_gettid);
+ }
+
+--- src/track/heaptrack_inject.cpp
++++ src/track/heaptrack_inject.cpp
+@@ -38,9 +38,10 @@
+  * @brief Experimental support for symbol overloading after runtime injection.
+  */
+ 
+-#if __WORDSIZE == 64
++#include <limits.h>
++#if ULONG_MAX == 0xffffffffffffffff
+ #define ELF_R_SYM(i) ELF64_R_SYM(i)
+-#elif __WORDSIZE == 32
++#elif ULONG_MAX == 0xffffffff
+ #define ELF_R_SYM(i) ELF32_R_SYM(i)
+ #else
+ #error unsupported word size
+
+# simplify stdint.h include which failed on musl due to obscure assumptions
+--- 3rdparty/libbacktrace/backtrace.h
++++ 3rdparty/libbacktrace/backtrace.h
+@@ -36,24 +36,8 @@
+ #include <stddef.h>
+ #include <stdio.h>
+ 
+-/* We want to get a definition for uintptr_t, but we still care about
+-   systems that don't have <stdint.h>.  */
+-#if defined(__GLIBC__) && __GLIBC__ >= 2
+-
+-#include <stdint.h>
+-
+-#elif defined(HAVE_STDINT_H)
+-
+ #include <stdint.h>
+ 
+-#else
+-
+-/* Systems that don't have <stdint.h> must provide gstdint.h, e.g.,
+-   from GCC_HEADER_STDINT in configure.ac.  */
+-#include "gstdint.h"
+-
+-#endif
+-
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
diff --git a/srcpkgs/heaptrack/patches/003.uint.patch b/srcpkgs/heaptrack/patches/003.uint.patch
new file mode 100644
index 00000000000..ccf4821a5d3
--- /dev/null
+++ b/srcpkgs/heaptrack/patches/003.uint.patch
@@ -0,0 +1,49 @@
+# src: upstream/master
+
+From f540b95cc7446fbf41b4b3fa9b6f275b580de638 Mon Sep 17 00:00:00 2001
+From: Sergio Martins <smartins@kde.org>
+Date: Sun, 26 May 2019 01:48:21 +0100
+Subject: [PATCH] Use 'unsigned int' instead of 'uint'
+
+The former is cross platform and makes it buildable with MSVC.
+As it's just a couple of places there's no need for a typedef.
+---
+ src/analyze/accumulatedtracedata.cpp | 4 ++--
+ src/util/indices.h                   | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/analyze/accumulatedtracedata.cpp b/src/analyze/accumulatedtracedata.cpp
+index f3f07a7..268c17f 100644
+--- src/analyze/accumulatedtracedata.cpp
++++ src/analyze/accumulatedtracedata.cpp
+@@ -186,7 +186,7 @@ bool AccumulatedTraceData::read(istream& in, const ParsePass pass)
+     for (auto& allocation : allocations) {
+         allocation.clearCost();
+     }
+-    uint fileVersion = 0;
++    unsigned int fileVersion = 0;
+     bool debuggeeEncountered = false;
+ 
+     // required for backwards compatibility
+@@ -385,7 +385,7 @@ bool AccumulatedTraceData::read(istream& in, const ParsePass pass)
+             totalCost = {};
+             fromAttached = true;
+         } else if (reader.mode() == 'v') {
+-            uint heaptrackVersion = 0;
++            unsigned int heaptrackVersion = 0;
+             reader >> heaptrackVersion;
+             if (!(reader >> fileVersion) && heaptrackVersion == 0x010200) {
+                 // backwards compatibility: before the 1.0.0, I actually
+diff --git a/src/util/indices.h b/src/util/indices.h
+index ee1f777..8f21bba 100644
+--- src/util/indices.h
++++ src/util/indices.h
+@@ -64,7 +64,7 @@ struct Index
+ };
+ 
+ template <typename Base>
+-uint qHash(const Index<Base> index, uint seed = 0) noexcept
++unsigned int qHash(const Index<Base> index, unsigned int seed = 0) noexcept
+ {
+     return qHash(index.index, seed);
+ }
diff --git a/srcpkgs/heaptrack/patches/004.desktop.patch b/srcpkgs/heaptrack/patches/004.desktop.patch
new file mode 100644
index 00000000000..3493481e86b
--- /dev/null
+++ b/srcpkgs/heaptrack/patches/004.desktop.patch
@@ -0,0 +1,61 @@
+# src: upstream/master
+
+From f2349d480fc30cf55281218b2b8063c4e5207abb Mon Sep 17 00:00:00 2001
+From: "Friedrich W. H. Kossebau" <kossebau@kde.org>
+Date: Tue, 5 Feb 2019 04:08:55 +0100
+Subject: [PATCH] Set StartupWMClass in desktop file
+
+Used by non-Plasma unixoid X-based shells to map windows to desktop files
+e.g. in launcher UIs, which do not know about _KDE_NET_WM_DESKTOP_FILE and
+instead expect (one of) the WM_CLASS entries to match the basename of the
+desktop file by default. StartupWMClass overwrites that default.
+---
+ src/analyze/gui/org.kde.heaptrack.desktop | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/analyze/gui/org.kde.heaptrack.desktop b/src/analyze/gui/org.kde.heaptrack.desktop
+index 8c92706..ddae134 100644
+--- src/analyze/gui/org.kde.heaptrack.desktop
++++ src/analyze/gui/org.kde.heaptrack.desktop
+@@ -7,6 +7,7 @@ MimeType=application/x-heaptrack;
+ Icon=heaptrack
+ # FIXME: write docs!
+ # X-DocPath=kcachegrind/index.html
++StartupWMClass=heaptrack_gui
+ Terminal=false
+ Name=Heaptrack
+ Name[ca]=Heaptrack
+
+
+From 30ca42deadcb3bf0a73cd37806ceca5d290fbbce Mon Sep 17 00:00:00 2001
+From: "Friedrich W. H. Kossebau" <kossebau@kde.org>
+Date: Tue, 5 Feb 2019 04:23:58 +0100
+Subject: [PATCH] Add correct desktopfilename property for heaptrack_gui
+
+---
+ src/analyze/gui/gui.cpp | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/analyze/gui/gui.cpp b/src/analyze/gui/gui.cpp
+index 96048b1..846d5fb 100644
+--- src/analyze/gui/gui.cpp
++++ src/analyze/gui/gui.cpp
+@@ -19,6 +19,7 @@
+ #include <QApplication>
+ #include <QCommandLineParser>
+ 
++#include <kcoreaddons_version.h>
+ #include <KAboutData>
+ #include <KLocalizedString>
+ 
+@@ -45,7 +46,9 @@ int main(int argc, char** argv)
+                         QStringLiteral("http://milianw.de"));
+ 
+     aboutData.setOrganizationDomain("kde.org");
+-
++#if KCOREADDONS_VERSION >= QT_VERSION_CHECK(5, 16, 0)
++    aboutData.setDesktopFileName(QStringLiteral("org.kde.heaptrack"));
++#endif
+     KAboutData::setApplicationData(aboutData);
+     app.setWindowIcon(QIcon::fromTheme(QStringLiteral("office-chart-area")));
+ 
diff --git a/srcpkgs/heaptrack/template b/srcpkgs/heaptrack/template
new file mode 100644
index 00000000000..105fcaf5375
--- /dev/null
+++ b/srcpkgs/heaptrack/template
@@ -0,0 +1,27 @@
+# Template file for 'heaptrack'
+pkgname=heaptrack
+version=1.1.0
+revision=1
+build_style=cmake
+makedepends="boost-devel libunwind-devel zlib-devel libdwarf-devel
+ qt5-devel libzstd-devel ecm-devel"
+#gui depends (the next releases will probably split the gui)
+hostmakedepends="qt5-qmake qt5-host-tools extra-cmake-modules kcoreaddons"
+makedepends+=" ki18n-devel kitemmodels-devel kio-devel
+ kconfigwidgets-devel threadweaver-devel kdiagram-devel"
+#depends="gdb"
+short_desc="Heap memory profiler for Linux"
+maintainer="Piraty <piraty1@inbox.ru>"
+license="LGPL-2.1-or-later"
+homepage="https://github.com/KDE/heaptrack"
+distfiles="https://github.com/KDE/heaptrack/archive/v${version}.tar.gz"
+checksum=bd247ac67d1ecf023ec7e2a2888764bfc03e2f8b24876928ca6aa0cdb3a07309
+
+heaptrack-gui_package() {
+	short_desc+=" - GUI"
+	depends=
+	pkg_install() {
+		vmove usr/bin/heaptrack_gui
+		vmove usr/share
+	}
+}

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PR PATCH] [Updated] New package: heaptrack-1.1.0
  2019-06-19 11:06 [PR PATCH] New package: heaptrack-1.1.0 voidlinux-github
                   ` (7 preceding siblings ...)
  2019-09-26 22:20 ` voidlinux-github
@ 2019-09-26 22:20 ` voidlinux-github
  2019-09-28 22:29 ` voidlinux-github
  2019-09-28 22:29 ` voidlinux-github
  10 siblings, 0 replies; 12+ messages in thread
From: voidlinux-github @ 2019-09-26 22:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 318 bytes --]

There is an updated pull request by Piraty against master on the void-packages repository

https://github.com/Piraty/void-packages heaptrack
https://github.com/void-linux/void-packages/pull/12549

New package: heaptrack-1.1.0


A patch file from https://github.com/void-linux/void-packages/pull/12549.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-heaptrack-12549.patch --]
[-- Type: text/x-diff, Size: 10967 bytes --]

From f27e1f5cb5638f6a19bb5133a9c9adb957abc51a Mon Sep 17 00:00:00 2001
From: Piraty <piraty1@inbox.ru>
Date: Mon, 20 May 2019 21:08:27 +0200
Subject: [PATCH] New package: heaptrack-1.1.0

---
 srcpkgs/heaptrack-gui                         |  1 +
 .../patches/001.compile-on-32bit.patch        | 70 +++++++++++++++++++
 .../heaptrack/patches/002.musl-fixes.patch    | 68 ++++++++++++++++++
 srcpkgs/heaptrack/patches/003.uint.patch      | 49 +++++++++++++
 srcpkgs/heaptrack/patches/004.desktop.patch   | 61 ++++++++++++++++
 srcpkgs/heaptrack/template                    | 25 +++++++
 6 files changed, 274 insertions(+)
 create mode 120000 srcpkgs/heaptrack-gui
 create mode 100644 srcpkgs/heaptrack/patches/001.compile-on-32bit.patch
 create mode 100644 srcpkgs/heaptrack/patches/002.musl-fixes.patch
 create mode 100644 srcpkgs/heaptrack/patches/003.uint.patch
 create mode 100644 srcpkgs/heaptrack/patches/004.desktop.patch
 create mode 100644 srcpkgs/heaptrack/template

diff --git a/srcpkgs/heaptrack-gui b/srcpkgs/heaptrack-gui
new file mode 120000
index 00000000000..9a8c22eb92e
--- /dev/null
+++ b/srcpkgs/heaptrack-gui
@@ -0,0 +1 @@
+heaptrack
\ No newline at end of file
diff --git a/srcpkgs/heaptrack/patches/001.compile-on-32bit.patch b/srcpkgs/heaptrack/patches/001.compile-on-32bit.patch
new file mode 100644
index 00000000000..f7016cc6336
--- /dev/null
+++ b/srcpkgs/heaptrack/patches/001.compile-on-32bit.patch
@@ -0,0 +1,70 @@
+# reason: current release is unable to build on 32bit arches
+# src: upstream/master
+
+From 76fd2e84ba133e96d2cfdf90cb715e66e923eb8f Mon Sep 17 00:00:00 2001
+From: Milian Wolff <mail@milianw.de>
+Date: Thu, 17 May 2018 13:31:25 +0200
+Subject: [PATCH] Fix compile on 32bit
+
+BUG: 394330
+---
+ src/util/linewriter.h | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/src/util/linewriter.h b/src/util/linewriter.h
+index 73a7930..e895e87 100644
+--- src/util/linewriter.h
++++ src/util/linewriter.h
+@@ -158,6 +158,11 @@ class LineWriter
+         return __builtin_clzl(V);
+     }
+ 
++    inline static unsigned clz(long long unsigned V)
++    {
++        return __builtin_clzll(V);
++    }
++
+     template <typename V>
+     static char* writeHexNumber(char* buffer, V value)
+     {
+
+
+
+From 49577e019ea791ee63962cdfe7e9c0c5b5c6ea4b Mon Sep 17 00:00:00 2001
+From: Milian Wolff <milian.wolff@kdab.com>
+Date: Tue, 29 May 2018 10:41:10 +0200
+Subject: [PATCH] Fix another compile error on 32bit
+
+Introduce a user-defined _u64 literal for uint64_t
+and use that instead of ul/ull.
+
+BUG: 394330
+---
+ tests/auto/tst_io.cpp | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/tests/auto/tst_io.cpp b/tests/auto/tst_io.cpp
+index 48abda6..fd31b31 100644
+--- tests/auto/tst_io.cpp
++++ tests/auto/tst_io.cpp
+@@ -27,6 +27,11 @@
+ 
+ using namespace std;
+ 
++constexpr uint64_t operator"" _u64(unsigned long long v)
++{
++    return static_cast<uint64_t>(v);
++}
++
+ TEST_CASE ("write data", "[write]") {
+     TempFile file;
+     REQUIRE(file.open());
+@@ -124,7 +129,7 @@ TEST_CASE ("read line 64bit", "[read]") {
+     REQUIRE(reader >> module);
+     REQUIRE(module == "/tmp/KDevelop-5.2.1-x86_64/usr/lib/libKF5Completion.so.5");
+ 
+-    for (uint64_t expected : {0x7f48beedc00ul, 0x0ul, 0x36854ul, 0x236858ul, 0x2700ul}) {
++    for (auto expected : {0x7f48beedc00_u64, 0x0_u64, 0x36854_u64, 0x236858_u64, 0x2700_u64}) {
+         uint64_t addr = 0;
+         REQUIRE(reader >> addr);
+         REQUIRE(addr == expected);
diff --git a/srcpkgs/heaptrack/patches/002.musl-fixes.patch b/srcpkgs/heaptrack/patches/002.musl-fixes.patch
new file mode 100644
index 00000000000..5dde897ae18
--- /dev/null
+++ b/srcpkgs/heaptrack/patches/002.musl-fixes.patch
@@ -0,0 +1,68 @@
+# reason: fix sources to work correctly with musl
+
+--- src/track/heaptrack_inject.cpp
++++ src/track/heaptrack_inject.cpp
+@@ -27,6 +27,7 @@
+ #include <link.h>
+ #include <malloc.h>
+ #include <unistd.h>
++#include <dlfcn.h>
+ 
+ #include <sys/mman.h>
+ 
+--- src/track/libheaptrack.cpp
++++ src/track/libheaptrack.cpp
+@@ -72,7 +72,7 @@
+     return chrono::duration_cast<chrono::milliseconds>(clock::now() - startTime());
+ }
+ 
+-__pid_t gettid()
++pid_t gettid()
+ {
+     return syscall(SYS_gettid);
+ }
+
+--- src/track/heaptrack_inject.cpp
++++ src/track/heaptrack_inject.cpp
+@@ -38,9 +38,10 @@
+  * @brief Experimental support for symbol overloading after runtime injection.
+  */
+ 
+-#if __WORDSIZE == 64
++#include <limits.h>
++#if ULONG_MAX == 0xffffffffffffffff
+ #define ELF_R_SYM(i) ELF64_R_SYM(i)
+-#elif __WORDSIZE == 32
++#elif ULONG_MAX == 0xffffffff
+ #define ELF_R_SYM(i) ELF32_R_SYM(i)
+ #else
+ #error unsupported word size
+
+# simplify stdint.h include which failed on musl due to obscure assumptions
+--- 3rdparty/libbacktrace/backtrace.h
++++ 3rdparty/libbacktrace/backtrace.h
+@@ -36,24 +36,8 @@
+ #include <stddef.h>
+ #include <stdio.h>
+ 
+-/* We want to get a definition for uintptr_t, but we still care about
+-   systems that don't have <stdint.h>.  */
+-#if defined(__GLIBC__) && __GLIBC__ >= 2
+-
+-#include <stdint.h>
+-
+-#elif defined(HAVE_STDINT_H)
+-
+ #include <stdint.h>
+ 
+-#else
+-
+-/* Systems that don't have <stdint.h> must provide gstdint.h, e.g.,
+-   from GCC_HEADER_STDINT in configure.ac.  */
+-#include "gstdint.h"
+-
+-#endif
+-
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
diff --git a/srcpkgs/heaptrack/patches/003.uint.patch b/srcpkgs/heaptrack/patches/003.uint.patch
new file mode 100644
index 00000000000..ccf4821a5d3
--- /dev/null
+++ b/srcpkgs/heaptrack/patches/003.uint.patch
@@ -0,0 +1,49 @@
+# src: upstream/master
+
+From f540b95cc7446fbf41b4b3fa9b6f275b580de638 Mon Sep 17 00:00:00 2001
+From: Sergio Martins <smartins@kde.org>
+Date: Sun, 26 May 2019 01:48:21 +0100
+Subject: [PATCH] Use 'unsigned int' instead of 'uint'
+
+The former is cross platform and makes it buildable with MSVC.
+As it's just a couple of places there's no need for a typedef.
+---
+ src/analyze/accumulatedtracedata.cpp | 4 ++--
+ src/util/indices.h                   | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/analyze/accumulatedtracedata.cpp b/src/analyze/accumulatedtracedata.cpp
+index f3f07a7..268c17f 100644
+--- src/analyze/accumulatedtracedata.cpp
++++ src/analyze/accumulatedtracedata.cpp
+@@ -186,7 +186,7 @@ bool AccumulatedTraceData::read(istream& in, const ParsePass pass)
+     for (auto& allocation : allocations) {
+         allocation.clearCost();
+     }
+-    uint fileVersion = 0;
++    unsigned int fileVersion = 0;
+     bool debuggeeEncountered = false;
+ 
+     // required for backwards compatibility
+@@ -385,7 +385,7 @@ bool AccumulatedTraceData::read(istream& in, const ParsePass pass)
+             totalCost = {};
+             fromAttached = true;
+         } else if (reader.mode() == 'v') {
+-            uint heaptrackVersion = 0;
++            unsigned int heaptrackVersion = 0;
+             reader >> heaptrackVersion;
+             if (!(reader >> fileVersion) && heaptrackVersion == 0x010200) {
+                 // backwards compatibility: before the 1.0.0, I actually
+diff --git a/src/util/indices.h b/src/util/indices.h
+index ee1f777..8f21bba 100644
+--- src/util/indices.h
++++ src/util/indices.h
+@@ -64,7 +64,7 @@ struct Index
+ };
+ 
+ template <typename Base>
+-uint qHash(const Index<Base> index, uint seed = 0) noexcept
++unsigned int qHash(const Index<Base> index, unsigned int seed = 0) noexcept
+ {
+     return qHash(index.index, seed);
+ }
diff --git a/srcpkgs/heaptrack/patches/004.desktop.patch b/srcpkgs/heaptrack/patches/004.desktop.patch
new file mode 100644
index 00000000000..3493481e86b
--- /dev/null
+++ b/srcpkgs/heaptrack/patches/004.desktop.patch
@@ -0,0 +1,61 @@
+# src: upstream/master
+
+From f2349d480fc30cf55281218b2b8063c4e5207abb Mon Sep 17 00:00:00 2001
+From: "Friedrich W. H. Kossebau" <kossebau@kde.org>
+Date: Tue, 5 Feb 2019 04:08:55 +0100
+Subject: [PATCH] Set StartupWMClass in desktop file
+
+Used by non-Plasma unixoid X-based shells to map windows to desktop files
+e.g. in launcher UIs, which do not know about _KDE_NET_WM_DESKTOP_FILE and
+instead expect (one of) the WM_CLASS entries to match the basename of the
+desktop file by default. StartupWMClass overwrites that default.
+---
+ src/analyze/gui/org.kde.heaptrack.desktop | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/analyze/gui/org.kde.heaptrack.desktop b/src/analyze/gui/org.kde.heaptrack.desktop
+index 8c92706..ddae134 100644
+--- src/analyze/gui/org.kde.heaptrack.desktop
++++ src/analyze/gui/org.kde.heaptrack.desktop
+@@ -7,6 +7,7 @@ MimeType=application/x-heaptrack;
+ Icon=heaptrack
+ # FIXME: write docs!
+ # X-DocPath=kcachegrind/index.html
++StartupWMClass=heaptrack_gui
+ Terminal=false
+ Name=Heaptrack
+ Name[ca]=Heaptrack
+
+
+From 30ca42deadcb3bf0a73cd37806ceca5d290fbbce Mon Sep 17 00:00:00 2001
+From: "Friedrich W. H. Kossebau" <kossebau@kde.org>
+Date: Tue, 5 Feb 2019 04:23:58 +0100
+Subject: [PATCH] Add correct desktopfilename property for heaptrack_gui
+
+---
+ src/analyze/gui/gui.cpp | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/analyze/gui/gui.cpp b/src/analyze/gui/gui.cpp
+index 96048b1..846d5fb 100644
+--- src/analyze/gui/gui.cpp
++++ src/analyze/gui/gui.cpp
+@@ -19,6 +19,7 @@
+ #include <QApplication>
+ #include <QCommandLineParser>
+ 
++#include <kcoreaddons_version.h>
+ #include <KAboutData>
+ #include <KLocalizedString>
+ 
+@@ -45,7 +46,9 @@ int main(int argc, char** argv)
+                         QStringLiteral("http://milianw.de"));
+ 
+     aboutData.setOrganizationDomain("kde.org");
+-
++#if KCOREADDONS_VERSION >= QT_VERSION_CHECK(5, 16, 0)
++    aboutData.setDesktopFileName(QStringLiteral("org.kde.heaptrack"));
++#endif
+     KAboutData::setApplicationData(aboutData);
+     app.setWindowIcon(QIcon::fromTheme(QStringLiteral("office-chart-area")));
+ 
diff --git a/srcpkgs/heaptrack/template b/srcpkgs/heaptrack/template
new file mode 100644
index 00000000000..49aa72e4ca1
--- /dev/null
+++ b/srcpkgs/heaptrack/template
@@ -0,0 +1,25 @@
+# Template file for 'heaptrack'
+pkgname=heaptrack
+version=1.1.0
+revision=1
+build_style=cmake
+hostmakedepends="qt5-qmake qt5-host-tools extra-cmake-modules kcoreaddons"
+makedepends="boost-devel libunwind-devel zlib-devel libdwarf-devel
+ qt5-devel libzstd-devel ecm-devel ki18n-devel kitemmodels-devel kio-devel
+ kconfigwidgets-devel threadweaver-devel kdiagram-devel"
+depends="gdb"
+short_desc="Heap memory profiler for Linux"
+maintainer="Piraty <piraty1@inbox.ru>"
+license="LGPL-2.1-or-later"
+homepage="https://github.com/KDE/heaptrack"
+distfiles="https://github.com/KDE/heaptrack/archive/v${version}.tar.gz"
+checksum=bd247ac67d1ecf023ec7e2a2888764bfc03e2f8b24876928ca6aa0cdb3a07309
+
+heaptrack-gui_package() {
+	short_desc+=" - GUI"
+	depends=
+	pkg_install() {
+		vmove usr/bin/heaptrack_gui
+		vmove usr/share
+	}
+}

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PR PATCH] [Updated] New package: heaptrack-1.1.0
  2019-06-19 11:06 [PR PATCH] New package: heaptrack-1.1.0 voidlinux-github
                   ` (6 preceding siblings ...)
  2019-09-26 20:20 ` voidlinux-github
@ 2019-09-26 22:20 ` voidlinux-github
  2019-09-26 22:20 ` voidlinux-github
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: voidlinux-github @ 2019-09-26 22:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 318 bytes --]

There is an updated pull request by Piraty against master on the void-packages repository

https://github.com/Piraty/void-packages heaptrack
https://github.com/void-linux/void-packages/pull/12549

New package: heaptrack-1.1.0


A patch file from https://github.com/void-linux/void-packages/pull/12549.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-heaptrack-12549.patch --]
[-- Type: text/x-diff, Size: 10967 bytes --]

From f27e1f5cb5638f6a19bb5133a9c9adb957abc51a Mon Sep 17 00:00:00 2001
From: Piraty <piraty1@inbox.ru>
Date: Mon, 20 May 2019 21:08:27 +0200
Subject: [PATCH] New package: heaptrack-1.1.0

---
 srcpkgs/heaptrack-gui                         |  1 +
 .../patches/001.compile-on-32bit.patch        | 70 +++++++++++++++++++
 .../heaptrack/patches/002.musl-fixes.patch    | 68 ++++++++++++++++++
 srcpkgs/heaptrack/patches/003.uint.patch      | 49 +++++++++++++
 srcpkgs/heaptrack/patches/004.desktop.patch   | 61 ++++++++++++++++
 srcpkgs/heaptrack/template                    | 25 +++++++
 6 files changed, 274 insertions(+)
 create mode 120000 srcpkgs/heaptrack-gui
 create mode 100644 srcpkgs/heaptrack/patches/001.compile-on-32bit.patch
 create mode 100644 srcpkgs/heaptrack/patches/002.musl-fixes.patch
 create mode 100644 srcpkgs/heaptrack/patches/003.uint.patch
 create mode 100644 srcpkgs/heaptrack/patches/004.desktop.patch
 create mode 100644 srcpkgs/heaptrack/template

diff --git a/srcpkgs/heaptrack-gui b/srcpkgs/heaptrack-gui
new file mode 120000
index 00000000000..9a8c22eb92e
--- /dev/null
+++ b/srcpkgs/heaptrack-gui
@@ -0,0 +1 @@
+heaptrack
\ No newline at end of file
diff --git a/srcpkgs/heaptrack/patches/001.compile-on-32bit.patch b/srcpkgs/heaptrack/patches/001.compile-on-32bit.patch
new file mode 100644
index 00000000000..f7016cc6336
--- /dev/null
+++ b/srcpkgs/heaptrack/patches/001.compile-on-32bit.patch
@@ -0,0 +1,70 @@
+# reason: current release is unable to build on 32bit arches
+# src: upstream/master
+
+From 76fd2e84ba133e96d2cfdf90cb715e66e923eb8f Mon Sep 17 00:00:00 2001
+From: Milian Wolff <mail@milianw.de>
+Date: Thu, 17 May 2018 13:31:25 +0200
+Subject: [PATCH] Fix compile on 32bit
+
+BUG: 394330
+---
+ src/util/linewriter.h | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/src/util/linewriter.h b/src/util/linewriter.h
+index 73a7930..e895e87 100644
+--- src/util/linewriter.h
++++ src/util/linewriter.h
+@@ -158,6 +158,11 @@ class LineWriter
+         return __builtin_clzl(V);
+     }
+ 
++    inline static unsigned clz(long long unsigned V)
++    {
++        return __builtin_clzll(V);
++    }
++
+     template <typename V>
+     static char* writeHexNumber(char* buffer, V value)
+     {
+
+
+
+From 49577e019ea791ee63962cdfe7e9c0c5b5c6ea4b Mon Sep 17 00:00:00 2001
+From: Milian Wolff <milian.wolff@kdab.com>
+Date: Tue, 29 May 2018 10:41:10 +0200
+Subject: [PATCH] Fix another compile error on 32bit
+
+Introduce a user-defined _u64 literal for uint64_t
+and use that instead of ul/ull.
+
+BUG: 394330
+---
+ tests/auto/tst_io.cpp | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/tests/auto/tst_io.cpp b/tests/auto/tst_io.cpp
+index 48abda6..fd31b31 100644
+--- tests/auto/tst_io.cpp
++++ tests/auto/tst_io.cpp
+@@ -27,6 +27,11 @@
+ 
+ using namespace std;
+ 
++constexpr uint64_t operator"" _u64(unsigned long long v)
++{
++    return static_cast<uint64_t>(v);
++}
++
+ TEST_CASE ("write data", "[write]") {
+     TempFile file;
+     REQUIRE(file.open());
+@@ -124,7 +129,7 @@ TEST_CASE ("read line 64bit", "[read]") {
+     REQUIRE(reader >> module);
+     REQUIRE(module == "/tmp/KDevelop-5.2.1-x86_64/usr/lib/libKF5Completion.so.5");
+ 
+-    for (uint64_t expected : {0x7f48beedc00ul, 0x0ul, 0x36854ul, 0x236858ul, 0x2700ul}) {
++    for (auto expected : {0x7f48beedc00_u64, 0x0_u64, 0x36854_u64, 0x236858_u64, 0x2700_u64}) {
+         uint64_t addr = 0;
+         REQUIRE(reader >> addr);
+         REQUIRE(addr == expected);
diff --git a/srcpkgs/heaptrack/patches/002.musl-fixes.patch b/srcpkgs/heaptrack/patches/002.musl-fixes.patch
new file mode 100644
index 00000000000..5dde897ae18
--- /dev/null
+++ b/srcpkgs/heaptrack/patches/002.musl-fixes.patch
@@ -0,0 +1,68 @@
+# reason: fix sources to work correctly with musl
+
+--- src/track/heaptrack_inject.cpp
++++ src/track/heaptrack_inject.cpp
+@@ -27,6 +27,7 @@
+ #include <link.h>
+ #include <malloc.h>
+ #include <unistd.h>
++#include <dlfcn.h>
+ 
+ #include <sys/mman.h>
+ 
+--- src/track/libheaptrack.cpp
++++ src/track/libheaptrack.cpp
+@@ -72,7 +72,7 @@
+     return chrono::duration_cast<chrono::milliseconds>(clock::now() - startTime());
+ }
+ 
+-__pid_t gettid()
++pid_t gettid()
+ {
+     return syscall(SYS_gettid);
+ }
+
+--- src/track/heaptrack_inject.cpp
++++ src/track/heaptrack_inject.cpp
+@@ -38,9 +38,10 @@
+  * @brief Experimental support for symbol overloading after runtime injection.
+  */
+ 
+-#if __WORDSIZE == 64
++#include <limits.h>
++#if ULONG_MAX == 0xffffffffffffffff
+ #define ELF_R_SYM(i) ELF64_R_SYM(i)
+-#elif __WORDSIZE == 32
++#elif ULONG_MAX == 0xffffffff
+ #define ELF_R_SYM(i) ELF32_R_SYM(i)
+ #else
+ #error unsupported word size
+
+# simplify stdint.h include which failed on musl due to obscure assumptions
+--- 3rdparty/libbacktrace/backtrace.h
++++ 3rdparty/libbacktrace/backtrace.h
+@@ -36,24 +36,8 @@
+ #include <stddef.h>
+ #include <stdio.h>
+ 
+-/* We want to get a definition for uintptr_t, but we still care about
+-   systems that don't have <stdint.h>.  */
+-#if defined(__GLIBC__) && __GLIBC__ >= 2
+-
+-#include <stdint.h>
+-
+-#elif defined(HAVE_STDINT_H)
+-
+ #include <stdint.h>
+ 
+-#else
+-
+-/* Systems that don't have <stdint.h> must provide gstdint.h, e.g.,
+-   from GCC_HEADER_STDINT in configure.ac.  */
+-#include "gstdint.h"
+-
+-#endif
+-
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
diff --git a/srcpkgs/heaptrack/patches/003.uint.patch b/srcpkgs/heaptrack/patches/003.uint.patch
new file mode 100644
index 00000000000..ccf4821a5d3
--- /dev/null
+++ b/srcpkgs/heaptrack/patches/003.uint.patch
@@ -0,0 +1,49 @@
+# src: upstream/master
+
+From f540b95cc7446fbf41b4b3fa9b6f275b580de638 Mon Sep 17 00:00:00 2001
+From: Sergio Martins <smartins@kde.org>
+Date: Sun, 26 May 2019 01:48:21 +0100
+Subject: [PATCH] Use 'unsigned int' instead of 'uint'
+
+The former is cross platform and makes it buildable with MSVC.
+As it's just a couple of places there's no need for a typedef.
+---
+ src/analyze/accumulatedtracedata.cpp | 4 ++--
+ src/util/indices.h                   | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/analyze/accumulatedtracedata.cpp b/src/analyze/accumulatedtracedata.cpp
+index f3f07a7..268c17f 100644
+--- src/analyze/accumulatedtracedata.cpp
++++ src/analyze/accumulatedtracedata.cpp
+@@ -186,7 +186,7 @@ bool AccumulatedTraceData::read(istream& in, const ParsePass pass)
+     for (auto& allocation : allocations) {
+         allocation.clearCost();
+     }
+-    uint fileVersion = 0;
++    unsigned int fileVersion = 0;
+     bool debuggeeEncountered = false;
+ 
+     // required for backwards compatibility
+@@ -385,7 +385,7 @@ bool AccumulatedTraceData::read(istream& in, const ParsePass pass)
+             totalCost = {};
+             fromAttached = true;
+         } else if (reader.mode() == 'v') {
+-            uint heaptrackVersion = 0;
++            unsigned int heaptrackVersion = 0;
+             reader >> heaptrackVersion;
+             if (!(reader >> fileVersion) && heaptrackVersion == 0x010200) {
+                 // backwards compatibility: before the 1.0.0, I actually
+diff --git a/src/util/indices.h b/src/util/indices.h
+index ee1f777..8f21bba 100644
+--- src/util/indices.h
++++ src/util/indices.h
+@@ -64,7 +64,7 @@ struct Index
+ };
+ 
+ template <typename Base>
+-uint qHash(const Index<Base> index, uint seed = 0) noexcept
++unsigned int qHash(const Index<Base> index, unsigned int seed = 0) noexcept
+ {
+     return qHash(index.index, seed);
+ }
diff --git a/srcpkgs/heaptrack/patches/004.desktop.patch b/srcpkgs/heaptrack/patches/004.desktop.patch
new file mode 100644
index 00000000000..3493481e86b
--- /dev/null
+++ b/srcpkgs/heaptrack/patches/004.desktop.patch
@@ -0,0 +1,61 @@
+# src: upstream/master
+
+From f2349d480fc30cf55281218b2b8063c4e5207abb Mon Sep 17 00:00:00 2001
+From: "Friedrich W. H. Kossebau" <kossebau@kde.org>
+Date: Tue, 5 Feb 2019 04:08:55 +0100
+Subject: [PATCH] Set StartupWMClass in desktop file
+
+Used by non-Plasma unixoid X-based shells to map windows to desktop files
+e.g. in launcher UIs, which do not know about _KDE_NET_WM_DESKTOP_FILE and
+instead expect (one of) the WM_CLASS entries to match the basename of the
+desktop file by default. StartupWMClass overwrites that default.
+---
+ src/analyze/gui/org.kde.heaptrack.desktop | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/analyze/gui/org.kde.heaptrack.desktop b/src/analyze/gui/org.kde.heaptrack.desktop
+index 8c92706..ddae134 100644
+--- src/analyze/gui/org.kde.heaptrack.desktop
++++ src/analyze/gui/org.kde.heaptrack.desktop
+@@ -7,6 +7,7 @@ MimeType=application/x-heaptrack;
+ Icon=heaptrack
+ # FIXME: write docs!
+ # X-DocPath=kcachegrind/index.html
++StartupWMClass=heaptrack_gui
+ Terminal=false
+ Name=Heaptrack
+ Name[ca]=Heaptrack
+
+
+From 30ca42deadcb3bf0a73cd37806ceca5d290fbbce Mon Sep 17 00:00:00 2001
+From: "Friedrich W. H. Kossebau" <kossebau@kde.org>
+Date: Tue, 5 Feb 2019 04:23:58 +0100
+Subject: [PATCH] Add correct desktopfilename property for heaptrack_gui
+
+---
+ src/analyze/gui/gui.cpp | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/analyze/gui/gui.cpp b/src/analyze/gui/gui.cpp
+index 96048b1..846d5fb 100644
+--- src/analyze/gui/gui.cpp
++++ src/analyze/gui/gui.cpp
+@@ -19,6 +19,7 @@
+ #include <QApplication>
+ #include <QCommandLineParser>
+ 
++#include <kcoreaddons_version.h>
+ #include <KAboutData>
+ #include <KLocalizedString>
+ 
+@@ -45,7 +46,9 @@ int main(int argc, char** argv)
+                         QStringLiteral("http://milianw.de"));
+ 
+     aboutData.setOrganizationDomain("kde.org");
+-
++#if KCOREADDONS_VERSION >= QT_VERSION_CHECK(5, 16, 0)
++    aboutData.setDesktopFileName(QStringLiteral("org.kde.heaptrack"));
++#endif
+     KAboutData::setApplicationData(aboutData);
+     app.setWindowIcon(QIcon::fromTheme(QStringLiteral("office-chart-area")));
+ 
diff --git a/srcpkgs/heaptrack/template b/srcpkgs/heaptrack/template
new file mode 100644
index 00000000000..49aa72e4ca1
--- /dev/null
+++ b/srcpkgs/heaptrack/template
@@ -0,0 +1,25 @@
+# Template file for 'heaptrack'
+pkgname=heaptrack
+version=1.1.0
+revision=1
+build_style=cmake
+hostmakedepends="qt5-qmake qt5-host-tools extra-cmake-modules kcoreaddons"
+makedepends="boost-devel libunwind-devel zlib-devel libdwarf-devel
+ qt5-devel libzstd-devel ecm-devel ki18n-devel kitemmodels-devel kio-devel
+ kconfigwidgets-devel threadweaver-devel kdiagram-devel"
+depends="gdb"
+short_desc="Heap memory profiler for Linux"
+maintainer="Piraty <piraty1@inbox.ru>"
+license="LGPL-2.1-or-later"
+homepage="https://github.com/KDE/heaptrack"
+distfiles="https://github.com/KDE/heaptrack/archive/v${version}.tar.gz"
+checksum=bd247ac67d1ecf023ec7e2a2888764bfc03e2f8b24876928ca6aa0cdb3a07309
+
+heaptrack-gui_package() {
+	short_desc+=" - GUI"
+	depends=
+	pkg_install() {
+		vmove usr/bin/heaptrack_gui
+		vmove usr/share
+	}
+}

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PR PATCH] [Updated] New package: heaptrack-1.1.0
  2019-06-19 11:06 [PR PATCH] New package: heaptrack-1.1.0 voidlinux-github
                   ` (8 preceding siblings ...)
  2019-09-26 22:20 ` voidlinux-github
@ 2019-09-28 22:29 ` voidlinux-github
  2019-09-28 22:29 ` voidlinux-github
  10 siblings, 0 replies; 12+ messages in thread
From: voidlinux-github @ 2019-09-28 22:29 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 318 bytes --]

There is an updated pull request by Piraty against master on the void-packages repository

https://github.com/Piraty/void-packages heaptrack
https://github.com/void-linux/void-packages/pull/12549

New package: heaptrack-1.1.0


A patch file from https://github.com/void-linux/void-packages/pull/12549.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-heaptrack-12549.patch --]
[-- Type: text/x-diff, Size: 10956 bytes --]

From 26431a02e35190c8537c09f4db1762a408233e3f Mon Sep 17 00:00:00 2001
From: Piraty <piraty1@inbox.ru>
Date: Mon, 20 May 2019 21:08:27 +0200
Subject: [PATCH] New package: heaptrack-1.1.0

---
 srcpkgs/heaptrack-gui                         |  1 +
 .../patches/001.compile-on-32bit.patch        | 70 +++++++++++++++++++
 .../heaptrack/patches/002.musl-fixes.patch    | 68 ++++++++++++++++++
 srcpkgs/heaptrack/patches/003.uint.patch      | 49 +++++++++++++
 srcpkgs/heaptrack/patches/004.desktop.patch   | 61 ++++++++++++++++
 srcpkgs/heaptrack/template                    | 24 +++++++
 6 files changed, 273 insertions(+)
 create mode 120000 srcpkgs/heaptrack-gui
 create mode 100644 srcpkgs/heaptrack/patches/001.compile-on-32bit.patch
 create mode 100644 srcpkgs/heaptrack/patches/002.musl-fixes.patch
 create mode 100644 srcpkgs/heaptrack/patches/003.uint.patch
 create mode 100644 srcpkgs/heaptrack/patches/004.desktop.patch
 create mode 100644 srcpkgs/heaptrack/template

diff --git a/srcpkgs/heaptrack-gui b/srcpkgs/heaptrack-gui
new file mode 120000
index 00000000000..9a8c22eb92e
--- /dev/null
+++ b/srcpkgs/heaptrack-gui
@@ -0,0 +1 @@
+heaptrack
\ No newline at end of file
diff --git a/srcpkgs/heaptrack/patches/001.compile-on-32bit.patch b/srcpkgs/heaptrack/patches/001.compile-on-32bit.patch
new file mode 100644
index 00000000000..f7016cc6336
--- /dev/null
+++ b/srcpkgs/heaptrack/patches/001.compile-on-32bit.patch
@@ -0,0 +1,70 @@
+# reason: current release is unable to build on 32bit arches
+# src: upstream/master
+
+From 76fd2e84ba133e96d2cfdf90cb715e66e923eb8f Mon Sep 17 00:00:00 2001
+From: Milian Wolff <mail@milianw.de>
+Date: Thu, 17 May 2018 13:31:25 +0200
+Subject: [PATCH] Fix compile on 32bit
+
+BUG: 394330
+---
+ src/util/linewriter.h | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/src/util/linewriter.h b/src/util/linewriter.h
+index 73a7930..e895e87 100644
+--- src/util/linewriter.h
++++ src/util/linewriter.h
+@@ -158,6 +158,11 @@ class LineWriter
+         return __builtin_clzl(V);
+     }
+ 
++    inline static unsigned clz(long long unsigned V)
++    {
++        return __builtin_clzll(V);
++    }
++
+     template <typename V>
+     static char* writeHexNumber(char* buffer, V value)
+     {
+
+
+
+From 49577e019ea791ee63962cdfe7e9c0c5b5c6ea4b Mon Sep 17 00:00:00 2001
+From: Milian Wolff <milian.wolff@kdab.com>
+Date: Tue, 29 May 2018 10:41:10 +0200
+Subject: [PATCH] Fix another compile error on 32bit
+
+Introduce a user-defined _u64 literal for uint64_t
+and use that instead of ul/ull.
+
+BUG: 394330
+---
+ tests/auto/tst_io.cpp | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/tests/auto/tst_io.cpp b/tests/auto/tst_io.cpp
+index 48abda6..fd31b31 100644
+--- tests/auto/tst_io.cpp
++++ tests/auto/tst_io.cpp
+@@ -27,6 +27,11 @@
+ 
+ using namespace std;
+ 
++constexpr uint64_t operator"" _u64(unsigned long long v)
++{
++    return static_cast<uint64_t>(v);
++}
++
+ TEST_CASE ("write data", "[write]") {
+     TempFile file;
+     REQUIRE(file.open());
+@@ -124,7 +129,7 @@ TEST_CASE ("read line 64bit", "[read]") {
+     REQUIRE(reader >> module);
+     REQUIRE(module == "/tmp/KDevelop-5.2.1-x86_64/usr/lib/libKF5Completion.so.5");
+ 
+-    for (uint64_t expected : {0x7f48beedc00ul, 0x0ul, 0x36854ul, 0x236858ul, 0x2700ul}) {
++    for (auto expected : {0x7f48beedc00_u64, 0x0_u64, 0x36854_u64, 0x236858_u64, 0x2700_u64}) {
+         uint64_t addr = 0;
+         REQUIRE(reader >> addr);
+         REQUIRE(addr == expected);
diff --git a/srcpkgs/heaptrack/patches/002.musl-fixes.patch b/srcpkgs/heaptrack/patches/002.musl-fixes.patch
new file mode 100644
index 00000000000..5dde897ae18
--- /dev/null
+++ b/srcpkgs/heaptrack/patches/002.musl-fixes.patch
@@ -0,0 +1,68 @@
+# reason: fix sources to work correctly with musl
+
+--- src/track/heaptrack_inject.cpp
++++ src/track/heaptrack_inject.cpp
+@@ -27,6 +27,7 @@
+ #include <link.h>
+ #include <malloc.h>
+ #include <unistd.h>
++#include <dlfcn.h>
+ 
+ #include <sys/mman.h>
+ 
+--- src/track/libheaptrack.cpp
++++ src/track/libheaptrack.cpp
+@@ -72,7 +72,7 @@
+     return chrono::duration_cast<chrono::milliseconds>(clock::now() - startTime());
+ }
+ 
+-__pid_t gettid()
++pid_t gettid()
+ {
+     return syscall(SYS_gettid);
+ }
+
+--- src/track/heaptrack_inject.cpp
++++ src/track/heaptrack_inject.cpp
+@@ -38,9 +38,10 @@
+  * @brief Experimental support for symbol overloading after runtime injection.
+  */
+ 
+-#if __WORDSIZE == 64
++#include <limits.h>
++#if ULONG_MAX == 0xffffffffffffffff
+ #define ELF_R_SYM(i) ELF64_R_SYM(i)
+-#elif __WORDSIZE == 32
++#elif ULONG_MAX == 0xffffffff
+ #define ELF_R_SYM(i) ELF32_R_SYM(i)
+ #else
+ #error unsupported word size
+
+# simplify stdint.h include which failed on musl due to obscure assumptions
+--- 3rdparty/libbacktrace/backtrace.h
++++ 3rdparty/libbacktrace/backtrace.h
+@@ -36,24 +36,8 @@
+ #include <stddef.h>
+ #include <stdio.h>
+ 
+-/* We want to get a definition for uintptr_t, but we still care about
+-   systems that don't have <stdint.h>.  */
+-#if defined(__GLIBC__) && __GLIBC__ >= 2
+-
+-#include <stdint.h>
+-
+-#elif defined(HAVE_STDINT_H)
+-
+ #include <stdint.h>
+ 
+-#else
+-
+-/* Systems that don't have <stdint.h> must provide gstdint.h, e.g.,
+-   from GCC_HEADER_STDINT in configure.ac.  */
+-#include "gstdint.h"
+-
+-#endif
+-
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
diff --git a/srcpkgs/heaptrack/patches/003.uint.patch b/srcpkgs/heaptrack/patches/003.uint.patch
new file mode 100644
index 00000000000..ccf4821a5d3
--- /dev/null
+++ b/srcpkgs/heaptrack/patches/003.uint.patch
@@ -0,0 +1,49 @@
+# src: upstream/master
+
+From f540b95cc7446fbf41b4b3fa9b6f275b580de638 Mon Sep 17 00:00:00 2001
+From: Sergio Martins <smartins@kde.org>
+Date: Sun, 26 May 2019 01:48:21 +0100
+Subject: [PATCH] Use 'unsigned int' instead of 'uint'
+
+The former is cross platform and makes it buildable with MSVC.
+As it's just a couple of places there's no need for a typedef.
+---
+ src/analyze/accumulatedtracedata.cpp | 4 ++--
+ src/util/indices.h                   | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/analyze/accumulatedtracedata.cpp b/src/analyze/accumulatedtracedata.cpp
+index f3f07a7..268c17f 100644
+--- src/analyze/accumulatedtracedata.cpp
++++ src/analyze/accumulatedtracedata.cpp
+@@ -186,7 +186,7 @@ bool AccumulatedTraceData::read(istream& in, const ParsePass pass)
+     for (auto& allocation : allocations) {
+         allocation.clearCost();
+     }
+-    uint fileVersion = 0;
++    unsigned int fileVersion = 0;
+     bool debuggeeEncountered = false;
+ 
+     // required for backwards compatibility
+@@ -385,7 +385,7 @@ bool AccumulatedTraceData::read(istream& in, const ParsePass pass)
+             totalCost = {};
+             fromAttached = true;
+         } else if (reader.mode() == 'v') {
+-            uint heaptrackVersion = 0;
++            unsigned int heaptrackVersion = 0;
+             reader >> heaptrackVersion;
+             if (!(reader >> fileVersion) && heaptrackVersion == 0x010200) {
+                 // backwards compatibility: before the 1.0.0, I actually
+diff --git a/src/util/indices.h b/src/util/indices.h
+index ee1f777..8f21bba 100644
+--- src/util/indices.h
++++ src/util/indices.h
+@@ -64,7 +64,7 @@ struct Index
+ };
+ 
+ template <typename Base>
+-uint qHash(const Index<Base> index, uint seed = 0) noexcept
++unsigned int qHash(const Index<Base> index, unsigned int seed = 0) noexcept
+ {
+     return qHash(index.index, seed);
+ }
diff --git a/srcpkgs/heaptrack/patches/004.desktop.patch b/srcpkgs/heaptrack/patches/004.desktop.patch
new file mode 100644
index 00000000000..3493481e86b
--- /dev/null
+++ b/srcpkgs/heaptrack/patches/004.desktop.patch
@@ -0,0 +1,61 @@
+# src: upstream/master
+
+From f2349d480fc30cf55281218b2b8063c4e5207abb Mon Sep 17 00:00:00 2001
+From: "Friedrich W. H. Kossebau" <kossebau@kde.org>
+Date: Tue, 5 Feb 2019 04:08:55 +0100
+Subject: [PATCH] Set StartupWMClass in desktop file
+
+Used by non-Plasma unixoid X-based shells to map windows to desktop files
+e.g. in launcher UIs, which do not know about _KDE_NET_WM_DESKTOP_FILE and
+instead expect (one of) the WM_CLASS entries to match the basename of the
+desktop file by default. StartupWMClass overwrites that default.
+---
+ src/analyze/gui/org.kde.heaptrack.desktop | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/analyze/gui/org.kde.heaptrack.desktop b/src/analyze/gui/org.kde.heaptrack.desktop
+index 8c92706..ddae134 100644
+--- src/analyze/gui/org.kde.heaptrack.desktop
++++ src/analyze/gui/org.kde.heaptrack.desktop
+@@ -7,6 +7,7 @@ MimeType=application/x-heaptrack;
+ Icon=heaptrack
+ # FIXME: write docs!
+ # X-DocPath=kcachegrind/index.html
++StartupWMClass=heaptrack_gui
+ Terminal=false
+ Name=Heaptrack
+ Name[ca]=Heaptrack
+
+
+From 30ca42deadcb3bf0a73cd37806ceca5d290fbbce Mon Sep 17 00:00:00 2001
+From: "Friedrich W. H. Kossebau" <kossebau@kde.org>
+Date: Tue, 5 Feb 2019 04:23:58 +0100
+Subject: [PATCH] Add correct desktopfilename property for heaptrack_gui
+
+---
+ src/analyze/gui/gui.cpp | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/analyze/gui/gui.cpp b/src/analyze/gui/gui.cpp
+index 96048b1..846d5fb 100644
+--- src/analyze/gui/gui.cpp
++++ src/analyze/gui/gui.cpp
+@@ -19,6 +19,7 @@
+ #include <QApplication>
+ #include <QCommandLineParser>
+ 
++#include <kcoreaddons_version.h>
+ #include <KAboutData>
+ #include <KLocalizedString>
+ 
+@@ -45,7 +46,9 @@ int main(int argc, char** argv)
+                         QStringLiteral("http://milianw.de"));
+ 
+     aboutData.setOrganizationDomain("kde.org");
+-
++#if KCOREADDONS_VERSION >= QT_VERSION_CHECK(5, 16, 0)
++    aboutData.setDesktopFileName(QStringLiteral("org.kde.heaptrack"));
++#endif
+     KAboutData::setApplicationData(aboutData);
+     app.setWindowIcon(QIcon::fromTheme(QStringLiteral("office-chart-area")));
+ 
diff --git a/srcpkgs/heaptrack/template b/srcpkgs/heaptrack/template
new file mode 100644
index 00000000000..96734743d75
--- /dev/null
+++ b/srcpkgs/heaptrack/template
@@ -0,0 +1,24 @@
+# Template file for 'heaptrack'
+pkgname=heaptrack
+version=1.1.0
+revision=1
+build_style=cmake
+hostmakedepends="qt5-qmake qt5-host-tools extra-cmake-modules kcoreaddons"
+makedepends="boost-devel libunwind-devel zlib-devel libdwarf-devel
+ qt5-devel libzstd-devel ecm-devel ki18n-devel kitemmodels-devel kio-devel
+ kconfigwidgets-devel threadweaver-devel kdiagram-devel"
+depends="gdb"
+short_desc="Heap memory profiler for Linux"
+maintainer="Piraty <piraty1@inbox.ru>"
+license="LGPL-2.1-or-later"
+homepage="https://github.com/KDE/heaptrack"
+distfiles="https://github.com/KDE/heaptrack/archive/v${version}.tar.gz"
+checksum=bd247ac67d1ecf023ec7e2a2888764bfc03e2f8b24876928ca6aa0cdb3a07309
+
+heaptrack-gui_package() {
+	short_desc+=" - GUI"
+	pkg_install() {
+		vmove usr/bin/heaptrack_gui
+		vmove usr/share
+	}
+}

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PR PATCH] [Updated] New package: heaptrack-1.1.0
  2019-06-19 11:06 [PR PATCH] New package: heaptrack-1.1.0 voidlinux-github
                   ` (9 preceding siblings ...)
  2019-09-28 22:29 ` voidlinux-github
@ 2019-09-28 22:29 ` voidlinux-github
  10 siblings, 0 replies; 12+ messages in thread
From: voidlinux-github @ 2019-09-28 22:29 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 318 bytes --]

There is an updated pull request by Piraty against master on the void-packages repository

https://github.com/Piraty/void-packages heaptrack
https://github.com/void-linux/void-packages/pull/12549

New package: heaptrack-1.1.0


A patch file from https://github.com/void-linux/void-packages/pull/12549.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-heaptrack-12549.patch --]
[-- Type: text/x-diff, Size: 10956 bytes --]

From 26431a02e35190c8537c09f4db1762a408233e3f Mon Sep 17 00:00:00 2001
From: Piraty <piraty1@inbox.ru>
Date: Mon, 20 May 2019 21:08:27 +0200
Subject: [PATCH] New package: heaptrack-1.1.0

---
 srcpkgs/heaptrack-gui                         |  1 +
 .../patches/001.compile-on-32bit.patch        | 70 +++++++++++++++++++
 .../heaptrack/patches/002.musl-fixes.patch    | 68 ++++++++++++++++++
 srcpkgs/heaptrack/patches/003.uint.patch      | 49 +++++++++++++
 srcpkgs/heaptrack/patches/004.desktop.patch   | 61 ++++++++++++++++
 srcpkgs/heaptrack/template                    | 24 +++++++
 6 files changed, 273 insertions(+)
 create mode 120000 srcpkgs/heaptrack-gui
 create mode 100644 srcpkgs/heaptrack/patches/001.compile-on-32bit.patch
 create mode 100644 srcpkgs/heaptrack/patches/002.musl-fixes.patch
 create mode 100644 srcpkgs/heaptrack/patches/003.uint.patch
 create mode 100644 srcpkgs/heaptrack/patches/004.desktop.patch
 create mode 100644 srcpkgs/heaptrack/template

diff --git a/srcpkgs/heaptrack-gui b/srcpkgs/heaptrack-gui
new file mode 120000
index 00000000000..9a8c22eb92e
--- /dev/null
+++ b/srcpkgs/heaptrack-gui
@@ -0,0 +1 @@
+heaptrack
\ No newline at end of file
diff --git a/srcpkgs/heaptrack/patches/001.compile-on-32bit.patch b/srcpkgs/heaptrack/patches/001.compile-on-32bit.patch
new file mode 100644
index 00000000000..f7016cc6336
--- /dev/null
+++ b/srcpkgs/heaptrack/patches/001.compile-on-32bit.patch
@@ -0,0 +1,70 @@
+# reason: current release is unable to build on 32bit arches
+# src: upstream/master
+
+From 76fd2e84ba133e96d2cfdf90cb715e66e923eb8f Mon Sep 17 00:00:00 2001
+From: Milian Wolff <mail@milianw.de>
+Date: Thu, 17 May 2018 13:31:25 +0200
+Subject: [PATCH] Fix compile on 32bit
+
+BUG: 394330
+---
+ src/util/linewriter.h | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/src/util/linewriter.h b/src/util/linewriter.h
+index 73a7930..e895e87 100644
+--- src/util/linewriter.h
++++ src/util/linewriter.h
+@@ -158,6 +158,11 @@ class LineWriter
+         return __builtin_clzl(V);
+     }
+ 
++    inline static unsigned clz(long long unsigned V)
++    {
++        return __builtin_clzll(V);
++    }
++
+     template <typename V>
+     static char* writeHexNumber(char* buffer, V value)
+     {
+
+
+
+From 49577e019ea791ee63962cdfe7e9c0c5b5c6ea4b Mon Sep 17 00:00:00 2001
+From: Milian Wolff <milian.wolff@kdab.com>
+Date: Tue, 29 May 2018 10:41:10 +0200
+Subject: [PATCH] Fix another compile error on 32bit
+
+Introduce a user-defined _u64 literal for uint64_t
+and use that instead of ul/ull.
+
+BUG: 394330
+---
+ tests/auto/tst_io.cpp | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/tests/auto/tst_io.cpp b/tests/auto/tst_io.cpp
+index 48abda6..fd31b31 100644
+--- tests/auto/tst_io.cpp
++++ tests/auto/tst_io.cpp
+@@ -27,6 +27,11 @@
+ 
+ using namespace std;
+ 
++constexpr uint64_t operator"" _u64(unsigned long long v)
++{
++    return static_cast<uint64_t>(v);
++}
++
+ TEST_CASE ("write data", "[write]") {
+     TempFile file;
+     REQUIRE(file.open());
+@@ -124,7 +129,7 @@ TEST_CASE ("read line 64bit", "[read]") {
+     REQUIRE(reader >> module);
+     REQUIRE(module == "/tmp/KDevelop-5.2.1-x86_64/usr/lib/libKF5Completion.so.5");
+ 
+-    for (uint64_t expected : {0x7f48beedc00ul, 0x0ul, 0x36854ul, 0x236858ul, 0x2700ul}) {
++    for (auto expected : {0x7f48beedc00_u64, 0x0_u64, 0x36854_u64, 0x236858_u64, 0x2700_u64}) {
+         uint64_t addr = 0;
+         REQUIRE(reader >> addr);
+         REQUIRE(addr == expected);
diff --git a/srcpkgs/heaptrack/patches/002.musl-fixes.patch b/srcpkgs/heaptrack/patches/002.musl-fixes.patch
new file mode 100644
index 00000000000..5dde897ae18
--- /dev/null
+++ b/srcpkgs/heaptrack/patches/002.musl-fixes.patch
@@ -0,0 +1,68 @@
+# reason: fix sources to work correctly with musl
+
+--- src/track/heaptrack_inject.cpp
++++ src/track/heaptrack_inject.cpp
+@@ -27,6 +27,7 @@
+ #include <link.h>
+ #include <malloc.h>
+ #include <unistd.h>
++#include <dlfcn.h>
+ 
+ #include <sys/mman.h>
+ 
+--- src/track/libheaptrack.cpp
++++ src/track/libheaptrack.cpp
+@@ -72,7 +72,7 @@
+     return chrono::duration_cast<chrono::milliseconds>(clock::now() - startTime());
+ }
+ 
+-__pid_t gettid()
++pid_t gettid()
+ {
+     return syscall(SYS_gettid);
+ }
+
+--- src/track/heaptrack_inject.cpp
++++ src/track/heaptrack_inject.cpp
+@@ -38,9 +38,10 @@
+  * @brief Experimental support for symbol overloading after runtime injection.
+  */
+ 
+-#if __WORDSIZE == 64
++#include <limits.h>
++#if ULONG_MAX == 0xffffffffffffffff
+ #define ELF_R_SYM(i) ELF64_R_SYM(i)
+-#elif __WORDSIZE == 32
++#elif ULONG_MAX == 0xffffffff
+ #define ELF_R_SYM(i) ELF32_R_SYM(i)
+ #else
+ #error unsupported word size
+
+# simplify stdint.h include which failed on musl due to obscure assumptions
+--- 3rdparty/libbacktrace/backtrace.h
++++ 3rdparty/libbacktrace/backtrace.h
+@@ -36,24 +36,8 @@
+ #include <stddef.h>
+ #include <stdio.h>
+ 
+-/* We want to get a definition for uintptr_t, but we still care about
+-   systems that don't have <stdint.h>.  */
+-#if defined(__GLIBC__) && __GLIBC__ >= 2
+-
+-#include <stdint.h>
+-
+-#elif defined(HAVE_STDINT_H)
+-
+ #include <stdint.h>
+ 
+-#else
+-
+-/* Systems that don't have <stdint.h> must provide gstdint.h, e.g.,
+-   from GCC_HEADER_STDINT in configure.ac.  */
+-#include "gstdint.h"
+-
+-#endif
+-
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
diff --git a/srcpkgs/heaptrack/patches/003.uint.patch b/srcpkgs/heaptrack/patches/003.uint.patch
new file mode 100644
index 00000000000..ccf4821a5d3
--- /dev/null
+++ b/srcpkgs/heaptrack/patches/003.uint.patch
@@ -0,0 +1,49 @@
+# src: upstream/master
+
+From f540b95cc7446fbf41b4b3fa9b6f275b580de638 Mon Sep 17 00:00:00 2001
+From: Sergio Martins <smartins@kde.org>
+Date: Sun, 26 May 2019 01:48:21 +0100
+Subject: [PATCH] Use 'unsigned int' instead of 'uint'
+
+The former is cross platform and makes it buildable with MSVC.
+As it's just a couple of places there's no need for a typedef.
+---
+ src/analyze/accumulatedtracedata.cpp | 4 ++--
+ src/util/indices.h                   | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/analyze/accumulatedtracedata.cpp b/src/analyze/accumulatedtracedata.cpp
+index f3f07a7..268c17f 100644
+--- src/analyze/accumulatedtracedata.cpp
++++ src/analyze/accumulatedtracedata.cpp
+@@ -186,7 +186,7 @@ bool AccumulatedTraceData::read(istream& in, const ParsePass pass)
+     for (auto& allocation : allocations) {
+         allocation.clearCost();
+     }
+-    uint fileVersion = 0;
++    unsigned int fileVersion = 0;
+     bool debuggeeEncountered = false;
+ 
+     // required for backwards compatibility
+@@ -385,7 +385,7 @@ bool AccumulatedTraceData::read(istream& in, const ParsePass pass)
+             totalCost = {};
+             fromAttached = true;
+         } else if (reader.mode() == 'v') {
+-            uint heaptrackVersion = 0;
++            unsigned int heaptrackVersion = 0;
+             reader >> heaptrackVersion;
+             if (!(reader >> fileVersion) && heaptrackVersion == 0x010200) {
+                 // backwards compatibility: before the 1.0.0, I actually
+diff --git a/src/util/indices.h b/src/util/indices.h
+index ee1f777..8f21bba 100644
+--- src/util/indices.h
++++ src/util/indices.h
+@@ -64,7 +64,7 @@ struct Index
+ };
+ 
+ template <typename Base>
+-uint qHash(const Index<Base> index, uint seed = 0) noexcept
++unsigned int qHash(const Index<Base> index, unsigned int seed = 0) noexcept
+ {
+     return qHash(index.index, seed);
+ }
diff --git a/srcpkgs/heaptrack/patches/004.desktop.patch b/srcpkgs/heaptrack/patches/004.desktop.patch
new file mode 100644
index 00000000000..3493481e86b
--- /dev/null
+++ b/srcpkgs/heaptrack/patches/004.desktop.patch
@@ -0,0 +1,61 @@
+# src: upstream/master
+
+From f2349d480fc30cf55281218b2b8063c4e5207abb Mon Sep 17 00:00:00 2001
+From: "Friedrich W. H. Kossebau" <kossebau@kde.org>
+Date: Tue, 5 Feb 2019 04:08:55 +0100
+Subject: [PATCH] Set StartupWMClass in desktop file
+
+Used by non-Plasma unixoid X-based shells to map windows to desktop files
+e.g. in launcher UIs, which do not know about _KDE_NET_WM_DESKTOP_FILE and
+instead expect (one of) the WM_CLASS entries to match the basename of the
+desktop file by default. StartupWMClass overwrites that default.
+---
+ src/analyze/gui/org.kde.heaptrack.desktop | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/analyze/gui/org.kde.heaptrack.desktop b/src/analyze/gui/org.kde.heaptrack.desktop
+index 8c92706..ddae134 100644
+--- src/analyze/gui/org.kde.heaptrack.desktop
++++ src/analyze/gui/org.kde.heaptrack.desktop
+@@ -7,6 +7,7 @@ MimeType=application/x-heaptrack;
+ Icon=heaptrack
+ # FIXME: write docs!
+ # X-DocPath=kcachegrind/index.html
++StartupWMClass=heaptrack_gui
+ Terminal=false
+ Name=Heaptrack
+ Name[ca]=Heaptrack
+
+
+From 30ca42deadcb3bf0a73cd37806ceca5d290fbbce Mon Sep 17 00:00:00 2001
+From: "Friedrich W. H. Kossebau" <kossebau@kde.org>
+Date: Tue, 5 Feb 2019 04:23:58 +0100
+Subject: [PATCH] Add correct desktopfilename property for heaptrack_gui
+
+---
+ src/analyze/gui/gui.cpp | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/analyze/gui/gui.cpp b/src/analyze/gui/gui.cpp
+index 96048b1..846d5fb 100644
+--- src/analyze/gui/gui.cpp
++++ src/analyze/gui/gui.cpp
+@@ -19,6 +19,7 @@
+ #include <QApplication>
+ #include <QCommandLineParser>
+ 
++#include <kcoreaddons_version.h>
+ #include <KAboutData>
+ #include <KLocalizedString>
+ 
+@@ -45,7 +46,9 @@ int main(int argc, char** argv)
+                         QStringLiteral("http://milianw.de"));
+ 
+     aboutData.setOrganizationDomain("kde.org");
+-
++#if KCOREADDONS_VERSION >= QT_VERSION_CHECK(5, 16, 0)
++    aboutData.setDesktopFileName(QStringLiteral("org.kde.heaptrack"));
++#endif
+     KAboutData::setApplicationData(aboutData);
+     app.setWindowIcon(QIcon::fromTheme(QStringLiteral("office-chart-area")));
+ 
diff --git a/srcpkgs/heaptrack/template b/srcpkgs/heaptrack/template
new file mode 100644
index 00000000000..96734743d75
--- /dev/null
+++ b/srcpkgs/heaptrack/template
@@ -0,0 +1,24 @@
+# Template file for 'heaptrack'
+pkgname=heaptrack
+version=1.1.0
+revision=1
+build_style=cmake
+hostmakedepends="qt5-qmake qt5-host-tools extra-cmake-modules kcoreaddons"
+makedepends="boost-devel libunwind-devel zlib-devel libdwarf-devel
+ qt5-devel libzstd-devel ecm-devel ki18n-devel kitemmodels-devel kio-devel
+ kconfigwidgets-devel threadweaver-devel kdiagram-devel"
+depends="gdb"
+short_desc="Heap memory profiler for Linux"
+maintainer="Piraty <piraty1@inbox.ru>"
+license="LGPL-2.1-or-later"
+homepage="https://github.com/KDE/heaptrack"
+distfiles="https://github.com/KDE/heaptrack/archive/v${version}.tar.gz"
+checksum=bd247ac67d1ecf023ec7e2a2888764bfc03e2f8b24876928ca6aa0cdb3a07309
+
+heaptrack-gui_package() {
+	short_desc+=" - GUI"
+	pkg_install() {
+		vmove usr/bin/heaptrack_gui
+		vmove usr/share
+	}
+}

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2019-09-28 22:29 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-19 11:06 [PR PATCH] New package: heaptrack-1.1.0 voidlinux-github
2019-06-19 14:30 ` voidlinux-github
2019-06-19 14:36 ` voidlinux-github
2019-06-19 19:20 ` [PR PATCH] [Updated] " voidlinux-github
2019-06-19 19:20 ` voidlinux-github
2019-06-19 19:21 ` voidlinux-github
2019-09-26 20:20 ` [PR PATCH] [Updated] " voidlinux-github
2019-09-26 20:20 ` voidlinux-github
2019-09-26 22:20 ` voidlinux-github
2019-09-26 22:20 ` voidlinux-github
2019-09-28 22:29 ` voidlinux-github
2019-09-28 22:29 ` voidlinux-github

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).