From bd23e60931e4cbe85f8fbefe350b92de277791ea Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Wed, 4 Jun 2025 23:48:54 +0200 Subject: [PATCH] Revert "libfaketime: 0.9.10 -> 0.9.11" This reverts commit abeb33f662ae92b2d9a2d3080c480aef3bff3b0d as it break texlive on darwin ref. https://github.com/NixOS/nixpkgs/pull/413916 ref. https://github.com/wolfcw/libfaketime/issues/499 --- .../0001-Remove-unsupported-clang-flags.patch | 13 ++++++++++ pkgs/by-name/li/libfaketime/package.nix | 25 +++++++++++++++---- 2 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 pkgs/by-name/li/libfaketime/0001-Remove-unsupported-clang-flags.patch diff --git a/pkgs/by-name/li/libfaketime/0001-Remove-unsupported-clang-flags.patch b/pkgs/by-name/li/libfaketime/0001-Remove-unsupported-clang-flags.patch new file mode 100644 index 000000000000..7dfad4978005 --- /dev/null +++ b/pkgs/by-name/li/libfaketime/0001-Remove-unsupported-clang-flags.patch @@ -0,0 +1,13 @@ +diff --git a/src/Makefile b/src/Makefile +index 2af4804..bcff809 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -80,7 +80,7 @@ PREFIX ?= /usr/local + LIBDIRNAME ?= /lib/faketime + PLATFORM ?=$(shell uname) + +-CFLAGS += -std=gnu99 -Wall -Wextra -Werror -Wno-nonnull-compare -DFAKE_PTHREAD -DFAKE_STAT -DFAKE_UTIME -DFAKE_SLEEP -DFAKE_TIMERS -DFAKE_INTERNAL_CALLS -fPIC -DPREFIX='"'$(PREFIX)'"' -DLIBDIRNAME='"'$(LIBDIRNAME)'"' $(FAKETIME_COMPILE_CFLAGS) ++CFLAGS += -std=gnu99 -Wall -Wextra -DFAKE_PTHREAD -DFAKE_STAT -DFAKE_UTIME -DFAKE_SLEEP -DFAKE_TIMERS -DFAKE_INTERNAL_CALLS -fPIC -DPREFIX='"'$(PREFIX)'"' -DLIBDIRNAME='"'$(LIBDIRNAME)'"' $(FAKETIME_COMPILE_CFLAGS) + ifeq ($(PLATFORM),SunOS) + CFLAGS += -D__EXTENSIONS__ -D_XOPEN_SOURCE=600 + endif diff --git a/pkgs/by-name/li/libfaketime/package.nix b/pkgs/by-name/li/libfaketime/package.nix index 9c7847b94567..208680a40eb8 100644 --- a/pkgs/by-name/li/libfaketime/package.nix +++ b/pkgs/by-name/li/libfaketime/package.nix @@ -9,18 +9,33 @@ stdenv.mkDerivation rec { pname = "libfaketime"; - version = "0.9.11"; + version = "0.9.10"; src = fetchFromGitHub { owner = "wolfcw"; repo = "libfaketime"; rev = "v${version}"; - sha256 = "sha256-a0TjHYzwbkRQyvr9Sj/DqjgLBnE1Z8kjsTQxTfGqLjE="; + sha256 = "sha256-DYRuQmIhQu0CNEboBAtHOr/NnWxoXecuPMSR/UQ/VIQ="; }; - patches = [ - ./nix-store-date.patch - ]; + patches = + [ + ./nix-store-date.patch + (fetchpatch { + name = "0001-libfaketime.c-wrap-timespec_get-in-TIME_UTC-macro.patch"; + url = "https://github.com/wolfcw/libfaketime/commit/e0e6b79568d36a8fd2b3c41f7214769221182128.patch"; + sha256 = "sha256-KwwP76v0DXNW73p/YBvwUOPdKMAcVdbQSKexD/uFOYo="; + }) + (fetchpatch { + name = "LFS64.patch"; + url = "https://github.com/wolfcw/libfaketime/commit/f32986867addc9d22b0fab29c1c927f079d44ac1.patch"; + hash = "sha256-fIXuxxcV9J2IcgwcwSrMo4maObkH9WYv1DC/wdtbq/g="; + }) + ] + ++ (lib.optionals stdenv.cc.isClang [ + # https://github.com/wolfcw/libfaketime/issues/277 + ./0001-Remove-unsupported-clang-flags.patch + ]); postPatch = '' patchShebangs test src