I rebuilt all packages depending on r-haven and tried loading example files using r-haven’s read_* functions. There are no apparent modifications to the vendored source, based on a look at https://github.com/tidyverse/haven/commits/v2.3.1/src/readstat but it’s not quite clear which version they are using. Probably a git snapshot. Lars-Dominik Braun (2): gnu: Add readstat. gnu: r-haven: Unvendor readstat. gnu/packages/cran.scm | 19 +++++++++++++++++-- gnu/packages/statistics.scm | 28 ++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 2 deletions(-) -- 2.26.2
* gnu/packages/statistics.scm (readstat): New variable. --- gnu/packages/statistics.scm | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index 3821c86da9..be30fa712c 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -5904,3 +5904,31 @@ Java package that provides routines for various statistical distributions.") is designed to support editing of scripts and interaction with various statistical analysis programs such as R, Julia, and JAGS.") (license license:gpl3+)))) + +(define-public readstat + (package + (name "readstat") + (version "1.1.5") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/WizardMac/ReadStat.git") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "00sdmaq0qzp6kyv53fpfi6jf3iv4pd0ap0gmw3mbfip52bbnl55w")))) + (build-system gnu-build-system) + (native-inputs + `(("autoconf" ,autoconf) + ("automake" ,automake) + ("gettext" ,gnu-gettext) + ("libtool" ,libtool))) + (inputs + `(("zlib" ,zlib))) ; libz + (synopsis "Convert SAS, Stata, and SPSS files") + (description "Command-line tool and C library for reading files from +popular stats packages like SAS, Stata and SPSS.") + (home-page "https://github.com/WizardMac/ReadStat") + (license license:expat))) + -- 2.26.2
* gnu/packages/cran.scm (r-haven) [snippet]: Remove bundled readstat. [arguments]: Patch Makevars to use system readstat. [inputs]: Replace zlib with readstat. --- gnu/packages/cran.scm | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/gnu/packages/cran.scm b/gnu/packages/cran.scm index 4a88cf1677..d675b7e37a 100644 --- a/gnu/packages/cran.scm +++ b/gnu/packages/cran.scm @@ -2309,10 +2309,25 @@ including functions for geolocation and routing.") (uri (cran-uri "haven" version)) (sha256 (base32 - "03cypgqhdkrfbfpl1yx2wb7flczrbak1w654wkicmd5ajwr9zvkf")))) + "03cypgqhdkrfbfpl1yx2wb7flczrbak1w654wkicmd5ajwr9zvkf")) + (modules '((guix build utils))) + (snippet + '(begin + ;; unvendor readstat + (delete-file-recursively "src/readstat") + #t)))) (build-system r-build-system) + (arguments + '(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'unbundle-readstat + (lambda _ + ;; Not required, since we’re not building readstat. + (substitute* "src/Makevars" + (("-lz") "-lreadstat")) + #t))))) (inputs - `(("zlib" ,zlib))) + `(("readstat" ,readstat))) (native-inputs `(("r-knitr" ,r-knitr))) (propagated-inputs -- 2.26.2
Hi,
Lars-Dominik Braun <lars@6xq.net> skribis:
> I rebuilt all packages depending on r-haven and tried loading example
> files using r-haven’s read_* functions. There are no apparent
> modifications to the vendored source, based on a look at
> https://github.com/tidyverse/haven/commits/v2.3.1/src/readstat
> but it’s not quite clear which version they are using. Probably a git
> snapshot.
>
> Lars-Dominik Braun (2):
> gnu: Add readstat.
> gnu: r-haven: Unvendor readstat.
Applied both, thanks!
Ludo’.
Hi,
Lars-Dominik Braun <lars@6xq.net> skribis:
> I rebuilt all packages depending on r-haven and tried loading example
> files using r-haven’s read_* functions. There are no apparent
> modifications to the vendored source, based on a look at
> https://github.com/tidyverse/haven/commits/v2.3.1/src/readstat
> but it’s not quite clear which version they are using. Probably a git
> snapshot.
>
> Lars-Dominik Braun (2):
> gnu: Add readstat.
> gnu: r-haven: Unvendor readstat.
LGTM! Pushed a couple of days ago as
2075b83b2dbd9896e2e69070e3363f3d43fbe133.
Ludo’.