mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-03 13:30:36 +00:00
jq: fix build for musl
This commit is contained in:
31
pkgs/by-name/jq/jq/musl.patch
Normal file
31
pkgs/by-name/jq/jq/musl.patch
Normal file
@@ -0,0 +1,31 @@
|
||||
From 63e9449a8142ce30c83fcd7e9396e5de9843774e Mon Sep 17 00:00:00 2001
|
||||
From: Alyssa Ross <hi@alyssa.is>
|
||||
Date: Thu, 3 Jul 2025 11:00:13 +0200
|
||||
Subject: [PATCH] jq.test: drop non-portable %F test
|
||||
|
||||
%F is a non-portable GNU extension, not supported by all strptime
|
||||
implementations (for example musl's).
|
||||
|
||||
Link: https://github.com/jqlang/jq/pull/3365
|
||||
---
|
||||
tests/jq.test | 4 ----
|
||||
1 file changed, 4 deletions(-)
|
||||
|
||||
diff --git a/tests/jq.test b/tests/jq.test
|
||||
index 4ecf72f..6bfb6f8 100644
|
||||
--- a/tests/jq.test
|
||||
+++ b/tests/jq.test
|
||||
@@ -1848,10 +1848,6 @@ try ["OK", strflocaltime({})] catch ["KO", .]
|
||||
"2015-03-05T23:51:47Z"
|
||||
[[2015,2,5,23,51,47,4,63],1425599507]
|
||||
|
||||
-[strptime("%FT%T")|(.,mktime)]
|
||||
-"2025-06-07T08:09:10"
|
||||
-[[2025,5,7,8,9,10,6,157],1749283750]
|
||||
-
|
||||
# Check day-of-week and day of year computations
|
||||
# (should trip an assert if this fails)
|
||||
last(range(365 * 67)|("1970-03-01T01:02:03Z"|strptime("%Y-%m-%dT%H:%M:%SZ")|mktime) + (86400 * .)|strftime("%Y-%m-%dT%H:%M:%SZ")|strptime("%Y-%m-%dT%H:%M:%SZ"))
|
||||
--
|
||||
2.49.0
|
||||
|
||||
@@ -30,14 +30,15 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
"out"
|
||||
];
|
||||
|
||||
# tortured syntax to avoid rebuilds
|
||||
# needed because epoch conversion test here is right at the end of 32 bit integer space
|
||||
# See also: https://github.com/jqlang/jq/blob/859a8073ee8a21f2133154eea7c2bd5e0d60837f/tests/optional.test#L15-L18
|
||||
# "-D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64" would be preferrable, but breaks with dynamic linking,
|
||||
# unless done globally in stdenv for all of 32 bit.
|
||||
${if stdenv.hostPlatform.is32bit then "patches" else null} = [
|
||||
./disable-end-of-epoch-conversion-test.patch
|
||||
];
|
||||
patches =
|
||||
[ ./musl.patch ]
|
||||
++ lib.optionals stdenv.hostPlatform.is32bit [
|
||||
# needed because epoch conversion test here is right at the end of 32 bit integer space
|
||||
# See also: https://github.com/jqlang/jq/blob/859a8073ee8a21f2133154eea7c2bd5e0d60837f/tests/optional.test#L15-L18
|
||||
# "-D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64" would be preferrable, but breaks with dynamic linking,
|
||||
# unless done globally in stdenv for all of 32 bit.
|
||||
./disable-end-of-epoch-conversion-test.patch
|
||||
];
|
||||
|
||||
# https://github.com/jqlang/jq/issues/2871
|
||||
postPatch = lib.optionalString stdenv.hostPlatform.isFreeBSD ''
|
||||
|
||||
Reference in New Issue
Block a user