saxonc-libs (HE/PE/EE)# SaxonC Libs
GitHub Actions workflow is included (.github/workflows/ci.yml).## CIbundle exec rake buildbundle installbash## Building all gemsENV["SAXONC_HOME"] = pathpath = Saxonc::Libs.pathSaxonc::Libs.ensure_installed!# Ensures EE is downloaded and returns the install pathrequire "saxonc-libs-ee"ruby## UsageRequiring the gem downloads the matching SaxonC archive from Saxonica (using the edition/version in SAXON_VERSION) and extracts it into the cache.bundle add saxonc-libs-eebundle add saxonc-libs-pebundle add saxonc-libs-he# pick onebash## Installation- saxonc-libs-ee- saxonc-libs-pe- saxonc-libs-he## GemsThree tiny helper gems that download and cache the SaxonC native libraries for a specific edition (HE, PE, or EE) under ~/.saxonc/<version>/<edition>/<platform>. Include the gem for the edition you need and it will ensure SaxonC is present.
SaxonC Libs packages the pre-built SaxonC native libraries for use
from Ruby gems such as saxonc. It offers a single
command that downloads the official SaxonC distribution for the
current platform, extracts the lib, include, and bin artifacts,
and stores them in a predictable location other gems can depend on.
Versioning
This gem mirrors SaxonC releases using the pattern
<saxon-version>.<packaging-patch>. For example, version 12.9.0
wraps SaxonC 12.9 with a first packaging revision. Whenever SaxonC
publishes a new point release, bump the first two segments and reset
the packaging patch to zero.
Usage
gem install saxonc-libs
saxonc-libs install --target vendor/saxonc --edition heThe install command will:
- Detect the current platform (macOS ARM64, macOS Intel, Linux x86_64, or Windows x86_64 for the initial release).
- Read the release manifest for the bundled SaxonC version and
edition (
he,pe, oree). - Download the official SaxonC zip archive for that platform.
- Extract the relevant files into
vendor/saxonc/<edition>/<platform>. - Write a manifest JSON file describing the extracted payload.
The CLI accepts --edition (defaults to he) and --force (to
re-download even if a cached copy exists), which is handy when testing
different SaxonC editions or refreshing a corrupted cache.
Other gems (such as saxonc) can then look up the installation path via:
require "saxonc/libs"
saxon_home = SaxonC::Libs.install(edition: :he)
# => /path/to/vendor/saxonc/he/macos-arm64Release manifests
The releases.yml file in the repo root describes where to download
each platform artifact. The installer refuses to run unless a manifest
entry exists for the detected platform and edition. Publishing a new
packaging release typically involves:
- Adding/updating the relevant section inside
releases.yml. - Recording the download URL and SHA256 checksum for each platform.
- Updating
lib/saxonc/libs/version.rbwith the new version. - Releasing the gem.
You can populate missing SHA256 values automatically via
script/fill_checksums.rb. Run it without options to download each
archive and compute its digest, or pass --source-dir to point at a
directory containing previously downloaded zips (useful for PE/EE
editions that require credentials):
bundle exec ruby script/fill_checksums.rb --source-dir ~/Downloads/saxoncLicense
This helper gem is distributed under the MIT license. The downloaded SaxonC binaries remain subject to Saxonica's license terms; the installer copies their notices alongside the extracted artifacts.