diff options
author | psykose <alice@ayaya.dev> | 2023-03-28 20:05:05 +0000 |
---|---|---|
committer | psykose <alice@ayaya.dev> | 2023-03-28 22:05:06 +0200 |
commit | e99c0e1ab1248b67d25763b493b9a9b8413dc74b (patch) | |
tree | 0f39f2e0c187e4b66498f0369579cf08c2d9bf2b | |
parent | 5c28cc408e8ed89f0f38afdd42515f99b5301c85 (diff) |
community/startup-notification: fix 32-bit time_t
-rw-r--r-- | community/startup-notification/32-bit-time-t.patch | 110 | ||||
-rw-r--r-- | community/startup-notification/APKBUILD | 13 |
2 files changed, 120 insertions, 3 deletions
diff --git a/community/startup-notification/32-bit-time-t.patch b/community/startup-notification/32-bit-time-t.patch new file mode 100644 index 00000000000..c0c8ce2a0dd --- /dev/null +++ b/community/startup-notification/32-bit-time-t.patch @@ -0,0 +1,110 @@ +Patch-Source: https://git.yoctoproject.org/poky/plain/meta/recipes-graphics/startup-notification/startup-notification-0.12/time_t.patch +-- +Upstream-Status: Backport +Signed-off-by: Ross Burton <ross.burton@arm.com> + +From a7e49fefde18ea8d5bada8096d32f23bcfb5a6dc Mon Sep 17 00:00:00 2001 +From: "Federico G. Schwindt" <fgsch@openbsd.org> +Date: Mon, 17 Feb 2014 15:48:12 +0100 +Subject: [PATCH 1/3] Fix crash on 32bit architectures where time_t is 64 bit + +This is an ABI change on platforms where sizeof(time_t) doesn't equal +sizeof(long). For most platforms this change shouldn't make a difference +at present. OpenBSD recently switched to 64bit time_t on all architectures +to avoid time_t overflow in 2038 on 32bit machines. + +This fix extends to consumers of startup-notification, for instance +the window manager of XFCE, which is how I got involved in this. +See http://mail.xfce.org/pipermail/xfce4-dev/2014-February/030611.html +and follow-ups. The XFCE devs pointed out that my patch to fix a +crash in XFCE's window manager depends on this startup-notification patch. + +Signed-off-by: Julien Danjou <julien@danjou.info> +--- + libsn/sn-monitor.c | 8 ++++---- + libsn/sn-monitor.h | 8 ++++---- + 2 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/libsn/sn-monitor.c b/libsn/sn-monitor.c +index 2a9ad16..f419bc1 100644 +--- a/libsn/sn-monitor.c ++++ b/libsn/sn-monitor.c +@@ -364,8 +364,8 @@ sn_startup_sequence_get_screen (SnStartupSequence *sequence) + **/ + void + sn_startup_sequence_get_initiated_time (SnStartupSequence *sequence, +- long *tv_sec, +- long *tv_usec) ++ time_t *tv_sec, ++ suseconds_t *tv_usec) + { + if (tv_sec) + *tv_sec = sequence->initiation_time.tv_sec; +@@ -386,8 +386,8 @@ sn_startup_sequence_get_initiated_time (SnStartupSequence *sequence, + **/ + void + sn_startup_sequence_get_last_active_time (SnStartupSequence *sequence, +- long *tv_sec, +- long *tv_usec) ++ time_t *tv_sec, ++ suseconds_t *tv_usec) + { + /* for now the same as get_initiated_time */ + if (tv_sec) +diff --git a/libsn/sn-monitor.h b/libsn/sn-monitor.h +index b58581f..2f639df 100644 +--- a/libsn/sn-monitor.h ++++ b/libsn/sn-monitor.h +@@ -77,11 +77,11 @@ const char* sn_startup_sequence_get_application_id (SnStartupSequence *se + int sn_startup_sequence_get_screen (SnStartupSequence *sequence); + + void sn_startup_sequence_get_initiated_time (SnStartupSequence *sequence, +- long *tv_sec, +- long *tv_usec); ++ time_t *tv_sec, ++ suseconds_t *tv_usec); + void sn_startup_sequence_get_last_active_time (SnStartupSequence *sequence, +- long *tv_sec, +- long *tv_usec); ++ time_t *tv_sec, ++ suseconds_t *tv_usec); + + void sn_startup_sequence_complete (SnStartupSequence *sequence); + +-- +2.26.2 + +From ea9f7e4cc6fd8c08d175ed7774ed2c5bd11c8ef0 Mon Sep 17 00:00:00 2001 +From: Colin Walters <walters@verbum.org> +Date: Mon, 17 Feb 2014 14:37:09 -0500 +Subject: [PATCH 2/3] Add include of <sys/select.h> for previous patch + +Unfortunately while the standard says that <sys/types.h> is the +correct header to get suseconds_t, at least with glibc, that requires +-DXOPEN_SOURCE. Which is problematic for a public header, because +then all *users* of startup-notification will be required to define +that. + +Poking around a bit, it looks like at least with glibc, <sys/select.h> +will give us an unconditional define. + +Signed-off-by: Julien Danjou <julien@danjou.info> +--- + libsn/sn-monitor.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/libsn/sn-monitor.h b/libsn/sn-monitor.h +index 2f639df..cea4e12 100644 +--- a/libsn/sn-monitor.h ++++ b/libsn/sn-monitor.h +@@ -28,6 +28,7 @@ + #define __SN_MONITOR_H__ + + #include <libsn/sn-common.h> ++#include <sys/select.h> + + SN_BEGIN_DECLS + +-- +2.26.2 + diff --git a/community/startup-notification/APKBUILD b/community/startup-notification/APKBUILD index 38f2bf352ab..478a15c0d91 100644 --- a/community/startup-notification/APKBUILD +++ b/community/startup-notification/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=startup-notification pkgver=0.12 -pkgrel=4 +pkgrel=5 pkgdesc="Monitor and display application startup" url="https://www.freedesktop.org/wiki/Software/startup-notification" arch="all" @@ -9,7 +9,10 @@ license="LGPL-2.0-or-later" subpackages="$pkgname-dev" depends_dev="libsm-dev xcb-util-dev" makedepends="$depends_dev libx11-dev" -source="https://www.freedesktop.org/software/startup-notification/releases/startup-notification-$pkgver.tar.gz" +source="https://www.freedesktop.org/software/startup-notification/releases/startup-notification-$pkgver.tar.gz + 32-bit-time-t.patch + " +options="!check" # checks are horribly dated prepare() { default_prepare @@ -33,4 +36,8 @@ check() { package() { make DESTDIR="$pkgdir" install } -sha512sums="ea1246acdb50dafd9ced9914ec3c8f0d499c0ca3cfd447b43a444c768a6e9ea7135e5c42d9ca0089354698ac235bd86d42f12c70a3a17c9c79f998c07461f7ab startup-notification-0.12.tar.gz" + +sha512sums=" +ea1246acdb50dafd9ced9914ec3c8f0d499c0ca3cfd447b43a444c768a6e9ea7135e5c42d9ca0089354698ac235bd86d42f12c70a3a17c9c79f998c07461f7ab startup-notification-0.12.tar.gz +228fbc819187ecfff68eda9ddacb425004fcb1bd138d125d1d11b322e5db69a78ae65a5e1824df05f1eef224354f78d52adef44adefd6ecfbe11e70781ef686a 32-bit-time-t.patch +" |