Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

user/xournalpp: new package #3017

Merged
merged 1 commit into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions user/xournalpp/patches/no-sig.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
catching signals and then printing a scuffed backtrace and inhibiting a coredump
is useless, just crash normally so a corefile can be inspected in a debugger
instead of being impossible.
--
--- a/src/core/control/CrashHandlerUnix.h
+++ b/src/core/control/CrashHandlerUnix.h
@@ -71,26 +71,6 @@

sigemptyset(&mask);

-#ifdef SIGSEGV
- signal(SIGSEGV, crashHandler);
- sigaddset(&mask, SIGSEGV);
-#endif
-
-#ifdef SIGFPE
- signal(SIGFPE, crashHandler);
- sigaddset(&mask, SIGFPE);
-#endif
-
-#ifdef SIGILL
- signal(SIGILL, crashHandler);
- sigaddset(&mask, SIGILL);
-#endif
-
-#ifdef SIGABRT
- signal(SIGABRT, crashHandler);
- sigaddset(&mask, SIGABRT);
-#endif
-
sigprocmask(SIG_UNBLOCK, &mask, 0);

g_log_set_default_handler(GLogFunc(log_handler), getCrashHandlerLogBuffer());
77 changes: 77 additions & 0 deletions user/xournalpp/patches/noexecinfo.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
diff --git a/src/core/control/CrashHandlerUnix.h b/src/core/control/CrashHandlerUnix.h
index dda77773..5007bddc 100644
--- a/src/core/control/CrashHandlerUnix.h
+++ b/src/core/control/CrashHandlerUnix.h
@@ -13,7 +13,6 @@
#include <bitset>
#include <fstream> // std::ofstream

-#include <execinfo.h>
#include <gtk/gtk.h>

#include "util/PathUtil.h"
@@ -109,14 +108,6 @@ static void crashHandler(int sig) {
g_warning("[Crash Handler] Crashed with signal %i", sig);

time_t lt;
- void* array[100];
- char** messages;
-
- size_t size;
-
- // get void*'s for all entries on the stack
- size = backtrace(array, 100);
-
time_t curtime = time(0);
char stime[128];
strftime(stime, sizeof(stime), "%Y%m%d-%H%M%S", localtime(&curtime));
@@ -141,15 +132,6 @@ static void crashHandler(int sig) {
<< std::endl
<< std::endl;

- messages = backtrace_symbols(array, size);
-
- for (size_t i = 0; i < size; i++) {
- fp << FORMAT_STR("[bt]: ({1}) {2}") % i % messages[i];
- fp << "\n";
- }
-
- free(messages);
-
fp << "\n\nTry to get a better stacktrace...\n";

Stacktrace::printStracktrace(fp);
diff --git a/src/util/Stacktrace.cpp b/src/util/Stacktrace.cpp
index c33b7f2c..ffb92616 100644
--- a/src/util/Stacktrace.cpp
+++ b/src/util/Stacktrace.cpp
@@ -14,7 +14,6 @@
#else

#include <dlfcn.h> // for dladdr
-#include <execinfo.h> // for backtrace, backtrace_symbols
#include <unistd.h> // for readlink, ssize_t

#ifdef __APPLE__
@@ -91,12 +90,10 @@ void Stacktrace::printStracktrace(std::ostream& stream) {
std::array<void*, 32> trace{};
std::array<char, 2048> buff{};

- int trace_size = backtrace(trace.data(), trace.size());
- char** messages = backtrace_symbols(trace.data(), trace_size);
+ int trace_size = 0;

// skip first stack frame (points here)
for (unsigned int i = 1; i < trace_size; ++i) {
- stream << "[bt] #" << i - 1 << " " << messages[i] << endl;

Dl_info info; // NOLINT(cppcoreguidelines-init-variables)
dladdr(trace[i], &info);
@@ -115,7 +112,6 @@ void Stacktrace::printStracktrace(std::ostream& stream) {
pclose(fProc);
}

- free(messages);
}
#endif

34 changes: 34 additions & 0 deletions user/xournalpp/template.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
pkgname = "xournalpp"
pkgver = "1.2.3"
pkgrel = 0
build_style = "cmake"
hostmakedepends = [
"cmake",
"gettext",
"help2man",
"ninja",
"pkgconf",
]
makedepends = [
"glib-devel",
"gtk+3-devel",
"gtksourceview4-devel",
"librsvg-devel",
"libsndfile-devel",
"libxml2-devel",
"libzip-devel",
DaringCuteSeal marked this conversation as resolved.
Show resolved Hide resolved
DaringCuteSeal marked this conversation as resolved.
Show resolved Hide resolved
"lua5.4-devel",
"poppler-devel",
"portaudio-devel",
]
pkgdesc = "Handwriting notetaking software with PDF annotation support"
maintainer = "daringcuteseal <[email protected]>"
license = "GPL-2.0-or-later"
url = "https://github.com/xournalpp/xournalpp"
source = f"{url}/archive/refs/tags/v{pkgver}.tar.gz"
sha256 = "8817abd1794760c2a3be3a35e56a5588a51e517bc591384fa321994d50e14e7c"
# known overflow in tablet handling thread
tool_flags = {
"CXXFLAGS": ["-DNDEBUG"],
"LDFLAGS": ["-Wl,-z,stack-size=0x200000"],
}