lol

cmocka: 1.1.5 -> 1.1.6

> Version 1.1.6 has been released to fix several issues
> and a few small new features.
https://gitlab.com/cmocka/cmocka/-/blob/cmocka-1.1.6/ChangeLog

We might conditionalize the patch e.g. for musl only,
but I don't think it could cause trouble elsewhere.

+21 -14
+5 -14
pkgs/development/libraries/cmocka/default.nix
··· 1 1 { fetchurl, fetchpatch, lib, stdenv, cmake }: 2 - let 3 - # Temporary split to save rebuilds; see PR #217469 4 - isUpdated = with stdenv; isDarwin && isAarch64; 5 - in 2 + 6 3 stdenv.mkDerivation rec { 7 4 pname = "cmocka"; 8 5 majorVersion = "1.1"; 9 - version = "${majorVersion}." + (if isUpdated then "6" else "5"); 6 + version = "${majorVersion}.6"; 10 7 11 8 src = fetchurl { 12 9 url = "https://cmocka.org/files/${majorVersion}/cmocka-${version}.tar.xz"; 13 - sha256 = if isUpdated 14 - then "0xksffx1w3pzm18ynf28cx8scrhylcbz43s1rgkkdqnyil1q6cjv" 15 - else "1dm8pdvkyfa8dsbz9bpq7wwgixjij4sii9bbn5sgvqjm5ljdik7h"; 10 + sha256 = "0xksffx1w3pzm18ynf28cx8scrhylcbz43s1rgkkdqnyil1q6cjv"; 16 11 }; 17 12 18 - patches = lib.optionals (!isUpdated) [ 19 - (fetchpatch { 20 - name = "musl-uintptr.patch"; 21 - url = "https://git.alpinelinux.org/aports/plain/main/cmocka/musl_uintptr.patch?id=6a15dd0d0ba9cc354a621fb359ca5e315ff2eabd"; 22 - sha256 = "sha256-fhb2Tax30kRTGuaKvzSzglSd/ntxiNeGFJt5I8poa24="; 23 - }) 13 + patches = [ 14 + ./uintptr_t.patch 24 15 ]; 25 16 26 17 nativeBuildInputs = [ cmake ];
+16
pkgs/development/libraries/cmocka/uintptr_t.patch
··· 1 + Resolve messy situation with uintptr_t and stdint.h 2 + 3 + Platforms common in nixpkgs will have stdint.h - thereby we avoid problems 4 + that seem complicated to avoid. References: 5 + https://gitlab.com/cmocka/cmocka/-/issues/38#note_1286565655 6 + https://git.alpinelinux.org/aports/plain/main/cmocka/musl_uintptr.patch?id=6a15dd0d0ba9cc354a621fb359ca5e315ff2eabd 7 + 8 + It isn't easy, as 1.1.6 codebase is missing stdint.h includes on many places, 9 + and HAVE_UINTPTR_T from cmake also wouldn't get on all places it needs to. 10 + --- a/include/cmocka.h 11 + +++ b/include/cmocka.h 12 + @@ -18,2 +18,4 @@ 13 + #define CMOCKA_H_ 14 + +#include <stdint.h> 15 + +#define HAVE_UINTPTR_T 1 16 +