diff options
Diffstat (limited to 'devel/libfaketime/files')
-rw-r--r-- | devel/libfaketime/files/patch-man_Makefile | 22 | ||||
-rw-r--r-- | devel/libfaketime/files/patch-src_Makefile | 34 | ||||
-rw-r--r-- | devel/libfaketime/files/patch-src_faketime.c | 11 | ||||
-rw-r--r-- | devel/libfaketime/files/patch-src_libfaketime.c | 109 | ||||
-rw-r--r-- | devel/libfaketime/files/patch-test_Makefile | 10 | ||||
-rw-r--r-- | devel/libfaketime/files/patch-test_functests_test__exclude__mono.sh | 8 |
6 files changed, 135 insertions, 59 deletions
diff --git a/devel/libfaketime/files/patch-man_Makefile b/devel/libfaketime/files/patch-man_Makefile deleted file mode 100644 index 0bf6ffb70bbe..000000000000 --- a/devel/libfaketime/files/patch-man_Makefile +++ /dev/null @@ -1,22 +0,0 @@ ---- man/Makefile.orig 2016-06-27 06:54:00 UTC -+++ man/Makefile -@@ -1,14 +1,16 @@ - INSTALL ?= install - - PREFIX ?= /usr/local -+MANDIR ?= /share/man - - all: - - install: -- $(INSTALL) -Dm0644 faketime.1 "${DESTDIR}${PREFIX}/share/man/man1/faketime.1" -- gzip -f "${DESTDIR}${PREFIX}/share/man/man1/faketime.1" -+ $(INSTALL) -dm0755 "${DESTDIR}${PREFIX}$(MANDIR)/man1" -+ $(INSTALL) -Dm0644 faketime.1 "$(DESTDIR)$(PREFIX)$(MANDIR)/man1" -+ gzip -f $(DESTDIR)$(PREFIX)$(MANDIR)/man1/faketime.1 - - uninstall: -- rm -f "${DESTDIR}${PREFIX}/share/man/man1/faketime.1.gz" -+ rm -f "$(DESTDIR)$(PREFIX)$(MANDIR)/man1/faketime.1.gz" - - .PHONY: all install uninstall diff --git a/devel/libfaketime/files/patch-src_Makefile b/devel/libfaketime/files/patch-src_Makefile index 1d1e3785ffbf..729d91339bf3 100644 --- a/devel/libfaketime/files/patch-src_Makefile +++ b/devel/libfaketime/files/patch-src_Makefile @@ -1,17 +1,27 @@ ---- src/Makefile.orig 2016-06-27 06:54:00 UTC +--- src/Makefile.orig 2025-06-09 12:31:15 UTC +++ src/Makefile -@@ -62,11 +62,19 @@ PREFIX ?= /usr/local - LIBDIRNAME ?= /lib/faketime - PLATFORM ?=$(shell uname) +@@ -122,20 +122,27 @@ export COMPILER + endif + export COMPILER --CFLAGS += -std=gnu99 -Wall -Wextra -Werror -DFAKE_STAT -DFAKE_SLEEP -DFAKE_TIMERS -DFAKE_INTERNAL_CALLS -fPIC -DPREFIX='"'$(PREFIX)'"' -DLIBDIRNAME='"'$(LIBDIRNAME)'"' +-CFLAGS += -std=gnu99 -Wall -Wextra -Werror -DFAKE_PTHREAD -DFAKE_STAT -DFAKE_UTIME -DFAKE_SLEEP -DFAKE_TIMERS -DFAKE_INTERNAL_CALLS -fPIC -DPREFIX='"'$(PREFIX)'"' -DLIBDIRNAME='"'$(LIBDIRNAME)'"' $(FAKETIME_COMPILE_CFLAGS) +# Honour/Respect User *FLAGS +# User variables come LAST. Do NOT append to them. -+ + +WARNS ?= -Wall -Wextra -Werror -+FEATS ?= -DFAKE_STAT -DFAKE_SLEEP -DFAKE_TIMERS -DFAKE_INTERNAL_CALLS ++FEATS ?= -DFAKE_PTHREAD -DFAKE_STAT -DFAKE_UTIME -DFAKE_SLEEP -DFAKE_TIMERS -DFAKE_INTERNAL_CALLS +FLAGS ?= -std=gnu99 -fPIC $(WARNS) $(FEATS) -DPREFIX='"'$(PREFIX)'"' -DLIBDIRNAME='"'$(LIBDIRNAME)'"' + + ifeq ($(COMPILER),clang) +-CFLAGS += -Wno-tautological-pointer-compare ++FLAGS += -Wno-tautological-pointer-compare + endif + + ifeq ($(COMPILER),gcc) +-CFLAGS += -Wno-nonnull-compare ++FLAGS += -Wno-nonnull-compare + endif + ifeq ($(PLATFORM),SunOS) -CFLAGS += -D__EXTENSIONS__ -D_XOPEN_SOURCE=600 +FLAGS += -D__EXTENSIONS__ -D_XOPEN_SOURCE=600 @@ -21,13 +31,13 @@ + LIB_LDFLAGS += -shared - LDFLAGS += -lpthread -@@ -74,7 +82,7 @@ ifneq ($(PLATFORM),SunOS) + LDFLAGS += $(FAKETIME_LINK_FLAGS) +@@ -143,7 +150,7 @@ endif LDFLAGS += -Wl,--version-script=libfaketime.map endif --LDADD += -ldl -lm -lrt -+LDADD += -lm -lrt - BIN_LDFLAGS += -lrt +-LDADD += -ldl -lm -lrt -lpthread ++LDADD += -lm -lrt -lpthread + BIN_LDFLAGS += -lrt -lpthread SRC = libfaketime.c diff --git a/devel/libfaketime/files/patch-src_faketime.c b/devel/libfaketime/files/patch-src_faketime.c new file mode 100644 index 000000000000..d942689af320 --- /dev/null +++ b/devel/libfaketime/files/patch-src_faketime.c @@ -0,0 +1,11 @@ +--- src/faketime.c.orig 2025-06-09 12:31:15 UTC ++++ src/faketime.c +@@ -50,7 +50,7 @@ const char version[] = "0.9.12"; + + const char version[] = "0.9.12"; + +-#if (defined __APPLE__) || (defined __sun) ++#if (defined __APPLE__) || (defined __sun) || defined(__FreeBSD__) + static const char *date_cmd = "gdate"; + #else + static const char *date_cmd = "date"; diff --git a/devel/libfaketime/files/patch-src_libfaketime.c b/devel/libfaketime/files/patch-src_libfaketime.c index 69334d3542b1..2ad8db4c58fd 100644 --- a/devel/libfaketime/files/patch-src_libfaketime.c +++ b/devel/libfaketime/files/patch-src_libfaketime.c @@ -1,20 +1,97 @@ ---- src/libfaketime.c.orig 2016-06-27 06:54:00 UTC +--- src/libfaketime.c.orig 2025-06-09 12:31:15 UTC +++ src/libfaketime.c -@@ -23,6 +23,17 @@ - - #define _GNU_SOURCE /* required to get RTLD_NEXT defined */ - -+/* -+ * libfaketime.c:1246:5: error: conflicting types for 'gettimeofday' -+ * int gettimeofday(struct timeval *tv, void *tz) -+ * vs -+ * int gettimeofday(struct timeval *, struct timezone *); -+ */ -+ +@@ -41,9 +41,15 @@ + #endif + #endif + #include <time.h> +-#ifdef MACOS_DYLD_INTERPOSE ++#if defined (MACOS_DYLD_INTERPOSE) || defined (__FreeBSD__) + #include <pthread.h> ++#ifdef __FreeBSD__ +#define gettimeofday bsd_gettimeofday -+#include <sys/time.h> ++#endif + #include <sys/time.h> ++#ifdef __FreeBSD__ +#undef gettimeofday ++#endif + #include <utime.h> + #endif + #include <math.h> +@@ -151,6 +157,14 @@ void do_macos_dyld_interpose(void); + #define CLOCK_MONOTONIC_RAW (CLOCK_MONOTONIC + 1) + #endif + ++/* On some platforms (e.g. FreeBSD 15) CLOCK_BOOTTIME is an alias of another clock. ++ * Only treat BOOTTIME as distinct if its value differs from MONOTONIC and MONOTONIC_RAW. */ ++#if defined(CLOCK_BOOTTIME) && \ ++ (CLOCK_BOOTTIME != CLOCK_MONOTONIC) && \ ++ (CLOCK_BOOTTIME != CLOCK_MONOTONIC_RAW) ++#define HAVE_DISTINCT_CLOCK_BOOTTIME 1 ++#endif + - #include <stdio.h> - #include <stdlib.h> - #include <stdint.h> + #if defined FAKE_UTIME && !defined FAKE_FILE_TIMESTAMPS + #define FAKE_FILE_TIMESTAMPS + #endif +@@ -718,7 +732,7 @@ static void system_time_from_system (struct system_tim + ; + DONT_FAKE_TIME((*real_clock_gettime)(CLOCK_MONOTONIC_RAW, &systime->mon_raw)) + ; +-#ifdef CLOCK_BOOTTIME ++#ifdef HAVE_DISTINCT_CLOCK_BOOTTIME + DONT_FAKE_TIME((*real_clock_gettime)(CLOCK_BOOTTIME, &systime->boot)) + ; + #endif +@@ -2384,7 +2398,7 @@ int clock_gettime(clockid_t clk_id, struct timespec *t + #ifdef CLOCK_MONOTONIC_COARSE + && clk_id != CLOCK_MONOTONIC_COARSE + #endif +-#ifdef CLOCK_BOOTTIME ++#ifdef HAVE_DISTINCT_CLOCK_BOOTTIME + && clk_id != CLOCK_BOOTTIME + #endif + )) +@@ -2619,7 +2633,7 @@ parse_modifiers: + ftpl_starttime.mon.tv_nsec = ftpl_timecache.mon.tv_nsec; + ftpl_starttime.mon_raw.tv_sec = ftpl_timecache.mon_raw.tv_sec; + ftpl_starttime.mon_raw.tv_nsec = ftpl_timecache.mon_raw.tv_nsec; +-#ifdef CLOCK_BOOTTIME ++#ifdef HAVE_DISTINCT_CLOCK_BOOTTIME + ftpl_starttime.boot.tv_sec = ftpl_timecache.boot.tv_sec; + ftpl_starttime.boot.tv_nsec = ftpl_timecache.boot.tv_nsec; + #endif +@@ -3302,7 +3316,7 @@ int fake_clock_gettime(clockid_t clk_id, struct timesp + case CLOCK_MONOTONIC_RAW: + timespecsub(tp, &ftpl_starttime.mon_raw, &tmp_ts); + break; +-#ifdef CLOCK_BOOTTIME ++#ifdef HAVE_DISTINCT_CLOCK_BOOTTIME + case CLOCK_BOOTTIME: + timespecsub(tp, &ftpl_starttime.boot, &tmp_ts); + break; +@@ -3447,7 +3461,7 @@ int fake_clock_gettime(clockid_t clk_id, struct timesp + case CLOCK_MONOTONIC_RAW: + timespecsub(tp, &ftpl_starttime.mon_raw, &tdiff); + break; +-#ifdef CLOCK_BOOTTIME ++#ifdef HAVE_DISTINCT_CLOCK_BOOTTIME + case CLOCK_BOOTTIME: + timespecsub(tp, &ftpl_starttime.boot, &tdiff); + break; +@@ -3503,7 +3517,7 @@ abort: + ftpl_faketimecache.mon_raw.tv_sec = tp->tv_sec; + ftpl_faketimecache.mon_raw.tv_nsec = tp->tv_nsec; + } +-#ifdef CLOCK_BOOTTIME ++#ifdef HAVE_DISTINCT_CLOCK_BOOTTIME + else if (clk_id == CLOCK_BOOTTIME) + { + ftpl_timecache.boot.tv_sec = tp_save.tv_sec; +@@ -3632,7 +3646,7 @@ int __clock_gettime(clockid_t clk_id, struct timespec + #ifdef CLOCK_MONOTONIC_COARSE + && clk_id != CLOCK_MONOTONIC_COARSE + #endif +-#ifdef CLOCK_BOOTTIME ++#ifdef HAVE_DISTINCT_CLOCK_BOOTTIME + && clk_id != CLOCK_BOOTTIME + #endif + )) diff --git a/devel/libfaketime/files/patch-test_Makefile b/devel/libfaketime/files/patch-test_Makefile index b2957b2e6ae8..c1fdae76f0ea 100644 --- a/devel/libfaketime/files/patch-test_Makefile +++ b/devel/libfaketime/files/patch-test_Makefile @@ -1,13 +1,13 @@ ---- test/Makefile.orig 2016-06-27 06:54:00 UTC +--- test/Makefile.orig 2025-06-09 12:31:15 UTC +++ test/Makefile @@ -1,7 +1,7 @@ -CC = gcc +CC ?= gcc --CFLAGS = -std=gnu99 -Wall -DFAKE_STAT -Werror -Wextra --LDFLAGS = -lrt -+CFLAGS ?= -std=gnu99 -Wall -DFAKE_STAT -Werror -Wextra -+LDFLAGS = -lrt -lcompat +-CFLAGS += -std=gnu99 -Wall -DFAKE_STAT -Werror -Wextra $(FAKETIME_COMPILE_CFLAGS) -U_FILE_OFFSET_BITS -U_TIME_BITS +-LDFLAGS += -lrt -lpthread ++CFLAGS ?= -std=gnu99 -Wall -DFAKE_STAT -Werror -Wextra $(FAKETIME_COMPILE_CFLAGS) -U_FILE_OFFSET_BITS -U_TIME_BITS ++LDFLAGS += -lcompat -lrt -lpthread SRC = timetest.c OBJ = ${SRC:.c=.o} diff --git a/devel/libfaketime/files/patch-test_functests_test__exclude__mono.sh b/devel/libfaketime/files/patch-test_functests_test__exclude__mono.sh index 146f2a00f872..1fb49ca761b9 100644 --- a/devel/libfaketime/files/patch-test_functests_test__exclude__mono.sh +++ b/devel/libfaketime/files/patch-test_functests_test__exclude__mono.sh @@ -1,9 +1,9 @@ ---- test/functests/test_exclude_mono.sh.orig 2016-06-27 06:54:00 UTC +--- test/functests/test_exclude_mono.sh.orig 2025-06-09 12:31:15 UTC +++ test/functests/test_exclude_mono.sh -@@ -65,7 +65,7 @@ get_monotonic_time() - dont_fake_mono=$1; shift; +@@ -66,7 +66,7 @@ get_monotonic_time() clock_id=$1; shift; - DONT_FAKE_MONOTONIC=${dont_fake_mono} fakecmd "2014-07-21 09:00:00" \ + FAKETIME_DONT_FAKE_MONOTONIC=${dont_fake_mono} \ + fakecmd "2014-07-21 09:00:00" \ - /bin/bash -c "for i in 1 2; do \ + /usr/bin/env bash -c "for i in 1 2; do \ perl -w -MTime::HiRes=clock_gettime,${clock_id} -E \ |