Skip to content

[R-pkg-devel] Proper CRAN way - How to handle dependency of java jar file?

5 messages · Maëlle SALMON, Rainer M Krug, Paul SAVARY +1 more

#
Regarding where to save the jar file, you might be interested in "app dirs" (via tools::R_user_dir() in R from 4.0, the rappdirs package, the hoardr package) cf https://blog.r-hub.io/2020/03/12/user-preferences/#not-so-temporary-files3

Ma?lle.

Den tisdag 23 juni 2020 14:56:30 CEST, Rainer M Krug <rainer at krugs.de> skrev: 





Thanks Duncan.
That?s good to know.
So a tet file in the inst/jar directory giving the link to the GitHub repo would be fine in this case?
I guess it would be stretching it a bit, as the jar file is 8.2 MB, and plantuml has regular continuous updates, so I would prefer to keep it dynamic.
So the suggested option would be to have a function, which 
1) ask the user to create a directory in the home folder 
2) download the jar file into that directory or, when no permission is granted, into the tmpdir()

Thanks, no major changes necessary for that,

Rainer
--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany)

Orcid ID: 0000-0002-7490-0066

Department of Evolutionary Biology and Environmental Studies
University of Z?rich
Office Y34-J-74
Winterthurerstrasse 190
8075 Z?rich
Switzerland

Office:??? +41 (0)44 635 47 64
Cell:? ? ? ??? +41 (0)78 630 66 57
email:? ? ? Rainer.Krug at uzh.ch
??? ??? Rainer at krugs.de
Skype:? ? RMkrug

PGP: 0x0F52F982




??? [[alternative HTML version deleted]]


______________________________________________
R-package-devel at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel
#
Thanks Ma?lle - that is exactly what I am doing at the moment.

Cheers,

Rainer
--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany)

Orcid ID: 0000-0002-7490-0066

Department of Evolutionary Biology and Environmental Studies
University of Z?rich
Office Y34-J-74
Winterthurerstrasse 190
8075 Z?rich
Switzerland

Office:	+41 (0)44 635 47 64
Cell:       	+41 (0)78 630 66 57
email:      Rainer.Krug at uzh.ch
		Rainer at krugs.de
Skype:     RMkrug

PGP: 0x0F52F982
#
Thanks you too.

That is also what I am doing. Note that I am downloading jar files into a directory created in rappdirs::user_data_dir() using the command download.file(url, ...).

If I do not specify 'mode='wb'' in download.file() on a Windows OS, downloaded jar file is corrupted and cannot be used because a text file is created in which \n are converted into \r\n, which does not make sens for a binary file.

I hope it can help
Cheers

Paul Savary - PhD Student
UMR 6049 Th?MA (Besan?on), UMR 6282 Biog?osciences (Dijon), ARP-Astrance (Paris) 
Phone number : +33.6.30.97.34.27 
Research topics: population genetics, landscape ecology, graph theory, spatial statistics

----- Mail original -----
De: "Rainer M Krug" <Rainer at krugs.de>
?: "Ma?lle SALMON" <maelle.salmon at yahoo.se>
Cc: "r-package-devel" <r-package-devel at r-project.org>
Envoy?: Lundi 13 Juillet 2020 11:15:10
Objet: Re: [R-pkg-devel]  Proper CRAN way - How to handle dependency of java jar file?

Thanks Ma?lle - that is exactly what I am doing at the moment.

Cheers,

Rainer
--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany)

Orcid ID: 0000-0002-7490-0066

Department of Evolutionary Biology and Environmental Studies
University of Z?rich
Office Y34-J-74
Winterthurerstrasse 190
8075 Z?rich
Switzerland

Office:	+41 (0)44 635 47 64
Cell:       	+41 (0)78 630 66 57
email:      Rainer.Krug at uzh.ch
		Rainer at krugs.de
Skype:     RMkrug

PGP: 0x0F52F982





______________________________________________
R-package-devel at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel
#
On a related note:

I also need to set mode="wb" to download binary files on Windows in my rdwd package.
I'm considering calling download.file() with that mode as the default.
Is there any problem with that, potentially on other OS or for non-binary files?

Feel free to comment here to not crowd the mailing list:
https://github.com/brry/rdwd/issues/20

Thanks,
Berry
#
Jup - exactly.
Yes - the `mode = ?wb?` bit me as well - developing on MacOS, testing on travis on GitHub with Linux and Mac,, and what did I get, a corrupt jar on windows.

Thanks,

Rainer
--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany)

Orcid ID: 0000-0002-7490-0066

Department of Evolutionary Biology and Environmental Studies
University of Z?rich
Office Y34-J-74
Winterthurerstrasse 190
8075 Z?rich
Switzerland

Office:	+41 (0)44 635 47 64
Cell:       	+41 (0)78 630 66 57
email:      Rainer.Krug at uzh.ch
		Rainer at krugs.de
Skype:     RMkrug

PGP: 0x0F52F982