diff options
author | Alyssa Ross <hi@alyssa.is> | 2023-06-16 06:56:35 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2023-06-16 06:56:35 +0000 |
commit | 99fcaeccb89621dd492203ce1f2d551c06f228ed (patch) | |
tree | 41cb730ae07383004789779b0f6e11cb3f4642a3 /nixpkgs/pkgs/development/libraries/cmocka | |
parent | 59c5f5ac8682acc13bb22bc29c7cf02f7d75f01f (diff) | |
parent | 75a5ebf473cd60148ba9aec0d219f72e5cf52519 (diff) | |
download | nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.gz nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.bz2 nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.lz nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.xz nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.zst nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.zip |
Merge branch 'nixos-unstable' of https://github.com/NixOS/nixpkgs
Conflicts: nixpkgs/nixos/modules/config/console.nix nixpkgs/nixos/modules/services/mail/mailman.nix nixpkgs/nixos/modules/services/mail/public-inbox.nix nixpkgs/nixos/modules/services/mail/rss2email.nix nixpkgs/nixos/modules/services/networking/ssh/sshd.nix nixpkgs/pkgs/applications/networking/instant-messengers/dino/default.nix nixpkgs/pkgs/applications/networking/irc/weechat/default.nix nixpkgs/pkgs/applications/window-managers/sway/default.nix nixpkgs/pkgs/build-support/go/module.nix nixpkgs/pkgs/build-support/rust/build-rust-package/default.nix nixpkgs/pkgs/development/interpreters/python/default.nix nixpkgs/pkgs/development/node-packages/overrides.nix nixpkgs/pkgs/development/tools/b4/default.nix nixpkgs/pkgs/servers/dict/dictd-db.nix nixpkgs/pkgs/servers/mail/public-inbox/default.nix nixpkgs/pkgs/tools/security/pinentry/default.nix nixpkgs/pkgs/tools/text/unoconv/default.nix nixpkgs/pkgs/top-level/all-packages.nix
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/cmocka')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/cmocka/default.nix | 67 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/libraries/cmocka/uintptr_t.patch | 16 |
2 files changed, 53 insertions, 30 deletions
diff --git a/nixpkgs/pkgs/development/libraries/cmocka/default.nix b/nixpkgs/pkgs/development/libraries/cmocka/default.nix index 9bfbc410c007..968bb91181ce 100644 --- a/nixpkgs/pkgs/development/libraries/cmocka/default.nix +++ b/nixpkgs/pkgs/development/libraries/cmocka/default.nix @@ -1,47 +1,54 @@ -{ fetchurl, lib, stdenv, cmake }: +{ fetchurl, fetchpatch, lib, stdenv, cmake }: stdenv.mkDerivation rec { pname = "cmocka"; majorVersion = "1.1"; - version = "${majorVersion}.5"; + version = "${majorVersion}.6"; src = fetchurl { url = "https://cmocka.org/files/${majorVersion}/cmocka-${version}.tar.xz"; - sha256 = "1dm8pdvkyfa8dsbz9bpq7wwgixjij4sii9bbn5sgvqjm5ljdik7h"; + sha256 = "0xksffx1w3pzm18ynf28cx8scrhylcbz43s1rgkkdqnyil1q6cjv"; }; + patches = [ + ./uintptr_t.patch + ]; + nativeBuildInputs = [ cmake ]; - meta = with lib; { - description = "Lightweight library to simplify and generalize unit tests for C"; + cmakeFlags = lib.optional doCheck "-DUNIT_TESTING=ON" + ++ lib.optional stdenv.hostPlatform.isStatic "-DBUILD_SHARED_LIBS=OFF"; - longDescription = - ''There are a variety of C unit testing frameworks available however - many of them are fairly complex and require the latest compiler - technology. Some development requires the use of old compilers which - makes it difficult to use some unit testing frameworks. In addition - many unit testing frameworks assume the code being tested is an - application or module that is targeted to the same platform that will - ultimately execute the test. Because of this assumption many - frameworks require the inclusion of standard C library headers in the - code module being tested which may collide with the custom or - incomplete implementation of the C library utilized by the code under - test. - - Cmocka only requires a test application is linked with the standard C - library which minimizes conflicts with standard C library headers. - Also, CMocka tries to avoid the use of some of the newer features of - C compilers. - - This results in CMocka being a relatively small library that can be - used to test a variety of exotic code. If a developer wishes to - simply test an application with the latest compiler then other unit - testing frameworks may be preferable. - - This is the successor of Google's Cmockery.''; + doCheck = true; + meta = with lib; { + description = "Lightweight library to simplify and generalize unit tests for C"; + longDescription = '' + There are a variety of C unit testing frameworks available however + many of them are fairly complex and require the latest compiler + technology. Some development requires the use of old compilers which + makes it difficult to use some unit testing frameworks. In addition + many unit testing frameworks assume the code being tested is an + application or module that is targeted to the same platform that will + ultimately execute the test. Because of this assumption many + frameworks require the inclusion of standard C library headers in the + code module being tested which may collide with the custom or + incomplete implementation of the C library utilized by the code under + test. + + Cmocka only requires a test application is linked with the standard C + library which minimizes conflicts with standard C library headers. + Also, CMocka tries to avoid the use of some of the newer features of + C compilers. + + This results in CMocka being a relatively small library that can be + used to test a variety of exotic code. If a developer wishes to + simply test an application with the latest compiler then other unit + testing frameworks may be preferable. + + This is the successor of Google's Cmockery. + ''; homepage = "https://cmocka.org/"; - license = licenses.asl20; platforms = platforms.all; maintainers = with maintainers; [ kragniz rasendubi ]; diff --git a/nixpkgs/pkgs/development/libraries/cmocka/uintptr_t.patch b/nixpkgs/pkgs/development/libraries/cmocka/uintptr_t.patch new file mode 100644 index 000000000000..ac69560d1c99 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/cmocka/uintptr_t.patch @@ -0,0 +1,16 @@ +Resolve messy situation with uintptr_t and stdint.h + +Platforms common in nixpkgs will have stdint.h - thereby we avoid problems +that seem complicated to avoid. References: +https://gitlab.com/cmocka/cmocka/-/issues/38#note_1286565655 +https://git.alpinelinux.org/aports/plain/main/cmocka/musl_uintptr.patch?id=6a15dd0d0ba9cc354a621fb359ca5e315ff2eabd + +It isn't easy, as 1.1.6 codebase is missing stdint.h includes on many places, +and HAVE_UINTPTR_T from cmake also wouldn't get on all places it needs to. +--- a/include/cmocka.h ++++ b/include/cmocka.h +@@ -18,2 +18,4 @@ + #define CMOCKA_H_ ++#include <stdint.h> ++#define HAVE_UINTPTR_T 1 + |