;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2020 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see . (define-module (test-git-authenticate) #:use-module (git) #:use-module (guix git) #:use-module (guix git-authenticate) #:use-module (guix openpgp) #:use-module (guix tests git) #:use-module (guix tests gnupg) #:use-module (guix build utils) #:use-module (srfi srfi-1) #:use-module (srfi srfi-34) #:use-module (srfi srfi-64) #:use-module (rnrs bytevectors) #:use-module (rnrs io ports)) ;; Test the (guix git-authenticate) tools. (define (gpg+git-available?) (and (which (git-command)) (which (gpg-command)) (which (gpgconf-command)))) (test-begin "git-authenticate") (unless (which (git-command)) (test-skip 1)) (test-assert "unsigned commits" (with-temporary-git-repository directory '((add "a.txt" "A") (commit "first commit") (add "b.txt" "B") (commit "second commit")) (with-repository directory repository (let ((commit1 (find-commit repository "first")) (commit2 (find-commit repository "second"))) (guard (c ((unsigned-commit-error? c) (oid=? (git-authentication-error-commit c) (commit-id commit1)))) ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015-2024 Ricardo Wurmus <rekado@elephly.net> ;;; Copyright © 2015 Vicente Vera Parra <vicentemvp@gmail.com> ;;; Copyright © 2016 Andreas Enge <andreas@enge.fr> ;;; Copyright © 2016, 2017, 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il> ;;; Copyright © 2016 Pjotr Prins <pjotr.guix@thebird.nl> ;;; Copyright © 2016 Roel Janssen <roel@gnu.org> ;;; Copyright © 2016 Ben Woodcroft <donttrustben@gmail.com> ;;; Copyright © 2016, 2017 Raoul Bonnal <ilpuccio.febo@gmail.com> ;;; Copyright © 2017 Kyle Meyer <kyle@kyleam.com> ;;; Copyright © 2017–2020, 2022 Tobias Geerinckx-Rice <me@tobias.gr> ;;; Copyright © 2017 Alex Kost <alezost@gmail.com> ;;; Copyright © 2018 Alex Branham <alex.branham@gmail.com> ;;; Copyright © 2020 Tim Howes <timhowes@lavabit.com> ;;; Copyright © 2021, 2022, 2024 Maxim Cournoyer <maxim.cournoyer@gmail.com> ;;; Copyright © 2021 Bonface Munyoki Kilyungi <me@bonfacemunyoki.com> ;;; Copyright © 2021 Lars-Dominik Braun <lars@6xq.net> ;;; Copyright © 2021 Frank Pursel <frank.pursel@gmail.com> ;;; Copyright © 2022 Simon Tournier <zimon.toutoune@gmail.com> ;;; Copyright © 2023 gemmaro <gemmaro.dev@gmail.com> ;;; Copyright © 2023 Felix Gruber <felgru@posteo.net> ;;; Copyright © 2023 Troy Figiel <troy@troyfigiel.com> ;;; Copyright © 2024 Vinicius Monego <monego@posteo.net> ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. (define-module (gnu packages statistics) #:use-module (guix gexp) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix hg-download) #:use-module (guix git-download) #:use-module (guix utils) #:use-module (guix build-system ant) #:use-module (guix build-system cmake) #:use-module (guix build-system emacs) #:use-module (guix build-system gnu) #:use-module (guix build-system r) #:use-module (guix build-system pyproject) #:use-module (guix build-system python) #:use-module (guix build-system trivial) #:use-module (guix build-system ruby) #:use-module (gnu packages) #:use-module (gnu packages algebra) #:use-module (gnu packages autotools) #:use-module (gnu packages bash) #:use-module (gnu packages bison) #:use-module (gnu packages boost) #:use-module (gnu packages check) #:use-module (gnu packages compression) #:use-module (gnu packages cran) #:use-module (gnu packages curl) #:use-module (gnu packages emacs) #:use-module (gnu packages emacs-xyz) #:use-module (gnu packages flex) #:use-module (gnu packages fontutils) #:use-module (gnu packages gcc) #:use-module (gnu packages gtk) #:use-module (gnu packages gettext) #:use-module (gnu packages glib) #:use-module (gnu packages haskell-xyz) #:use-module (gnu packages icu4c) #:use-module (gnu packages image) #:use-module (gnu packages java) #:use-module (gnu packages javascript) #:use-module (gnu packages libffi) #:use-module (gnu packages linux) #:use-module (gnu packages machine-learning) #:use-module (gnu packages maths) #:use-module (gnu packages multiprecision) #:use-module (gnu packages ncurses) #:use-module (gnu packages ocaml) #:use-module (gnu packages pcre) #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) #:use-module (gnu packages python-build) #:use-module (gnu packages python-science) #:use-module (gnu packages python-xyz) #:use-module (gnu packages readline) #:use-module (gnu packages ruby) #:use-module (gnu packages shells) #:use-module (gnu packages sphinx) #:use-module (gnu packages ssh) #:use-module (gnu packages swig) #:use-module (gnu packages tbb) #:use-module (gnu packages tcl) #:use-module (gnu packages tex) #:use-module (gnu packages texinfo) #:use-module (gnu packages time) #:use-module (gnu packages tls) #:use-module (gnu packages base) #:use-module (gnu packages uglifyjs) #:use-module (gnu packages version-control) #:use-module (gnu packages web) #:use-module (gnu packages xml) #:use-module (gnu packages xorg) #:use-module (srfi srfi-1) #:use-module (ice-9 match)) (define-public pspp (package (name "pspp") (version "2.0.1") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/pspp/pspp-" version ".tar.gz")) (sha256 (base32 "002c08rxym056mn7a73jwjmcazqd4gh5j1cyml603y4ckvqb1nwf")))) (build-system gnu-build-system) (arguments (list #:phases #~(modify-phases %standard-phases (add-after 'unpack 'patch-test-suite (lambda _ (substitute* "tests/output/tex.at" (("AT_CHECK\\(\\[LC_ALL=C.UTF-8 pspp") "AT_CHECK([LC_ALL=en_US.UTF-8 pspp")))) (add-before 'check 'prepare-tests ;; Prevent irrelevant errors that cause test output mismatches: ;; ‘Fontconfig error: No writable cache directories’ (lambda _ (setenv "XDG_CACHE_HOME" (getcwd))))))) (inputs (list cairo gettext-minimal gsl libxml2 pango readline gtk+ gtksourceview-3 spread-sheet-widget zlib)) (native-inputs (list autoconf ;for tests `(,glib "bin") ;for glib-genmarshal perl pkg-config python-3 ;for tests texinfo)) (home-page "https://www.gnu.org/software/pspp/") (synopsis "Statistical analysis") (description "GNU PSPP is a statistical analysis program. It can perform descriptive statistics, T-tests, linear regression and non-parametric tests. It features both a graphical interface as well as command-line input. PSPP is designed to interoperate with Gnumeric, LibreOffice and OpenOffice. Data can be imported from spreadsheets, text files and database sources and it can be output in text, PostScript, PDF or HTML.") (license license:gpl3+))) (define-public jags (package (name "jags") (version "4.3.1") (source (origin (method url-fetch) (uri (string-append "mirror://sourceforge/mcmc-jags/JAGS/" (version-major version) ".x/Source/" "JAGS-" version ".tar.gz")) (sha256 (base32 "0aa2w4g5057vn1qjp954s2kwxfmy1h7p5yn56fyi7sz9nmaq69gr")))) (build-system gnu-build-system) (arguments (list #:configure-flags #~(list "--with-lapack=-lopenblas" "--with-blas=-lopenblas"))) (home-page "https://mcmc-jags.sourceforge.net/") (native-inputs (list gfortran openblas)) (synopsis "Gibbs sampler") (description "JAGS is Just Another Gibbs Sampler. It is a program for analysis of Bayesian hierarchical models using Markov Chain Monte Carlo (MCMC) simulation not wholly unlike BUGS. JAGS was written with three aims in mind: @enumerate @item To have a cross-platform engine for the BUGS language; @item To be extensible, allowing users to write their own functions, distributions and samplers; @item To be a platform for experimentation with ideas in Bayesian modelling. @end enumerate\n") (license license:gpl2))) (define-public libxls (package (name "libxls") (version "1.6.2") (source (origin (method url-fetch) (uri (string-append "https://github.com/libxls/libxls/releases/download/" "v" version "/libxls-" version ".tar.gz")) (sha256 (base32 "0wg3ymr43aa1j3scyl9x83b2xgg7wilzpil0dj91a8dzji6w7b2x")))) (build-system gnu-build-system) (home-page "https://github.com/libxls/libxls") (synopsis "Read binary (.xls) Excel spreadsheet files") (description "libxls is a C library to read .xls spreadsheet files in the binary OLE BIFF8 format as created by Excel 97 and later versions. It cannot write them. This package also provides @command{xls2csv} to export Excel files to CSV.") (license license:bsd-2))) ;; Update this package together with the set of recommended packages: r-boot, ;; r-class, r-cluster, r-codetools, r-foreign, r-kernsmooth, r-lattice, ;; r-mass, r-matrix, r-mgcv, r-nlme, r-nnet, r-rpart, r-spatial, r-survival. (define r-with-tests (package (name "r-with-tests") (version "4.4.1") (source (origin (method url-fetch) (uri (string-append "mirror://cran/src/base/R-" (version-major version) "/R-" version ".tar.gz")) (sha256 (base32 "0kfrn8v8l555n5xrpf753jar5wa3vs622p967ffjkdxfx9fngjxl")))) (build-system gnu-build-system) (arguments (list #:disallowed-references `(,tzdata-for-tests) #:make-flags #~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib/R/lib") ;; This affects the embedded timestamp of only the core packages. "PKG_BUILT_STAMP=1970-01-01") #:phases #~(modify-phases %standard-phases (add-before 'configure 'do-not-compress-serialized-files (lambda _ ;; This ensures that Guix can detect embedded store references; ;; see bug #28157 for details. (substitute* "src/library/base/makebasedb.R" (("compress = TRUE") "compress = FALSE")) (substitute* '("src/library/tools/Makefile.in" "share/make/basepkg.mk" "share/make/lazycomp.mk") (("makeLazyLoading\\(") "makeLazyLoading(compress=FALSE,")))) (add-before 'configure 'patch-coreutils-paths (lambda* (#:key inputs #:allow-other-keys) (let ((uname-bin (search-input-file inputs "/bin/uname")) (rm-bin (search-input-file inputs "/bin/rm"))) (substitute* "src/scripts/R.sh.in" (("uname") uname-bin)) (substitute* "src/unix/sys-std.c" (("rm -Rf ") (string-append rm-bin " -Rf "))) (substitute* "src/library/parallel/R/detectCores.R" (("'grep") (string-append "'" (search-input-file inputs "/bin/grep"))) (("\\| wc -l") (string-append "| " (search-input-file inputs "/bin/wc") " -l")))))) (add-after 'unpack 'patch-tests (lambda _ ;; This is needed because R is run during the check phase and ;; /bin/sh doesn't exist in the build container. (substitute* "src/unix/sys-unix.c" (("\"/bin/sh\"") (string-append "\"" (which "sh") "\""))) ;; This test fails because line numbers are off by two. (substitute* "tests/reg-packages.R" (("8 <= print" m) (string-append "## " m))))) (add-after 'unpack 'build-reproducibly (lambda _ ;; The documentation contains time stamps to demonstrate ;; documentation generation in different phases. (substitute* "src/library/tools/man/Rd2HTML.Rd" (("\\\\%Y-\\\\%m-\\\\%d at \\\\%H:\\\\%M:\\\\%S") "(removed for reproducibility)")) ;; Remove timestamp from tracing environment. This fixes ;; reproducibility of "methods.rd{b,x}". (substitute* "src/library/methods/R/trace.R" (("dateCreated = Sys.time\\(\\)") "dateCreated = as.POSIXct(\"1970-1-1 00:00:00\", tz = \"UTC\")")) ;; Ensure that