From e94dfb4bd0963ef47ce33253bfd3539847dc6664 Mon Sep 17 00:00:00 2001 From: Raniere Gaia Costa da Silva Date: Fri, 7 Aug 2026 08:13:59 +0200 Subject: [PATCH 1/3] Add recipe for r-fastmatch --- .../patches/0001-Remove-dummy.c.patch | 31 +++++++++++++ .../r-fastmatch/recipe.yaml | 46 +++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 recipes/recipes_emscripten/r-fastmatch/patches/0001-Remove-dummy.c.patch create mode 100644 recipes/recipes_emscripten/r-fastmatch/recipe.yaml diff --git a/recipes/recipes_emscripten/r-fastmatch/patches/0001-Remove-dummy.c.patch b/recipes/recipes_emscripten/r-fastmatch/patches/0001-Remove-dummy.c.patch new file mode 100644 index 00000000000..88dd7f29d78 --- /dev/null +++ b/recipes/recipes_emscripten/r-fastmatch/patches/0001-Remove-dummy.c.patch @@ -0,0 +1,31 @@ +From ae8423bb3477b25b3d668a1e4c4b3e84b0129bd8 Mon Sep 17 00:00:00 2001 +From: Raniere Gaia Costa da Silva +Date: Thu, 29 Jan 2026 10:36:27 +0100 +Subject: [PATCH] Remove dummy.c + +As recommended in https://github.com/s-u/fastmatch/issues/13 +--- + src/dummy.c | 11 ----------- + 1 file changed, 11 deletions(-) + delete mode 100644 src/dummy.c + +diff --git a/src/dummy.c b/src/dummy.c +deleted file mode 100644 +index 5bddef9..0000000 +--- a/src/dummy.c ++++ /dev/null +@@ -1,11 +0,0 @@ +-/* dummy symbols to keep superfluous CRAN checks happy +- (this package uses NAMESPACE C-level symbol registration +- but the checks don't get that) */ +- +-extern void R_registerRoutines(void); +-extern void R_useDynamicSymbols(void); +- +-void dummy(void) { +- R_registerRoutines(); +- R_useDynamicSymbols(); +-} +-- +2.52.0 + diff --git a/recipes/recipes_emscripten/r-fastmatch/recipe.yaml b/recipes/recipes_emscripten/r-fastmatch/recipe.yaml new file mode 100644 index 00000000000..88d9cbcdaa9 --- /dev/null +++ b/recipes/recipes_emscripten/r-fastmatch/recipe.yaml @@ -0,0 +1,46 @@ +context: + name: r-fastmatch + version: 1.1-8 + +package: + name: ${{ name }} + version: ${{ version|replace("-", "_") }} + +source: + url: + - https://cran.r-project.org/src/contrib/${{ name[2:] }}_${{ version }}.tar.gz + - https://cloud.r-project.org/src/contrib/${{ name[2:] }}_${{ version }}.tar.gz + sha256: 2661c01bdc2383f4a30bf940e6bc3b68f1329db5f0e837df8160eb893f748d54 + patches: + - patches/0001-Remove-dummy.c.patch + +build: + number: 0 + script: $R CMD INSTALL $R_ARGS . + +requirements: + build: + - ${{ compiler('c') }} + - cross-r-base_${{ target_platform }} ==${{ r_base }} + host: + - r-base ==${{ r_base }} + run: + +tests: +- package_contents: + lib: + - R/library/${{ name[2:] }}/libs/${{ name[2:] }}.so + +about: + homepage: https://www.rforge.net/fastmatch + license: GPL-2.0-only + summary: Package providing a fast match() replacement for cases that require repeated look-ups. + It is slightly faster that R's built-in match() function on first match against + a table, but extremely fast on any subsequent lookup as it keeps the hash table + in memory. + license_family: GPL2 + license_file: DESCRIPTION + +extra: + recipe-maintainers: + - rgaiacs \ No newline at end of file From 0f629e3673b353231eadf39789ec2f0860c28b13 Mon Sep 17 00:00:00 2001 From: Raniere Gaia Costa da Silva Date: Fri, 7 Aug 2026 08:20:19 +0200 Subject: [PATCH 2/3] Add test from documentation to r-fastmatch --- .../recipes_emscripten/r-fastmatch/recipe.yaml | 7 +++++++ .../r-fastmatch/test-r-fastmatch.R | 17 +++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 recipes/recipes_emscripten/r-fastmatch/test-r-fastmatch.R diff --git a/recipes/recipes_emscripten/r-fastmatch/recipe.yaml b/recipes/recipes_emscripten/r-fastmatch/recipe.yaml index 88d9cbcdaa9..f2a82c50d6a 100644 --- a/recipes/recipes_emscripten/r-fastmatch/recipe.yaml +++ b/recipes/recipes_emscripten/r-fastmatch/recipe.yaml @@ -30,6 +30,13 @@ tests: - package_contents: lib: - R/library/${{ name[2:] }}/libs/${{ name[2:] }}.so +- script: run_r_test test-r-fastmatch.R + files: + recipe: + - test-r-fastmatch.R + requirements: + build: + - r-wasm-tester about: homepage: https://www.rforge.net/fastmatch diff --git a/recipes/recipes_emscripten/r-fastmatch/test-r-fastmatch.R b/recipes/recipes_emscripten/r-fastmatch/test-r-fastmatch.R new file mode 100644 index 00000000000..5cb61e57683 --- /dev/null +++ b/recipes/recipes_emscripten/r-fastmatch/test-r-fastmatch.R @@ -0,0 +1,17 @@ +library(fastmatch) + +stopifnot(is.function(coalesce)) +stopifnot(is.function(ctapply)) +stopifnot(is.function(fmatch)) + +# Example from fastmatch documentation +i = rnorm(2e6) +names(i) = as.integer(rnorm(2e6)) +coalesce(names(i)) + +i = i[order(names(i))] +ctapply(i, names(i), sum) + +x = as.integer(rnorm(1e6) * 1000000) +s = 1:100 +fmatch(s,x) \ No newline at end of file From 70123db78103c3d8050a5ef1f8e95d94377e0a7f Mon Sep 17 00:00:00 2001 From: Raniere Gaia Costa da Silva Date: Tue, 4 Aug 2026 11:36:41 +0200 Subject: [PATCH 3/3] Add recipe for r-quanteda 4.5.0 Based on the previous work documented in https://github.com/emscripten-forge/recipes/pull/4305. --- .../recipes_emscripten/r-quanteda/recipe.yaml | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 recipes/recipes_emscripten/r-quanteda/recipe.yaml diff --git a/recipes/recipes_emscripten/r-quanteda/recipe.yaml b/recipes/recipes_emscripten/r-quanteda/recipe.yaml new file mode 100644 index 00000000000..74b93c806cf --- /dev/null +++ b/recipes/recipes_emscripten/r-quanteda/recipe.yaml @@ -0,0 +1,81 @@ +context: + name: r-quanteda + version: 4.5.0 + +package: + name: ${{ name }} + version: ${{ version }} + +source: + url: + - https://cran.r-project.org/src/contrib/${{ name[2:] }}_${{ version }}.tar.gz + - https://cloud.r-project.org/src/contrib/${{ name[2:] }}_${{ version }}.tar.gz + sha256: caf592519d51f1a19694fb112e8455814526a3f7b25f6befb7337e76fcacf6c2 + +build: + number: 0 + script: $R CMD INSTALL $R_ARGS . + +requirements: + build: + - ${{ compiler('c') }} + - cross-r-base_${{ target_platform }} ==${{ r_base }} + - r-matrix >=1.5_0 + - r-rcpp >=0.12.12 + - r-snowballc + - r-fastmatch + - r-jsonlite + - r-lifecycle + - r-magrittr + - r-stopwords + - r-stringi + - r-xml2 + - r-yaml + # Workaround minor limitation of rattler-build + - r-usethis + host: + - r-base ==${{ r_base }} + - r-matrix >=1.5_0 + - r-rcpp >=0.12.12 + - r-snowballc + - r-fastmatch + - r-jsonlite + - r-lifecycle + - r-magrittr + - r-stopwords + - r-stringi + - r-xml2 + - r-yaml + run: + - r-matrix >=1.5_0 + - r-rcpp >=0.12.12 + - r-snowballc + - r-fastmatch + - r-jsonlite + - r-lifecycle + - r-magrittr + - r-stopwords + - r-stringi + - r-xml2 + - r-yaml + +tests: +- package_contents: + lib: + - R/library/${{ name[2:] }}/libs/${{ name[2:] }}.so + +about: + homepage: https://quanteda.io + license: GPL-3.0-only + summary: A fast, flexible, and comprehensive framework for quantitative text analysis in R. Provides + functionality for corpus management, creating and manipulating tokens and n-grams, + exploring keywords in context, forming and manipulating sparse matrices of documents + by features and feature co-occurrences, analyzing keywords, computing feature similarities + and distances, applying content dictionaries, applying supervised and unsupervised + machine learning, visually representing text and text analyses, and more. + license_family: GPL3 + license_file: LICENSE + +extra: + recipe-maintainers: + - rgaiacs \ No newline at end of file