Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/graphics/inkscape inkscape: Implement get_program_name...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/ef96bc170cfa
branches:  trunk
changeset: 436574:ef96bc170cfa
user:      kamil <kamil%pkgsrc.org@localhost>
date:      Wed Aug 05 19:59:19 2020 +0000

description:
inkscape: Implement get_program_name for NetBSD.

diffstat:

 graphics/inkscape/distinfo                          |   3 +-
 graphics/inkscape/patches/patch-src_path-prefix.cpp |  34 +++++++++++++++++++++
 2 files changed, 36 insertions(+), 1 deletions(-)

diffs (52 lines):

diff -r 380f08079159 -r ef96bc170cfa graphics/inkscape/distinfo
--- a/graphics/inkscape/distinfo        Wed Aug 05 16:34:50 2020 +0000
+++ b/graphics/inkscape/distinfo        Wed Aug 05 19:59:19 2020 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.73 2020/05/17 00:38:47 tnn Exp $
+$NetBSD: distinfo,v 1.74 2020/08/05 19:59:19 kamil Exp $
 
 SHA1 (inkscape-1.0.tar.xz) = c59c5195bbd079deb5943686650230ddbdde0569
 RMD160 (inkscape-1.0.tar.xz) = 2350d881891ac60324235a5745f76f21ba3fb3d0
@@ -6,3 +6,4 @@
 Size (inkscape-1.0.tar.xz) = 31935616 bytes
 SHA1 (patch-CMakeScripts_Pod2man.cmake) = c7f0c0d3b28604c2594bc9265363c782a57af40c
 SHA1 (patch-src_extension_implementation_script.cpp) = 2c2cbcee2fdda5a274906600930acc0257cc0ea2
+SHA1 (patch-src_path-prefix.cpp) = 1ce20f16063759aab60d9e8da6b25700b44099d2
diff -r 380f08079159 -r ef96bc170cfa graphics/inkscape/patches/patch-src_path-prefix.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/inkscape/patches/patch-src_path-prefix.cpp       Wed Aug 05 19:59:19 2020 +0000
@@ -0,0 +1,34 @@
+$NetBSD: patch-src_path-prefix.cpp,v 1.1 2020/08/05 19:59:19 kamil Exp $
+
+Add NetBSD support in get_program_name().
+
+--- src/path-prefix.cpp.orig   2020-05-01 13:17:42.000000000 +0000
++++ src/path-prefix.cpp
+@@ -20,6 +20,11 @@
+ #include <mach-o/dyld.h> // for _NSGetExecutablePath
+ #endif
+ 
++#ifdef __NetBSD__
++#include <sys/types.h>
++#include <sys/sysctl.h>
++#endif
++
+ #include <glib.h>
+ 
+ #include "path-prefix.h"
+@@ -114,6 +119,15 @@ gchar *get_program_name()
+         if (!program_name) {
+             g_warning("get_program_name() - g_file_read_link failed");
+         }
++#elif defined(__NetBSD__)
++        static const int name[] = {CTL_KERN, KERN_PROC_ARGS, -1, KERN_PROC_PATHNAME};
++        char path[MAXPATHLEN];
++        size_t len = sizeof(path);
++        if (sysctl(name, __arraycount(name), path, &len, NULL, 0) == 0) {
++            program_name = realpath(path, nullptr);
++        } else {
++            g_warning("get_program_name() - sysctl failed");
++        }
+ #else
+ #warning get_program_name() - no known way to obtain executable name on this platform
+         g_info("get_program_name() - no known way to obtain executable name on this platform");



Home | Main Index | Thread Index | Old Index