GNU bug report logs -
#34548
[PATCH 06/24] gnu: Add r-leaflet.
Previous Next
Reported by: Brett Gilio <brettg <at> posteo.net>
Date: Tue, 19 Feb 2019 03:59:07 UTC
Severity: normal
Tags: patch
Done: Ricardo Wurmus <rekado <at> elephly.net>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 34548 in the body.
You can then email your comments to 34548 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
guix-patches <at> gnu.org
:
bug#34548
; Package
guix-patches
.
(Tue, 19 Feb 2019 03:59:07 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Brett Gilio <brettg <at> posteo.net>
:
New bug report received and forwarded. Copy sent to
guix-patches <at> gnu.org
.
(Tue, 19 Feb 2019 03:59:08 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[0006-gnu-Add-r-leaflet.patch (text/x-patch, inline)]
From 26fbdbeee9ec293511648dc321abb09b6989fadc Mon Sep 17 00:00:00 2001
From: Brett Gilio <brettg <at> posteo.net>
Date: Mon, 18 Feb 2019 19:37:02 -0600
Subject: [PATCH 06/24] gnu: Add r-leaflet.
* gnu/packages/cran.scm (r-leaflet): New variable.
---
gnu/packages/cran.scm | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/gnu/packages/cran.scm b/gnu/packages/cran.scm
index 44c8b0a99..1359a565f 100644
--- a/gnu/packages/cran.scm
+++ b/gnu/packages/cran.scm
@@ -6655,6 +6655,40 @@ in science, technology, engineering and mathematics will need in their
professional lives, but which are usually taught in isolation, if at all.")
(license license:gpl2+)))
+(define-public r-leaflet
+ (package
+ (name "r-leaflet")
+ (version "2.0.2")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (cran-uri "leaflet" version))
+ (sha256
+ (base32
+ "051i5qmwa0zbk4jpjrx9kzk4g8qg9c3cavvhw19yj08fjhh8si7s"))))
+ (build-system r-build-system)
+ (propagated-inputs
+ `(("r-base64enc" ,r-base64enc)
+ ("r-crosstalk" ,r-crosstalk)
+ ("r-htmltools" ,r-htmltools)
+ ("r-htmlwidgets" ,r-htmlwidgets)
+ ("r-magrittr" ,r-magrittr)
+ ("r-markdown" ,r-markdown)
+ ("r-png" ,r-png)
+ ("r-raster" ,r-raster)
+ ("r-rcolorbrewer" ,r-rcolorbrewer)
+ ("r-scales" ,r-scales)
+ ("r-sp" ,r-sp)
+ ("r-viridis" ,r-viridis)))
+ (home-page "http://rstudio.github.io/leaflet/")
+ (synopsis
+ "Create Interactive Web Maps with the JavaScript Leaflet Library")
+ (description
+ "Create and customize interactive maps using the Leaflet JavaScript
+library and the htmlwidgets package. These maps can be used directly from
+the R console, from RStudio, in Shiny applications and R Markdown documents.")
+ (license license:gpl3)))
+
(define-public r-abd
(package
(name "r-abd")
--
2.20.1
Information forwarded
to
guix-patches <at> gnu.org
:
bug#34548
; Package
guix-patches
.
(Tue, 19 Feb 2019 13:06:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 34548 <at> debbugs.gnu.org (full text, mbox):
Hi Brett,
> From 26fbdbeee9ec293511648dc321abb09b6989fadc Mon Sep 17 00:00:00 2001
> From: Brett Gilio <brettg <at> posteo.net>
> Date: Mon, 18 Feb 2019 19:37:02 -0600
> Subject: [PATCH 06/24] gnu: Add r-leaflet.
>
> * gnu/packages/cran.scm (r-leaflet): New variable.
Unfortunately, this one is not okay. It’s been on my list to add
r-leaflet, but the package bundles minified JavaScript libraries.
These sources of these libraries will need to be added as native inputs
to replace the bundled sources. We can minify them with the uglify-js
package.
--
Ricardo
Information forwarded
to
guix-patches <at> gnu.org
:
bug#34548
; Package
guix-patches
.
(Tue, 19 Feb 2019 18:33:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 34548 <at> debbugs.gnu.org (full text, mbox):
Ricardo Wurmus writes:
> Hi Brett,
>
>> From 26fbdbeee9ec293511648dc321abb09b6989fadc Mon Sep 17 00:00:00 2001
>> From: Brett Gilio <brettg <at> posteo.net>
>> Date: Mon, 18 Feb 2019 19:37:02 -0600
>> Subject: [PATCH 06/24] gnu: Add r-leaflet.
>>
>> * gnu/packages/cran.scm (r-leaflet): New variable.
>
> Unfortunately, this one is not okay. It’s been on my list to add
> r-leaflet, but the package bundles minified JavaScript libraries.
>
> These sources of these libraries will need to be added as native inputs
> to replace the bundled sources. We can minify them with the uglify-js
> package.
Understood. I will make a note to look that and see if I can revise the
patch if that option seems formidable. However, on that note, do we have
any progress on an npm importer? I know that came up awhile back.
Information forwarded
to
guix-patches <at> gnu.org
:
bug#34548
; Package
guix-patches
.
(Thu, 21 Feb 2019 20:04:01 GMT)
Full text and
rfc822 format available.
Message #14 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Brett Gilio <brettg <at> posteo.net> skrev: (19 februari 2019 19:32:12 CET)
>
>Ricardo Wurmus writes:
>
>> Hi Brett,
>>
>>> From 26fbdbeee9ec293511648dc321abb09b6989fadc Mon Sep 17 00:00:00
>2001
>>> From: Brett Gilio <brettg <at> posteo.net>
>>> Date: Mon, 18 Feb 2019 19:37:02 -0600
>>> Subject: [PATCH 06/24] gnu: Add r-leaflet.
>>>
>>> * gnu/packages/cran.scm (r-leaflet): New variable.
>>
>> Unfortunately, this one is not okay. It’s been on my list to add
>> r-leaflet, but the package bundles minified JavaScript libraries.
>>
>> These sources of these libraries will need to be added as native
>inputs
>> to replace the bundled sources. We can minify them with the
>uglify-js
>> package.
>
>Understood. I will make a note to look that and see if I can revise the
>patch if that option seems formidable. However, on that note, do we
>have
>any progress on an npm importer? I know that came up awhile back.
Julien is sitting on the patchset right now since a few weeks.
It still has some defects still but is mostly working.
The problem of circular dependencies is still unsolved. I suggest we add to our importer the ability to parse and select versions recursively. I tried but failed to get it to work before I gave up.
--
Sent from my k-9 mail for Android.
[Message part 2 (text/html, inline)]
Information forwarded
to
guix-patches <at> gnu.org
:
bug#34548
; Package
guix-patches
.
(Thu, 21 Feb 2019 20:04:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
guix-patches <at> gnu.org
:
bug#34548
; Package
guix-patches
.
(Thu, 21 Feb 2019 20:15:03 GMT)
Full text and
rfc822 format available.
Message #20 received at submit <at> debbugs.gnu.org (full text, mbox):
swedebugia writes:
> Brett Gilio <brettg <at> posteo.net> skrev: (19 februari 2019 19:32:12 CET)
>>
>>Ricardo Wurmus writes:
>>
>>> Hi Brett,
>>>
>>>> From 26fbdbeee9ec293511648dc321abb09b6989fadc Mon Sep 17 00:00:00
>>2001
>>>> From: Brett Gilio <brettg <at> posteo.net>
>>>> Date: Mon, 18 Feb 2019 19:37:02 -0600
>>>> Subject: [PATCH 06/24] gnu: Add r-leaflet.
>>>>
>>>> * gnu/packages/cran.scm (r-leaflet): New variable.
>>>
>>> Unfortunately, this one is not okay. It’s been on my list to add
>>> r-leaflet, but the package bundles minified JavaScript libraries.
>>>
>>> These sources of these libraries will need to be added as native
>>inputs
>>> to replace the bundled sources. We can minify them with the
>>uglify-js
>>> package.
>>
>>Understood. I will make a note to look that and see if I can revise the
>>patch if that option seems formidable. However, on that note, do we
>>have
>>any progress on an npm importer? I know that came up awhile back.
>
> Julien is sitting on the patchset right now since a few weeks.
>
> It still has some defects still but is mostly working.
>
> The problem of circular dependencies is still unsolved. I suggest we add to our importer the ability to parse and select versions recursively. I tried but failed to get it to work before I gave up.
Hey, where is the patchset located? I wouldn't mind taking a look.
Information forwarded
to
guix-patches <at> gnu.org
:
bug#34548
; Package
guix-patches
.
(Thu, 21 Feb 2019 20:15:04 GMT)
Full text and
rfc822 format available.
Information forwarded
to
guix-patches <at> gnu.org
:
bug#34548
; Package
guix-patches
.
(Fri, 22 Feb 2019 14:21:02 GMT)
Full text and
rfc822 format available.
Message #26 received at 34548 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On 02/21/2019 09:14 PM, Brett Gilio wrote:
> swedebugia writes:
>
>> Brett Gilio <brettg <at> posteo.net> skrev: (19 februari 2019 19:32:12 CET)
snip
>>> However, on that note, do we
>>> have
>>> any progress on an npm importer? I know that came up awhile back.
>> Julien is sitting on the patchset right now since a few weeks.
>>
>> It still has some defects still but is mostly working.
>>
>> The problem of circular dependencies is still unsolved. I suggest we add to our importer the ability to parse and select versions recursively. I tried but failed to get it to work before I gave up.
> Hey, where is the patchset located? I wouldn't mind taking a look.
Here it is: https://framagit.org/tyreunom/guix/tree/npm
Julien integrated my changes (which consisted of changing to use the
npm-packages instead of github sources) on top of Jelles earlier work
and made some changes after that (fixing the recursive importer :D) and
rebased the whole thing.
Most smaller packages include everything in the npm-packages but when
reviewing we should check that we are actually building from source and
not just installing some precompiles js-files (which you can imagine
will take a long time).
Fortunately it is "only" 1500-2000 packages i a couple of different
versions that are used in most projects that I have explored with the
very nice tool npm-explorer (see
https://gitlab.com/swedebugia/guile-npm-explorer).
We essentially need to write our own npm dependency resolver to avoid
circular dependencies.
What in my view is currently missing to decide which version of
dependencies to import is a semver parser. I took a stab at that, see
below[1], but it is messy and buggy and should probably be implemented
with PEG[2].
Now that I recently succeded with PEG in my unpublished WIP quicklisp
importer I could give it another try with PEG.
Have fun with it!
|;; FIXME consider even the patch versions. ;; See
https://stackoverflow.com/questions/22343224/whats-the-difference-between-tilde-and-caret-in-package-json
(define (parse-semver hashtable version) "return the newest version
within the same major or minor version" (define (split list)
(string-split list #\.)) (define (version-list hashtable) (map split
(map first (hash-table->alist (hash-ref hashtable "versions")))))
(define (major list) (first list)) (define (minor list) (second list))
(define (minor->number list) (string->number (minor (split list)))) ;;
Return latest minor with same major version. ;; e.g. ^1.1.0 -> 1.4.0
even though 2.0.0 is availiable (let* ((version (split (string-drop
version 1))) (version-list (map first (hash-table->alist (hash-ref
hashtable "versions")))) (same-major (if (equal? 3 (length version))
(fold ;; recurse through version-list (lambda (ver lst) (if
(string-prefix? (major version) ver) (cons ver lst) lst)) '()
version-list) ;; not a version triplet #f))) ;; From ;;
https://www.gnu.org/software/guile/manual/html_node/SRFI_002d1-Fold-and-Map.html#SRFI_002d1-Fold-and-Map
(fold-right (lambda (str prev) (if (> (minor->number str) (minor->number
prev)) str prev)) ;;init with 0.0.0 work with minor->number "0.0.0"
same-major))) [1]
https://gitlab.com/swedebugia/guile-npm-explorer/blob/wip-versioning-parse/npm-explorer.scm#L148
[2]
https://www.gnu.org/software/guile/manual/html_node/PEG-Tutorial.html#PEG-Tutorial
|
[Message part 2 (text/html, inline)]
Reply sent
to
Ricardo Wurmus <rekado <at> elephly.net>
:
You have taken responsibility.
(Sun, 23 Jan 2022 12:19:01 GMT)
Full text and
rfc822 format available.
Notification sent
to
Brett Gilio <brettg <at> posteo.net>
:
bug acknowledged by developer.
(Sun, 23 Jan 2022 12:19:01 GMT)
Full text and
rfc822 format available.
Message #31 received at 34548-done <at> debbugs.gnu.org (full text, mbox):
I’m closing this as we now have r-leaflet.
It took a long time to figure out what sources correspond to the
minified JavaScript, but once all sources had been found processing the
sources to generate minified JavaScript was easy.
--
Ricardo
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sun, 20 Feb 2022 12:24:07 GMT)
Full text and
rfc822 format available.
This bug report was last modified 3 years and 141 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.