···1{
02 runCommand,
3 srcOnly,
04 emptyDirectory,
5- glibc,
006}:
78let
9 emptySrc = srcOnly emptyDirectory;
10- glibcSrc = srcOnly glibc;
00000000000000000000000000000000000000000011in
1213-runCommand "srcOnly-tests" { } ''
14- # Test that emptySrc is empty
15- if [ -n "$(ls -A ${emptySrc})" ]; then
16- echo "emptySrc is not empty"
17- exit 1
18- fi
0000000000000001920- # Test that glibcSrc is not empty
21- if [ -z "$(ls -A ${glibcSrc})" ]; then
22- echo "glibcSrc is empty"
23- exit 1
24- fi
2526- # Make $out exist to avoid build failure
27- mkdir -p $out
28-''
···1{
2+ lib,
3 runCommand,
4 srcOnly,
5+ hello,
6 emptyDirectory,
7+ zlib,
8+ stdenv,
9+ testers,
10}:
1112let
13 emptySrc = srcOnly emptyDirectory;
14+ zlibSrc = srcOnly zlib;
15+16+ # It can be invoked in a number of ways. Let's make sure they're equivalent.
17+ zlibSrcDrvAttrs = srcOnly zlib.drvAttrs;
18+ # zlibSrcFreeform = # ???;
19+ helloSrc = srcOnly hello;
20+ helloSrcDrvAttrs = srcOnly hello.drvAttrs;
21+22+ # The srcOnly <drv> invocation leaks a lot of attrs into the srcOnly derivation,
23+ # so for comparing with the freeform invocation, we need to make a selection.
24+ # Otherwise, we'll be comparing against whatever attribute the fancy hello drv
25+ # has.
26+ helloDrvSimple = stdenv.mkDerivation {
27+ inherit (hello)
28+ name
29+ pname
30+ version
31+ src
32+ patches
33+ ;
34+ };
35+ helloDrvSimpleSrc = srcOnly helloDrvSimple;
36+ helloDrvSimpleSrcFreeform = srcOnly (
37+ {
38+ inherit (helloDrvSimple)
39+ name
40+ pname
41+ version
42+ src
43+ patches
44+ stdenv
45+ ;
46+ }
47+ # __impureHostDeps get duplicated in helloDrvSimpleSrc (on darwin)
48+ # This is harmless, but fails the test for what is arguably an
49+ # unrelated non-problem, so we just work around it here.
50+ # The inclusion of __impureHostDeps really shouldn't be required,
51+ # and should be removed from this test.
52+ // lib.optionalAttrs (helloDrvSimple ? __impureHostDeps) {
53+ inherit (helloDrvSimple) __impureHostDeps;
54+ }
55+ );
56+57in
5859+runCommand "srcOnly-tests"
60+ {
61+ moreTests = [
62+ (testers.testEqualDerivation "zlibSrcDrvAttrs == zlibSrc" zlibSrcDrvAttrs zlibSrc)
63+ # (testers.testEqualDerivation
64+ # "zlibSrcFreeform == zlibSrc"
65+ # zlibSrcFreeform
66+ # zlibSrc)
67+ (testers.testEqualDerivation "helloSrcDrvAttrs == helloSrc" helloSrcDrvAttrs helloSrc)
68+ (testers.testEqualDerivation "helloDrvSimpleSrcFreeform == helloDrvSimpleSrc"
69+ helloDrvSimpleSrcFreeform
70+ helloDrvSimpleSrc
71+ )
72+ ];
73+ }
74+ ''
75+ # Test that emptySrc is empty
76+ if [ -n "$(ls -A ${emptySrc})" ]; then
77+ echo "emptySrc is not empty"
78+ exit 1
79+ fi
8081+ # Test that zlibSrc is not empty
82+ if [ -z "$(ls -A ${zlibSrc})" ]; then
83+ echo "zlibSrc is empty"
84+ exit 1
85+ fi
8687+ # Make $out exist to avoid build failure
88+ mkdir -p $out
89+ ''
···1-This change bypasses all the code that attempts to see which C++11 features are enabled in your specific C++11 compiler. C++14 is required for gtest 1.13+.
2diff --git a/CMakeLists.txt b/CMakeLists.txt
3index 902233e676ee..49ac8a1010a4 100644
4--- a/CMakeLists.txt
···20- ENDIF()
21+ SET(TINS_HAVE_CXX11 ON)
22+ MESSAGE(STATUS "Using C++11 features")
23-+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
24 ELSE(LIBTINS_ENABLE_CXX11)
25 MESSAGE(
26 WARNING
···1+This change bypasses all the code that attempts to see which C++11 features are enabled in your specific C++11 compiler. C++17 is required for gtest 1.17+.
2diff --git a/CMakeLists.txt b/CMakeLists.txt
3index 902233e676ee..49ac8a1010a4 100644
4--- a/CMakeLists.txt
···20- ENDIF()
21+ SET(TINS_HAVE_CXX11 ON)
22+ MESSAGE(STATUS "Using C++11 features")
23++ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
24 ELSE(LIBTINS_ENABLE_CXX11)
25 MESSAGE(
26 WARNING
+5-3
pkgs/by-name/li/libtins/package.nix
···21 };
2223 patches = [
24- # Required for gtest 1.13+, see also upstream report at:
25- # https://github.com/mfontanini/libtins/issues/529
26- ./0001-force-cpp-14.patch
0027 ];
2829 postPatch = ''
···21 };
2223 patches = [
24+ # Required for gtest 1.17+:
25+ # https://github.com/NixOS/nixpkgs/issues/425358
26+ # See also an upstream report for gtest 1.13+ and C++14:
27+ # https://github.com/mfontanini/libtins/issues/
28+ ./0001-force-cpp-17.patch
29 ];
3031 postPatch = ''