88.4. raptor2-2.0.16
Raptor RDF syntax library — RDF/XML, Turtle and N-Triples parsers and serialisers
| Version | 2.0.16, release 1 |
| Shelf | formats — Data-format and serialisation libraries (XML, JSON, YAML, TOML, INI, RDF, protobuf, thrift), plus data query and convert tools |
| Phase | 41_system (System), 157 of 1047 in build order |
| Licence | LGPL-2.1-or-later OR GPL-2.0-or-later OR Apache-2.0 |
| Homepage | https://librdf.org/raptor/ |
| Build time | 0.2 SBU |
| Installed size | 671.8 KiB in 15 files |
| Recipe | ports/core/formats/raptor2/kpkgbuild |
About
Raptor is the RDF syntax library of the Redland project: it parses and writes RDF, the triple-based data format of the semantic web, in RDF/XML, Turtle, N-Triples, N-Quads, TriG, JSON and other syntaxes, and installs the rapper command-line converter. It is in the tree for lrdf, the library audio programs use to read the RDF descriptions of LADSPA plugins.
Sources
raptor2-2.0.16.tar.gz(1.7 MiB)
sha256089db78d7ac982354bdbf39d973baf09581e6904ac4c92a98c5caadb3de44680
upstream: https://download.librdf.org/source/raptor2-2.0.16.tar.gz
archive copy: sources-2/formats--raptor2-2.0.16.tar.gz
Dependencies
Depends on: pkgconf, libxml2, yajl, icu.
Required by (1): lrdf.
Patches
build.sh applies these; kpkg applies nothing by itself.
libxml-2.11.0.patch— Comments out the two lines inraptor_libxml.cthat set thecheckedfield of a libxml2 entity, a member libxml2 dropped fromxmlEntityin the commit the patch’s first line links. Against the tree’s libxml2 the lines do not compile.
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/41_system/phase.env && kpkg install raptor2'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/formats/raptor2.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/formats/raptor2
echo '089db78d7ac982354bdbf39d973baf09581e6904ac4c92a98c5caadb3de44680 raptor2-2.0.16.tar.gz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/raptor2
SRC=$SRC_ROOT/raptor2-2.0.16
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf raptor2-2.0.16.tar.gz -C "$SRC" --strip-components=1
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
patch -p1 -i "$PORT_SRC/libxml-2.11.0.patch"
./configure --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --disable-static \
--with-www=none \
--enable-parsers="rdfxml ntriples turtle trig guess rss-tag-soup rdfa nquads json" \
--enable-serializers="rdfxml rdfxml-abbrev turtle mkr ntriples rss-1.0 dot html json atom nquads" \
--disable-gtk-doc
make
make DESTDIR=$PKG install
rm -rf "$PKG/usr/share/gtk-doc"
The switches, and why each is set:
--with-www=none— Build with no WWW library, so Raptor reads onlyfile:URIs itself; a document at any other address has to be fetched by its caller and handed over. Upstream’s default is libcurl.--enable-parsers="rdfxml ntriples turtle trig guess rss-tag-soup rdfa nquads json"— Build these parsers: every one upstream offers except GRDDL, which needs libxslt. Named as a list, the set does not change with what happens to be installed: left at its default, configure adds GRDDL whenever libxslt is present. The JSON parser needs yajl; if it is missing, configure drops the parser with only a warning.--enable-serializers="rdfxml rdfxml-abbrev turtle mkr ntriples rss-1.0 dot html json atom nquads"— Build every serializer upstream offers, named for the same reason.--disable-gtk-doc— Do not rebuild the API reference with gtk-doc. The pre-built reference in the tarball is still installed bymake install, andbuild.shdeletes/usr/share/gtk-docafterwards.
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/raptor2, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf raptor2-2.0.16-1.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/raptor2, and runs the triggers its paths call for.
Contents
Installed programs: rapper.
Installed libraries: libraptor2.so.
Installed directories: /usr/include/raptor2, /usr/share/licenses/raptor2.
Short descriptions
rapper |
Raptor RDF parsing and serializing utility |
raptor2.pc |
RDF Syntax Library |
Notes
configure finds icu through pkg-config and uses it for the Unicode NFC check the RDF/XML parser performs; without it the check is skipped, with no error.