diff options
Diffstat (limited to 'gnu/packages/check.scm')
-rw-r--r-- | gnu/packages/check.scm | 390 |
1 files changed, 178 insertions, 212 deletions
diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm index b49f9de157..7b08f55e21 100644 --- a/gnu/packages/check.scm +++ b/gnu/packages/check.scm @@ -25,7 +25,7 @@ ;;; Copyright © 2017, 2019 Kei Kebreau <[email protected]> ;;; Copyright © 2017 Nikita <[email protected]> ;;; Copyright © 2015, 2017, 2018, 2020, 2021 Ricardo Wurmus <[email protected]> -;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Marius Bakke <[email protected]> +;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Marius Bakke <[email protected]> ;;; Copyright © 2017, 2018, 2020, 2021 Ludovic Courtès <[email protected]> ;;; Copyright © 2018 Fis Trivial <[email protected]> ;;; Copyright © 2019, 2021 Pierre Langlois <[email protected]> @@ -35,7 +35,7 @@ ;;; Copyright © 2020 Josh Marshall <[email protected]> ;;; Copyright © 2020 Vinicius Monego <[email protected]> ;;; Copyright © 2020 Tanguy Le Carrour <[email protected]> -;;; Copyright © 2020 Maxim Cournoyer <[email protected]> +;;; Copyright © 2020, 2021 Maxim Cournoyer <[email protected]> ;;; Copyright © 2021 Hugo Lecomte <[email protected]> ;;; ;;; This file is part of GNU Guix. @@ -68,6 +68,7 @@ #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) + #:use-module (gnu packages python-check) #:use-module (gnu packages python-build) #:use-module (gnu packages python-web) #:use-module (gnu packages python-xyz) @@ -148,7 +149,27 @@ like Jasmine or Mocha.") version "/check-" version ".tar.gz")) (sha256 (base32 - "02m25y9m46pb6n46s51av62kpd936lkfv3b13kfpckgvmh5lxpm8")))) + "02m25y9m46pb6n46s51av62kpd936lkfv3b13kfpckgvmh5lxpm8")) + (patches + (list + ;; This patch fixes some tests that would otherwise fail on + ;; powerpc64le-linux. Without this patch, the tests make certain + ;; assumptions about floating point number precision that are not true + ;; on that platform. + ;; + ;; TODO: Remove this patch when updating to the next check release, + ;; since it will be included there. See: + ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=47698 + (origin + (method url-fetch) + (uri + (string-append "https://github.com/libcheck/check/commit/" + "4fbe702fa4f35bee8a90512f9f59d1441c4ae82e.patch")) + (file-name (string-append name + "-fix-test-precision-for-ppc.patch")) + (sha256 + (base32 + "04qg1p9afdd6453k18qskazrvscysdcjz9j6w4i6p5x4xyma19v6"))))))) (build-system gnu-build-system) (home-page "https://libcheck.github.io/check/") (synopsis "Unit test framework for C") @@ -742,7 +763,7 @@ similar to unit tests.") (define-public cpputest (package (name "cpputest") - (version "3.8") + (version "4.0") (source (origin (method url-fetch) @@ -750,7 +771,7 @@ similar to unit tests.") version "/cpputest-" version ".tar.gz")) (sha256 (base32 - "0mk48xd3klyqi7wf3f4wn4zqxxzmvrhhl32r25jzrixzl72wq7f8")))) + "1xslavlb1974y5xvs8n1j9zkk05dlw8imy4saasrjlmibl895ii1")))) (build-system gnu-build-system) (native-inputs `(("googletest" ,googletest))) @@ -948,39 +969,40 @@ standard library.") (define-public python-pytest (package (name "python-pytest") - (version "5.3.5") + (version "6.2.1") (source (origin (method url-fetch) (uri (pypi-uri "pytest" version)) (sha256 (base32 - "139i9cjhrv5aici3skq8iihvfb3lq0d8xb5j7qycr2hlk8cfjpqd")))) + "01n3jny7m05r6g7gphbkj2xdms75ql93x69crd377hlvi6qikr36")))) (build-system python-build-system) (arguments `(#:phases (modify-phases %standard-phases (replace 'check (lambda* (#:key (tests? #t) #:allow-other-keys) + (setenv "TERM" "dumb") ;attempt disabling markup tests (if tests? (invoke "pytest" "-vv" "-k" (string-append - ;; These tests involve the /usr directory, and fails. - "not test_remove_dir_prefix" - " and not test_argcomplete" - ;; This test tries to override PYTHONPATH, and - ;; subsequently fails to locate the test libraries. - " and not test_collection")) - (format #t "test suite not run~%")) - #t))))) + ;; This test involve the /usr directory, and fails. + " not test_argcomplete" + ;; These test do not honor the isatty detection and + ;; fail. + " and not test_code_highlight" + " and not test_color_yes")) + (format #t "test suite not run~%"))))))) (propagated-inputs - `(("python-atomicwrites" ,python-atomicwrites) - ("python-attrs" ,python-attrs-bootstrap) + `(("python-attrs" ,python-attrs-bootstrap) + ("python-iniconfig" ,python-iniconfig) ("python-more-itertools" ,python-more-itertools) ("python-packaging" ,python-packaging-bootstrap) ("python-pluggy" ,python-pluggy) ("python-py" ,python-py) ("python-six" ,python-six-bootstrap) + ("python-toml" ,python-toml) ("python-wcwidth" ,python-wcwidth))) (native-inputs `(;; Tests need the "regular" bash since 'bash-final' lacks `compgen`. @@ -990,6 +1012,7 @@ standard library.") ("python-mock" ,python-mock) ("python-pytest" ,python-pytest-bootstrap) ("python-setuptools-scm" ,python-setuptools-scm) + ("python-toml" ,python-toml) ("python-xmlschema" ,python-xmlschema))) (home-page "https://docs.pytest.org/en/latest/") (synopsis "Python testing library") @@ -1000,44 +1023,7 @@ and many external plugins.") (license license:expat) (properties `((python2-variant . ,(delay python2-pytest)))))) -(define-public python-pytest-6 - (package - (inherit (strip-python2-variant python-pytest)) - (version "6.2.4") - (source - (origin - (method url-fetch) - (uri (pypi-uri "pytest" version)) - (sha256 - (base32 - "0jy5f83la1864ss42dhsi1mcm5nl79d8bjg7wk474nlw1c5avg2h")))) - (arguments - `(#:phases - (modify-phases %standard-phases - (replace 'check - (lambda* (#:key (tests? #t) #:allow-other-keys) - (setenv "TERM" "dumb") ;attempt disabling markup tests - (if tests? - (invoke "pytest" "-vv" "-k" - (string-append - ;; This test involves the /usr directory, and fails. - " not test_argcomplete" - ;; These test do not honor the isatty detection and - ;; fail. - " and not test_code_highlight" - " and not test_color_yes")) - (format #t "test suite not run~%"))))))) - (propagated-inputs - (append (alist-delete "python-py" - (package-propagated-inputs python-pytest)) - `(("python-iniconfig" ,python-iniconfig) - ("python-py" ,python-py-next)))) - (native-inputs - (append (fold alist-delete (package-native-inputs python-pytest) - '("python-mock" - "python-pytest")) - `(("python-pytest" ,python-pytest-6-bootstrap) - ("python-toml" ,python-toml)))))) +(define-public python-pytest-6 python-pytest) ;; Pytest 4.x are the last versions that support Python 2. (define-public python2-pytest @@ -1079,19 +1065,12 @@ and many external plugins.") (package (inherit (strip-python2-variant python-pytest)) (name "python-pytest-bootstrap") - (native-inputs `(("python-setuptools-scm" ,python-setuptools-scm))) + (native-inputs `(("python-iniconfig" ,python-iniconfig) + ("python-setuptools-scm" ,python-setuptools-scm) + ("python-toml" ,python-toml))) (arguments `(#:tests? #f)) (properties `((python2-variant . ,(delay python2-pytest-bootstrap)))))) -(define-public python-pytest-6-bootstrap - (package - (inherit (strip-python2-variant python-pytest-6)) - (name "python-pytest-bootstrap") - (arguments `(#:tests? #f)) - (native-inputs - `(("python-setuptools-scm" ,python-setuptools-scm) - ("python-toml" ,python-toml))))) - (define-public python2-pytest-bootstrap (hidden-package (package/inherit @@ -1310,20 +1289,32 @@ same arguments.") (define-public python-pytest-xdist (package (name "python-pytest-xdist") - ;; There is an issue that causes all releases after 1.34 to fail on Pytest - ;; 5 (see: https://github.com/pytest-dev/pytest-xdist/issues/697). - (version "1.34.0") + (version "2.1.0") (source (origin (method url-fetch) (uri (pypi-uri "pytest-xdist" version)) (sha256 (base32 - "1vh4ps32lp5ignch5adbl3pgchvigdfmrl6qpmhxih54wa1qw3il")))) + "0wh6pn66nncfs6ay0n863bgyriwsgppn8flx5l7551j1lbqkinc2")) + (modules '((guix build utils))) + (snippet + '(begin + ;; Remove pre-compiled .pyc files from source. + (for-each delete-file-recursively + (find-files "." "__pycache__" #:directories? #t)) + (for-each delete-file (find-files "." "\\.pyc$")) + #t)))) (build-system python-build-system) (arguments - `(#:phases + '(#:tests? #f ; Lots of tests fail. + #:phases (modify-phases %standard-phases + (add-after 'unpack 'patch-setup-py + (lambda _ + ;; Relax pytest requirement. + (substitute* "setup.py" + (("pytest>=6\\.0\\.0") "pytest")))) (replace 'check (lambda* (#:key inputs outputs tests? #:allow-other-keys) (when tests? @@ -1335,6 +1326,7 @@ same arguments.") (propagated-inputs `(("python-execnet" ,python-execnet) ("python-pytest" ,python-pytest) + ("python-py" ,python-py) ("python-pytest-forked" ,python-pytest-forked))) (home-page "https://github.com/pytest-dev/pytest-xdist") @@ -1468,25 +1460,20 @@ subprocess and see the output as well as any file modifications.") (define-public python-testtools-bootstrap (package (name "python-testtools-bootstrap") - (version "2.3.0") + (version "2.5.0") (source (origin (method url-fetch) (uri (pypi-uri "testtools" version)) (sha256 (base32 - "0n8519lk8aaa91vymz842831181wf7fss98hyllhygi3z1nfq9sq")) - (patches (search-patches "python-testtools.patch")))) + "0gxjbjk93jjqi491k4s9rh3ia37v21yifd35pvizv7sgv4rk9hap")))) (build-system python-build-system) (arguments '(#:tests? #f)) (propagated-inputs `(("python-extras" ,python-extras) ("python-fixtures" ,python-fixtures-bootstrap) - ("python-mimeparse" ,python-mimeparse) - ("python-pbr" ,python-pbr-minimal) - ("python-six" ,python-six) - ("python-traceback2" ,python-traceback2) - ("python-unittest2" ,python-unittest2))) + ("python-pbr" ,python-pbr-minimal))) (home-page "https://github.com/testing-cabal/testtools") (synopsis "Extensions to the Python standard library unit testing framework") @@ -1499,19 +1486,17 @@ subprocess and see the output as well as any file modifications.") (inherit python-testtools-bootstrap) (name "python-testtools") (arguments - `(#:phases (modify-phases %standard-phases - (replace 'check - (lambda _ - (invoke "python" "-m" "testtools.run" - "testtools.tests.test_suite")))))) + `(#:phases + (modify-phases %standard-phases + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "python" "-m" "testtools.run" + "testtools.tests.test_suite"))))))) (propagated-inputs `(("python-extras" ,python-extras) ("python-fixtures" ,python-fixtures) - ("python-mimeparse" ,python-mimeparse) - ("python-pbr" ,python-pbr) - ("python-six" ,python-six) - ("python-traceback2" ,python-traceback2) - ("python-unittest2" ,python-unittest2))) + ("python-pbr" ,python-pbr))) (native-inputs `(("python-testscenarios" ,python-testscenarios-bootstrap))) (description @@ -1642,14 +1627,21 @@ protocol."))) (package (name "python-fixtures-bootstrap") (version "3.0.0") - (source (origin - (method url-fetch) - (uri (pypi-uri "fixtures" version)) - (sha256 - (base32 - "1vxj29bzz3rd4pcy51d05wng9q9dh4jq6wx92yklsm7i6h1ddw7w")))) + (source + (origin + (method url-fetch) + (uri (pypi-uri "fixtures" version)) + (sha256 + (base32 + "1vxj29bzz3rd4pcy51d05wng9q9dh4jq6wx92yklsm7i6h1ddw7w")) + (patches (search-patches "python-fixtures-remove-monkeypatch-test.patch")))) (build-system python-build-system) - (arguments `(#:tests? #f)) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + ;; Package is not loadable on its own at this stage. + (delete 'sanity-check)))) (propagated-inputs `(("python-pbr-minimal" ,python-pbr-minimal) ("python-six" ,python-six))) @@ -1668,9 +1660,10 @@ python-fixtures package instead.") '(#:phases (modify-phases %standard-phases (replace 'check - (lambda _ - (invoke "python" "-m" "testtools.run" - "fixtures.test_suite")))))) + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "python" "-m" "testtools.run" + "fixtures.test_suite"))))))) (propagated-inputs ;; Fixtures uses pbr at runtime to check versions, etc. `(("python-pbr" ,python-pbr) @@ -1754,9 +1747,7 @@ executed.") (define-public python-pytest-asyncio (package (name "python-pytest-asyncio") - ;; Version 0.10.0 is the last version which is compatible with Pytest <= - ;; 5.4.0. - (version "0.10.0") + (version "0.15.1") (source (origin (method git-fetch) ;for tests @@ -1765,18 +1756,8 @@ executed.") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 - (base32 - "1m63b7nbph5z20mn8jgh6j9ac873i1k4in29x44vrkw3qwfwg13y")) - (patches (search-patches "python-pytest-asyncio-python-3.8.patch")))) + (base32 "03drs4myv1ik79148xyhli37q6mp931jb14cz65n8qvls2zvvwgx")))) (build-system python-build-system) - (arguments - `(#:phases - (modify-phases %standard-phases - (replace 'check - (lambda* (#:key inputs outputs tests? #:allow-other-keys) - (when tests? - (add-installed-pythonpath inputs outputs) - (invoke "pytest" "-vv"))))))) (native-inputs `(("python-coverage" ,python-coverage) ("python-async-generator" ,python-async-generator) @@ -1979,12 +1960,11 @@ framework which enables you to test server connections locally.") `(("python-setuptools-scm" ,python-setuptools-scm))) (propagated-inputs `(("python-pytest" ,python-pytest) - ("python-pytest-cache" ,python-pytest-cache) ("python-psutil" ,python-psutil))) (synopsis "Pytest plugin to manage external processes across test runs") (description "Pytest-xprocess is an experimental py.test plugin for managing processes across test runs.") - (home-page "https://github.com/pytest-dev/pytest-xprocess") + (home-page "https://github.com/pytest-dev/pytest-xprocess/") (license license:expat))) (define-public python-pytest-subtesthack @@ -2038,13 +2018,13 @@ instantly.") (define-public python-hypothesis (package (name "python-hypothesis") - (version "5.4.1") + (version "6.0.2") (source (origin (method url-fetch) (uri (pypi-uri "hypothesis" version)) (sha256 (base32 - "0zn09bn6hadk4vxl6jy8bkjr5fz8mrhin3z46w7pq5qgbaycr89p")))) + "0wj7ip779naf2n076nylf2gi0sjz68z1ir9d9r2rgs7br18naqdf")))) (build-system python-build-system) (arguments ;; XXX: Tests are not distributed with the PyPI archive. @@ -2061,18 +2041,6 @@ seamlessly into your existing Python unit testing work flow.") (license license:mpl2.0) (properties `((python2-variant . ,(delay python2-hypothesis)))))) -(define-public python-hypothesis-5.23 - (package - (inherit python-hypothesis) - (version "5.23.0") - (source (origin - (method url-fetch) - (uri (pypi-uri "hypothesis" version)) - (sha256 - (base32 - "0sy1v6nyxg4rjcf3rlr8nalb7wqd9nccpb2lzkchbj5an13ysf1h")))) - (home-page "https://github.com/HypothesisWorks/hypothesis"))) - ;; This is the last version of Hypothesis that supports Python 2. (define-public python2-hypothesis (let ((hypothesis (package-with-python2 @@ -2092,19 +2060,19 @@ seamlessly into your existing Python unit testing work flow.") (define-public python-hypothesmith (package (name "python-hypothesmith") - (version "0.1.2") + (version "0.1.8") (source (origin (method url-fetch) (uri (pypi-uri "hypothesmith" version)) (sha256 (base32 - "09331sspknv459xcyn1k0lx5flqlc6gmnwp9370pfvg4kg1zmss6")))) + "02j101m5grjrbvrgjap17jsxd1hgawkylmyswcn33vf42mxh9zzr")))) (build-system python-build-system) (propagated-inputs - `(("python-hypothesis" ,python-hypothesis-5.23) + `(("python-hypothesis" ,python-hypothesis) ("python-lark-parser" ,python-lark-parser) - ("python-libcst" ,python-libcst))) + ("python-libcst" ,python-libcst-minimal))) (home-page "https://github.com/Zac-HD/hypothesmith") (synopsis "Strategies for generating Python programs") (description @@ -2154,7 +2122,18 @@ failures.") "06032agzhw1i9d9qlhfblnl3dw5hcyxhagn7b120zhrszbjzfbh3")))) (build-system python-build-system) (arguments - `(#:tests? #f)) ; Fails with recent pytest and pep8. See upstream issues #8 and #12. + `(#:tests? #f ; Fails with recent pytest and pep8. See upstream issues #8 and #12. + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'fix-dependencies + (lambda _ + (substitute* "setup.py" + (("'pytest-cache', ") "")))) ; Included in recent pytest + (replace 'check + (lambda* (#:key tests? inputs outputs #:allow-other-keys) + (when tests? + (add-installed-pythonpath inputs outputs) + (invoke "pytest" "-v"))))))) (native-inputs `(("python-pytest" ,python-pytest))) (propagated-inputs @@ -2239,29 +2218,25 @@ statements in the module it tests.") (define-public python-pylint (package (name "python-pylint") - (version "2.5.3") + (version "2.9.6") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/PyCQA/pylint") - (commit (string-append "pylint-" version)))) + (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "04cgbh2z1mygar63plzziyz34yg6bdr4i0g63jp256fgnqwb1bi3")))) + (base32 "15yw69v1cj6zkndk60c2g0dgl0khh8bfm1lrwhjffpdjfc7nkc9a")))) (build-system python-build-system) - ;; FIXME: Tests are failing since version 2.4.3, see: - ;; https://github.com/PyCQA/pylint/issues/3198. - (arguments '(#:tests? #f)) (native-inputs `(("python-pytest" ,python-pytest) - ("python-pytest-runner" ,python-pytest-runner) - ("python-tox" ,python-tox))) + ("python-pytest-benchmark" ,python-pytest-benchmark) + ("python-pytest-runner" ,python-pytest-runner))) (propagated-inputs `(("python-astroid" ,python-astroid) ("python-isort" ,python-isort) ("python-mccabe" ,python-mccabe) - ("python-six" ,python-six) ("python-toml" ,python-toml))) (home-page "https://github.com/PyCQA/pylint") (synopsis "Python source code analyzer which looks for coding standard @@ -2450,20 +2425,10 @@ backported from Python 2.7 for Python 2.4+.") ("python-pyhamcrest" ,python-pyhamcrest) ("python-pytest" ,python-pytest))) (propagated-inputs - `(("python-importlib-metadata" ,python-importlib-metadata) - ("python-six" ,python-six) - ("python-parse" ,python-parse) + `(("python-parse" ,python-parse) ("python-parse-type" ,python-parse-type))) (arguments - '(#:test-target "behave_test" - #:phases - (modify-phases %standard-phases - (add-before 'check 'fix-library-loading - (lambda _ - ;; Otherwise, tests fail with no module named 'path' - (setenv "PYTHONPATH" (string-append (getenv "PYTHONPATH") ":" - (getcwd) "/tasks/_vendor")) - #t))))) + '(#:test-target "behave_test")) (home-page "https://github.com/behave/behave") (synopsis "Python behavior-driven development") (description @@ -2702,48 +2667,35 @@ retried.") (package-with-python2 python-flaky)) (define-public python-pyhamcrest - ;; The latest release was in 2016 and its test suite does not work with recent - ;; versions of Pytest. Just take the master branch for now, which seems stable. - (let ((commit "25fdc5f00bdf3084335353bc9247253098ec4cf2") - (revision "0")) - (package - (name "python-pyhamcrest") - (version (git-version "1.9.0" revision commit)) - (source (origin - ;; Tests not distributed from pypi release. - (method git-fetch) - (uri (git-reference - (url "https://github.com/hamcrest/PyHamcrest") - (commit commit))) - (file-name (git-file-name name version)) - (sha256 - (base32 - "1miqmhhi68vaix8sqc1lvpvbm27bacffxh5anm5cbfsvk7g9n6f3")))) - (native-inputs ;all native inputs are for tests - `(("python-pytest-cov" ,python-pytest-cov) - ("python-mock" ,python-mock) - ("python-pytest" ,python-pytest) - ("python-hypothesis" ,python-hypothesis))) - (propagated-inputs - `(("python-six" ,python-six))) - (build-system python-build-system) - (arguments - `(#:phases (modify-phases %standard-phases - (replace 'check - (lambda _ - (setenv "PYTHONPATH" - (string-append "build/lib:" - (getenv "PYTHONPATH"))) - (invoke "pytest" "-vv")))))) - (home-page "http://hamcrest.org/") - (synopsis "Hamcrest matchers for Python") - (description - "PyHamcrest is a framework for writing matcher objects, - allowing you to declaratively define \"match\" rules.") - (license license:bsd-3)))) - -(define-public python2-pyhamcrest - (package-with-python2 python-pyhamcrest)) + (package + (name "python-pyhamcrest") + (version "2.0.2") + (source (origin + ;; Tests not distributed from pypi release. + (method git-fetch) + (uri (git-reference + (url "https://github.com/hamcrest/PyHamcrest") + (commit (string-append "V" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "05kdzlhs2kvj82pfca13qszszcj6dyrk4b9pbr46x06sq2s4qyls")))) + (native-inputs ;all native inputs are for tests + `(("python-pytest-cov" ,python-pytest-cov) + ("python-mock" ,python-mock) + ("python-pytest" ,python-pytest) + ("python-hypothesis" ,python-hypothesis))) + (build-system python-build-system) + (arguments + `(#:phases (modify-phases %standard-phases + (replace 'check + (lambda _ + (invoke "pytest" "-vv")))))) + (home-page "http://hamcrest.org/") + (synopsis "Hamcrest matchers for Python") + (description "PyHamcrest is a framework for writing matcher objects, +allowing you to declaratively define \"match\" rules.") + (license license:bsd-3))) (define-public unittest-cpp (package @@ -2773,7 +2725,7 @@ portable to just about any platform.") (define-public libfaketime (package (name "libfaketime") - (version "0.9.8") + (version "0.9.9") (home-page "https://github.com/wolfcw/libfaketime") (source (origin (method git-fetch) @@ -2782,35 +2734,41 @@ portable to just about any platform.") (commit (string-append "v" version)))) (sha256 (base32 - "1mfdl82ppgbdvy1ny8mb7xii7p0g7awvn4bn36jb8v4r545slmjc")) + "1gi1xciqga5hl2xlk7rc3j8wy47ag97pi7ngmdl6ny1d11b2wn1z")) (file-name (git-file-name name version)))) (build-system gnu-build-system) (arguments - '(#:phases (modify-phases %standard-phases + `(#:phases (modify-phases %standard-phases + (add-after 'unpack 'embed-date-reference + (lambda* (#:key inputs #:allow-other-keys) + (let ((coreutils (assoc-ref inputs "coreutils"))) + (substitute* "src/faketime.c" + (("\"date\"") + (string-append "\"" coreutils "/bin/date\"")))))) (replace 'configure (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) - (setenv "CC" "gcc") + (setenv "CC" ,(cc-for-target)) (setenv "PREFIX" out) ;; XXX: Without this flag, the CLOCK_REALTIME test hangs ;; indefinitely. See README.packagers for more information. - ;; Try removing this for future versions of libfaketime. - (setenv "FAKETIME_COMPILE_CFLAGS" "-DFORCE_MONOTONIC_FIX") - - #t))) + ;; There are specific instructions to not enable more flags + ;; than absolutely needed. + ,(if (target-ppc64le?) + `(setenv "FAKETIME_COMPILE_CFLAGS" + "-DFORCE_MONOTONIC_FIX -DFORCE_PTHREAD_NONVER") + `(setenv "FAKETIME_COMPILE_CFLAGS" + "-DFORCE_MONOTONIC_FIX"))))) (add-before 'check 'pre-check (lambda _ (substitute* "test/functests/test_exclude_mono.sh" - (("/bin/bash") (which "bash"))) - - ;; Do not fail due to use of 'ftime', which was deprecated in - ;; glibc 2.31. Remove this for later versions of libfaketime. - (setenv "FAKETIME_COMPILE_CFLAGS" "-Wno-deprecated-declarations") - #t))) + (("/bin/bash") (which "bash")))))) #:test-target "test")) (native-inputs `(("perl" ,perl))) ;for tests + (inputs + `(("coreutils" ,coreutils))) (synopsis "Fake the system time for single applications") (description "The libfaketime library allows users to modify the system time that an @@ -2913,13 +2871,21 @@ grew out of the @dfn{Vc} project.") (arguments `(#:phases (modify-phases %standard-phases + (add-after 'unpack 'patch-testsuite + (lambda _ + ;; Time difference is larger than expected. + (substitute* "pyfakefs/tests/fake_filesystem_unittest_test.py" + (("(\\s+)def test_copy_real_file" all indent) + (string-append + indent + "@unittest.skip('disabled by guix')\n" + all))))) ;; The default test suite does not run these extra tests. (add-after 'check 'check-pytest-plugin (lambda _ (invoke "python" "-m" "pytest" - "pyfakefs/pytest_tests/pytest_plugin_test.py") - #t))))) + "pyfakefs/pytest_tests/pytest_plugin_test.py")))))) (native-inputs `(("python-pytest" ,python-pytest))) (build-system python-build-system) |