Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
From ae8423bb3477b25b3d668a1e4c4b3e84b0129bd8 Mon Sep 17 00:00:00 2001
From: Raniere Gaia Costa da Silva <Raniere.CostadaSilva@gesis.org>
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

53 changes: 53 additions & 0 deletions recipes/recipes_emscripten/r-fastmatch/recipe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
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
- 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
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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
license_file: DESCRIPTION
license_file: ${{ PREFIX }}/lib/R/share/licenses/GPL-2

DESCRIPTION is not a license file


extra:
recipe-maintainers:
- rgaiacs
17 changes: 17 additions & 0 deletions recipes/recipes_emscripten/r-fastmatch/test-r-fastmatch.R
Original file line number Diff line number Diff line change
@@ -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)
Loading