pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/sysutils/desktop-file-utils
Module Name: pkgsrc
Committed By: schmonz
Date: Tue Sep 1 10:21:55 UTC 2020
Modified Files:
pkgsrc/sysutils/desktop-file-utils: Makefile distinfo
Added Files:
pkgsrc/sysutils/desktop-file-utils/patches: patch-src_install.c
patch-src_update-desktop-database.c patch-src_validator.c
Log Message:
Borrow patches from OpenBSD ports to fix build, adding pledge() and
unveil() support while we're at it. NFCI for other platforms.
To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 pkgsrc/sysutils/desktop-file-utils/Makefile
cvs rdiff -u -r1.18 -r1.19 pkgsrc/sysutils/desktop-file-utils/distinfo
cvs rdiff -u -r0 -r1.1 \
pkgsrc/sysutils/desktop-file-utils/patches/patch-src_install.c \
pkgsrc/sysutils/desktop-file-utils/patches/patch-src_update-desktop-database.c \
pkgsrc/sysutils/desktop-file-utils/patches/patch-src_validator.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/sysutils/desktop-file-utils/Makefile
diff -u pkgsrc/sysutils/desktop-file-utils/Makefile:1.42 pkgsrc/sysutils/desktop-file-utils/Makefile:1.43
--- pkgsrc/sysutils/desktop-file-utils/Makefile:1.42 Fri Jul 31 09:17:53 2020
+++ pkgsrc/sysutils/desktop-file-utils/Makefile Tue Sep 1 10:21:55 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.42 2020/07/31 09:17:53 wiz Exp $
+# $NetBSD: Makefile,v 1.43 2020/09/01 10:21:55 schmonz Exp $
DISTNAME= desktop-file-utils-0.26
CATEGORIES= sysutils gnome
@@ -17,6 +17,11 @@ LDFLAGS.SunOS+= -lintl
FILES_SUBST+= APPLICATIONS_PATH="${PREFIX}/share/applications"
FILES_SUBST+= UPDATE_DESKTOPDB="${PREFIX}/bin/update-desktop-database"
+SUBST_CLASSES+= paths
+SUBST_STAGE.paths= pre-configure
+SUBST_FILES.paths= src/update-desktop-database.c
+SUBST_VARS.paths= LOCALBASE
+
PRINT_PLIST_AWK+= /^share\/applications\/mimeinfo.cache$$/ \
{ print "@comment in INSTALL script: " $$0; \
next; }
Index: pkgsrc/sysutils/desktop-file-utils/distinfo
diff -u pkgsrc/sysutils/desktop-file-utils/distinfo:1.18 pkgsrc/sysutils/desktop-file-utils/distinfo:1.19
--- pkgsrc/sysutils/desktop-file-utils/distinfo:1.18 Fri Jul 31 09:17:53 2020
+++ pkgsrc/sysutils/desktop-file-utils/distinfo Tue Sep 1 10:21:55 2020
@@ -1,6 +1,9 @@
-$NetBSD: distinfo,v 1.18 2020/07/31 09:17:53 wiz Exp $
+$NetBSD: distinfo,v 1.19 2020/09/01 10:21:55 schmonz Exp $
SHA1 (desktop-file-utils-0.26.tar.xz) = 9fd94cb7de302163015fcbc0e157c61323b1205d
RMD160 (desktop-file-utils-0.26.tar.xz) = a68b5994a7d099e2dffa279ea20c31cc7e39266e
SHA512 (desktop-file-utils-0.26.tar.xz) = 5b4e435f0b635d8f898ac7f5759f74a08ffbe2a56d41fee0e84ff57e73b98d08b57b4416f20b99f696dad8bcb1c20792b39acf836b0814220c0b386ea5f6b831
Size (desktop-file-utils-0.26.tar.xz) = 83132 bytes
+SHA1 (patch-src_install.c) = b3a410c90382fbc54abcd97a6e0eb96317d294af
+SHA1 (patch-src_update-desktop-database.c) = 162664c09deaf3b3f817e3f7d0b9f209151ca3b1
+SHA1 (patch-src_validator.c) = 41497fcd2da168e86d51387bba4bc3797adbc82f
Added files:
Index: pkgsrc/sysutils/desktop-file-utils/patches/patch-src_install.c
diff -u /dev/null pkgsrc/sysutils/desktop-file-utils/patches/patch-src_install.c:1.1
--- /dev/null Tue Sep 1 10:21:55 2020
+++ pkgsrc/sysutils/desktop-file-utils/patches/patch-src_install.c Tue Sep 1 10:21:55 2020
@@ -0,0 +1,37 @@
+$NetBSD: patch-src_install.c,v 1.1 2020/09/01 10:21:55 schmonz Exp $
+
+From OpenBSD ports, add pledge() support.
+
+--- src/install.c.orig Thu Jan 1 00:00:00 1970
++++ src/install.c
+@@ -839,6 +839,13 @@ main (int argc, char **argv)
+
+ setlocale (LC_ALL, "");
+
++#ifdef HAVE_PLEDGE
++ if (pledge ("stdio rpath wpath cpath fattr", NULL) == -1) {
++ g_printerr ("pledge\n");
++ return 1;
++ }
++#endif
++
+ basename = g_path_get_basename (argv[0]);
+ if (g_strcmp0 (basename, "desktop-file-edit") == 0)
+ edit_mode = TRUE;
+@@ -854,6 +861,16 @@ main (int argc, char **argv)
+ g_option_group_add_entries (group, install_options);
+ g_option_context_add_group (context, group);
+ }
++#ifdef HAVE_PLEDGE
++ else
++ {
++ /* In edit mode we can drop the fattr pledge. */
++ if (pledge ("stdio rpath wpath cpath", NULL) == -1) {
++ g_printerr ("pledge in edit_mode\n");
++ return 1;
++ }
++ }
++#endif
+
+ group = g_option_group_new ("edit", _("Edition options for desktop file"), _("Show desktop file edition options"), NULL, NULL);
+ g_option_group_add_entries (group, edit_options);
Index: pkgsrc/sysutils/desktop-file-utils/patches/patch-src_update-desktop-database.c
diff -u /dev/null pkgsrc/sysutils/desktop-file-utils/patches/patch-src_update-desktop-database.c:1.1
--- /dev/null Tue Sep 1 10:21:55 2020
+++ pkgsrc/sysutils/desktop-file-utils/patches/patch-src_update-desktop-database.c Tue Sep 1 10:21:55 2020
@@ -0,0 +1,51 @@
+$NetBSD: patch-src_update-desktop-database.c,v 1.1 2020/09/01 10:21:55 schmonz Exp $
+
+From OpenBSD ports, "Unveil the required directory with .desktop
+files and where the cache file needs to be written out to."
+
+--- src/update-desktop-database.c.orig Thu Jan 1 00:00:00 1970
++++ src/update-desktop-database.c
+@@ -451,8 +451,8 @@ main (int argc,
+ { NULL }
+ };
+
+-#if HAVE_PLEDGE
+- if (pledge("stdio rpath wpath cpath fattr", NULL) == -1) {
++#ifdef HAVE_PLEDGE
++ if (pledge ("stdio rpath wpath cpath fattr unveil", NULL) == -1) {
+ g_printerr ("pledge\n");
+ return 1;
+ }
+@@ -478,9 +478,19 @@ main (int argc,
+
+ print_desktop_dirs (desktop_dirs);
+
++#ifdef HAVE_PLEDGE
++ if (unveil ("@LOCALBASE@/share/locale/locale.alias", "r") == -1) {
++ g_printerr ("Can't unveil '@LOCALBASE@/share/locale/locale.alias': %s\n", g_strerror(errno));
++ }
++#endif
+ found_processable_dir = FALSE;
+ for (i = 0; desktop_dirs[i] != NULL; i++)
+ {
++#ifdef HAVE_PLEDGE
++ if (unveil (desktop_dirs[i], "rwc") == -1) {
++ g_printerr ("Can't unveil '%s' directory: %s\n", desktop_dirs[i], g_strerror(errno));
++ }
++#endif
+ error = NULL;
+ update_database (desktop_dirs[i], &error);
+
+@@ -495,6 +505,12 @@ main (int argc,
+ found_processable_dir = TRUE;
+ }
+ g_option_context_free (context);
++
++#ifdef HAVE_PLEDGE
++ if (unveil (NULL, NULL) == -1) {
++ g_printerr ("unveil\n");
++ }
++#endif
+
+ if (!found_processable_dir)
+ {
Index: pkgsrc/sysutils/desktop-file-utils/patches/patch-src_validator.c
diff -u /dev/null pkgsrc/sysutils/desktop-file-utils/patches/patch-src_validator.c:1.1
--- /dev/null Tue Sep 1 10:21:55 2020
+++ pkgsrc/sysutils/desktop-file-utils/patches/patch-src_validator.c Tue Sep 1 10:21:55 2020
@@ -0,0 +1,30 @@
+$NetBSD: patch-src_validator.c,v 1.1 2020/09/01 10:21:55 schmonz Exp $
+
+From OpenBSD ports, add pledge() support.
+
+--- src/validator.c.orig Thu Jan 1 00:00:00 1970
++++ src/validator.c
+@@ -28,6 +28,9 @@
+
+ #include <locale.h>
+
++#ifdef HAVE_PLEDGE
++#include <unistd.h>
++#endif
+ #include "validate.h"
+
+ static gboolean warn_kde = FALSE;
+@@ -50,6 +53,13 @@ main (int argc, char *argv[])
+ GError *error;
+ int i;
+ gboolean all_valid;
++
++#ifdef HAVE_PLEDGE
++ if (pledge ("stdio rpath", NULL) == -1) {
++ g_printerr ("pledge\n");
++ return 1;
++ }
++#endif
+
+ setlocale (LC_ALL, "");
+
Home |
Main Index |
Thread Index |
Old Index