Skip to content

Commit

Permalink
include authors from CITATION.cff files of the rust crates
Browse files Browse the repository at this point in the history
  • Loading branch information
shrektan committed Oct 9, 2023
1 parent 16490cc commit 662b81d
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 40 deletions.
44 changes: 22 additions & 22 deletions LICENSE.note
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ License: MIT/Apache-2.0

Name: chrono
Files: vendor/chrono/*
Authors:
Authors: Brandon W. Maister, Dirkjan Ochtman, Kang Seonghoon, Eric Sheppard, Paul Dicker
License: MIT OR Apache-2.0

------------------------------
Expand Down Expand Up @@ -99,16 +99,16 @@ License: MIT

------------------------------

Name: iana-time-zone-haiku
Files: vendor/iana-time-zone-haiku/*
Authors: René Kijewski
Name: iana-time-zone
Files: vendor/iana-time-zone/*
Authors: Andrew Straw, René Kijewski, Ryan Lopopolo
License: MIT OR Apache-2.0

------------------------------

Name: iana-time-zone
Files: vendor/iana-time-zone/*
Authors: Andrew Straw, René Kijewski, Ryan Lopopolo
Name: iana-time-zone-haiku
Files: vendor/iana-time-zone-haiku/*
Authors: René Kijewski
License: MIT OR Apache-2.0

------------------------------
Expand Down Expand Up @@ -197,15 +197,15 @@ License: (MIT OR Apache-2.0) AND Unicode-DFS-2016

------------------------------

Name: wasm-bindgen-backend
Files: vendor/wasm-bindgen-backend/*
Name: wasm-bindgen
Files: vendor/wasm-bindgen/*
Authors: The wasm-bindgen Developers
License: MIT/Apache-2.0

------------------------------

Name: wasm-bindgen-macro-support
Files: vendor/wasm-bindgen-macro-support/*
Name: wasm-bindgen-backend
Files: vendor/wasm-bindgen-backend/*
Authors: The wasm-bindgen Developers
License: MIT/Apache-2.0

Expand All @@ -218,20 +218,27 @@ License: MIT/Apache-2.0

------------------------------

Name: wasm-bindgen-shared
Files: vendor/wasm-bindgen-shared/*
Name: wasm-bindgen-macro-support
Files: vendor/wasm-bindgen-macro-support/*
Authors: The wasm-bindgen Developers
License: MIT/Apache-2.0

------------------------------

Name: wasm-bindgen
Files: vendor/wasm-bindgen/*
Name: wasm-bindgen-shared
Files: vendor/wasm-bindgen-shared/*
Authors: The wasm-bindgen Developers
License: MIT/Apache-2.0

------------------------------

Name: windows
Files: vendor/windows/*
Authors: Microsoft
License: MIT OR Apache-2.0

------------------------------

Name: windows_aarch64_gnullvm
Files: vendor/windows_aarch64_gnullvm/*
Authors: Microsoft
Expand Down Expand Up @@ -285,10 +292,3 @@ Name: windows-targets
Files: vendor/windows-targets/*
Authors: Microsoft
License: MIT OR Apache-2.0

------------------------------

Name: windows
Files: vendor/windows/*
Authors: Microsoft
License: MIT OR Apache-2.0
3 changes: 3 additions & 0 deletions cleanup
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
# for NON CRAN use
# rm -Rf src/Makevars src/Makevars.win
# must clean up the temp files
rm -Rf src/Makevars src/Makevars.win src/rust/.cargo src/rust/target src/rust/vendor
30 changes: 17 additions & 13 deletions inst/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ cfg-if (version 1.0.0):
Alex Crichton

chrono (version 0.4.31):

Brandon W. Maister
Dirkjan Ochtman
Kang Seonghoon
Eric Sheppard
Paul Dicker

core-foundation-sys (version 0.8.4):
The Servo Project Developers
Expand Down Expand Up @@ -52,14 +56,14 @@ extendr-macros (version 0.4.0):
Hiroaki Yutani
Ilia A. Kosenkov

iana-time-zone-haiku (version 0.1.2):
René Kijewski

iana-time-zone (version 0.1.57):
Andrew Straw
René Kijewski
Ryan Lopopolo

iana-time-zone-haiku (version 0.1.2):
René Kijewski

js-sys (version 0.3.64):
The wasm-bindgen Developers

Expand Down Expand Up @@ -93,30 +97,33 @@ proc-macro2 (version 1.0.67):
quote (version 1.0.33):
David Tolnay

syn (version 1.0.109):
syn (version 2.0.37):
David Tolnay

syn (version 2.0.37):
syn (version 1.0.109):
David Tolnay

unicode-ident (version 1.0.12):
David Tolnay

wasm-bindgen-backend (version 0.2.87):
wasm-bindgen (version 0.2.87):
The wasm-bindgen Developers

wasm-bindgen-macro-support (version 0.2.87):
wasm-bindgen-backend (version 0.2.87):
The wasm-bindgen Developers

wasm-bindgen-macro (version 0.2.87):
The wasm-bindgen Developers

wasm-bindgen-shared (version 0.2.87):
wasm-bindgen-macro-support (version 0.2.87):
The wasm-bindgen Developers

wasm-bindgen (version 0.2.87):
wasm-bindgen-shared (version 0.2.87):
The wasm-bindgen Developers

windows (version 0.48.0):
Microsoft

windows_aarch64_gnullvm (version 0.48.5):
Microsoft

Expand All @@ -140,6 +147,3 @@ windows_x86_64_msvc (version 0.48.5):

windows-targets (version 0.48.5):
Microsoft

windows (version 0.48.0):
Microsoft
25 changes: 20 additions & 5 deletions update_authors.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,33 @@ library(RcppTOML)
## Update inst/AUTHORS

VENDOR_PATH <- "src/rust/vendor"
manifests <- list.files(VENDOR_PATH, pattern = "Cargo.toml", recursive = TRUE)
crates <- list.dirs(VENDOR_PATH, FALSE, FALSE)

l <- lapply(manifests, \(x) RcppTOML::parseTOML(file.path(VENDOR_PATH, x))$package)
l <- lapply(crates, \(x) RcppTOML::parseTOML(file.path(VENDOR_PATH, x, "Cargo.toml"))$package)

names <- vapply(l, \(x) x[["name"]], FUN.VALUE = character(1L))
versions <- vapply(l, \(x) x[["version"]], FUN.VALUE = character(1L))

authors <- vapply(l, \(x) {
cargo_authors <- lapply(l, \(x) {
# Remove email addresses
authors <- stringr::str_remove(x[["authors"]], "\\s+<.+>")
paste(authors, collapse = ", ")
}, FUN.VALUE = character(1L))
authors
})
citation_author <- lapply(crates, \(x) {
path <- file.path(VENDOR_PATH, x, "CITATION.cff")
if (!file.exists(path)) {
return(NULL)
}
cite <- yaml::read_yaml(path)
if (is.null(cite$authors)) {
return(NULL)
}
authors <- cite$authors
vapply(authors, \(author) {
paste(author[["given-names"]], author[["family-names"]])
}, "")
}) |> unname()
authors <- mapply(\(x1, x2) paste0(c(x1, x2) |> unique(), collapse = ", "), cargo_authors, citation_author)

licenses <- vapply(l, \(x) x[["license"]], FUN.VALUE = character(1L))

Expand Down

0 comments on commit 662b81d

Please sign in to comment.