Skip to content

Commit

Permalink
Add divsufsort (lightweight suffix array construction)
Browse files Browse the repository at this point in the history
  • Loading branch information
eustas committed Jan 6, 2025
1 parent 9514330 commit c1f4eaa
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 0 deletions.
7 changes: 7 additions & 0 deletions modules/divsufsort/2.0.1/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module(
name = "divsufsort",
version = "2.0.1",
repo_name = "divsufsort",
compatibility_level = 1,
)
bazel_dep(name = "bazel_skylib", version = "1.7.1")
55 changes: 55 additions & 0 deletions modules/divsufsort/2.0.1/overlay/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package(
default_visibility = ["//visibility:public"],
)

load("@bazel_skylib//rules:expand_template.bzl", "expand_template")

SUBSTITUTIONS = {
"#cmakedefine": "#define",
"${PROJECT_VERSION_FULL}": "2.0.1",
"@INLINE@": "inline",
"@DIVSUFSORT_EXPORT@": "",
"@DIVSUFSORT_IMPORT@": "",
"@INCFILE@": "#include <inttypes.h>",
"@SAUCHAR_TYPE@": "uint8_t",
"@SAINT32_TYPE@": "int32_t",
"@SAINT_PRId@": "PRId32",
"@W64BIT@": "",
"@SAINDEX_TYPE@": "int32_t",
"@SAINDEX_PRId@": "PRId32",
"HAVE_IO_H 1": "HAVE_IO_H 0",
"HAVE_STRINGS_H 1": "HAVE_STRINGS_H 0",
}

[
expand_template(
name = "expand_" + src,
out = src,
substitutions = SUBSTITUTIONS,
template = src + ".cmake",
visibility = ["//visibility:public"],
)
for src in [
"include/config.h",
"include/divsufsort.h",
]
]

cc_library(
name = "divsufsort",
srcs = [
"lib/divsufsort.c",
"lib/sssort.c",
"lib/trsort.c",
"lib/utils.c",
],
hdrs = [
"include/config.h",
"include/divsufsort.h",
"include/divsufsort_private.h",
],
copts = [
"-DHAVE_CONFIG_H=1",
],
includes = ["include"],
)
1 change: 1 addition & 0 deletions modules/divsufsort/2.0.1/overlay/MODULE.bazel
17 changes: 17 additions & 0 deletions modules/divsufsort/2.0.1/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
matrix:
platform:
- debian10
- ubuntu2004
- macos
- macos_arm64
- windows
bazel:
- 7.x
- 8.x
tasks:
verify_targets:
name: Verify build targets
platform: ${{ platform }}
bazel: ${{ bazel }}
build_targets:
- '@divsufsort//:divsufsort'
10 changes: 10 additions & 0 deletions modules/divsufsort/2.0.1/source.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"url": "https://github.com/y-256/libdivsufsort/archive/refs/tags/2.0.1.tar.gz",
"integrity": "sha256-kWTLYETctuQwVVch4zGNWo84hxwtqf2SVmZXRqaTUeA=",
"strip_prefix": "libdivsufsort-2.0.1",
"patch_strip": 0,
"overlay": {
"BUILD.bazel": "sha256-AITY2xXOLBSMw/bfwbP9IDG3gIkMQVZDIWto+71KwYI=",
"MODULE.bazel": "sha256-D+uJYqopQZ6W8D2rzMMWccOz12tGaQMOJBisWkqjZts="
}
}
17 changes: 17 additions & 0 deletions modules/divsufsort/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"homepage": "https://code.google.com/archive/p/libdivsufsort/",
"maintainers": [
{
"email": "[email protected]",
"github": "eustas",
"name": "Evgenii Kliuchnikov"
}
],
"repository": [
"github:y-256/libdivsufsort"
],
"versions": [
"2.0.1"
],
"yanked_versions": {}
}

0 comments on commit c1f4eaa

Please sign in to comment.