[PATCH 0/2] r-haven: Unvendor readstat

  • Done
  • quality assurance status badge
Details
2 participants
  • Lars-Dominik Braun
  • Ludovic Courtès
Owner
unassigned
Submitted by
Lars-Dominik Braun
Severity
normal
L
L
Lars-Dominik Braun wrote on 23 Feb 2021 14:04
(address . guix-patches@gnu.org)
YDT9bv1yvXluUI6Z@noor.fritz.box
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
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
L
L
Lars-Dominik Braun wrote on 23 Feb 2021 14:06
[PATCH 1/2] gnu: Add readstat.
(address . 46717@debbugs.gnu.org)
YDT96+HDsf8VU5L4@noor.fritz.box
* gnu/packages/statistics.scm (readstat): New variable.
---
gnu/packages/statistics.scm | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)

Toggle diff (38 lines)
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
L
L
Lars-Dominik Braun wrote on 23 Feb 2021 14:07
[PATCH 2/2] gnu: r-haven: Unvendor readstat.
(address . 46717@debbugs.gnu.org)
YDT+Al0e3i0+lk7R@noor.fritz.box
* 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(-)

Toggle diff (34 lines)
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
L
L
Ludovic Courtès wrote on 2 Mar 2021 20:32
Re: bug#46717: [PATCH 0/2] r-haven: Unvendor readstat
(name . Lars-Dominik Braun)(address . lars@6xq.net)(address . 46717-done@debbugs.gnu.org)
87im69uzbg.fsf@gnu.org
Hi,

Lars-Dominik Braun <lars@6xq.net> skribis:

Toggle quote (11 lines)
> 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’.
Closed
L
L
Ludovic Courtès wrote on 5 Mar 2021 12:57
(name . Lars-Dominik Braun)(address . lars@6xq.net)(address . 46717-done@debbugs.gnu.org)
87a6rhlso8.fsf@gnu.org
Hi,

Lars-Dominik Braun <lars@6xq.net> skribis:

Toggle quote (11 lines)
> 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’.
Closed
?