From 44a768b8901cf3fb1c7a39c1f6e2d90062f62c97 Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler Date: Sat, 29 Jul 2023 16:10:06 +0200 Subject: gnu: Add java-eclipse-rdf4j-model-api. Since RDF4J is a large framework with many parts, this patch also prepares some boilerplate code for the other packages. * gnu/packages/java-rdf.scm (%rdf4j-version, %rdf4j-sha256, %rdf4j-source) (rdf4j-common-arguments): New variables. (java-eclipse-rdf4j-model-api): New variable. --- gnu/packages/java-rdf.scm | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'gnu') diff --git a/gnu/packages/java-rdf.scm b/gnu/packages/java-rdf.scm index 066b383c5a..bf83c9ab5e 100644 --- a/gnu/packages/java-rdf.scm +++ b/gnu/packages/java-rdf.scm @@ -99,3 +99,47 @@ implementing java-commons-rdf-api."))) (synopsis "Simple implementation of RDF 1.1 concepts") (description "This package provides a simple implementation of RDF 1.1 concepts in Java."))) + +(define %rdf4j-version "3.7.7") +(define %rdf4j-sha256 + (base32 "1lala4wjl5lbg45jdgd94rfkvdg6r4vq23k3q54bkk9q3w9v2bdx")) +(define %rdf4j-source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/eclipse/rdf4j") + (commit %rdf4j-version))) + (file-name (git-file-name "rdf4j" %rdf4j-version)) + (sha256 %rdf4j-sha256) + (modules '((guix build utils))) + (snippet #~(begin (delete-file-recursively "site"))))) + +(define (rdf4j-common-arguments jar-name directory) + (list #:source-dir "src/main/java" + #:test-dir "src/test/java" + #:tests? #f ; tests require junit 5 + #:jar-name jar-name + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'chdir (lambda _ (chdir #$directory))) + (add-after 'chdir 'fix-pom + (lambda _ + (substitute* "pom.xml" + (("\\$\\{project\\.groupId\\}") "org.eclipse.rdf4j")))) + (replace 'install + (install-from-pom "pom.xml"))))) + +(define-public java-eclipse-rdf4j-model-api + (package + (name "java-eclipse-rdf4j-model-api") + (version %rdf4j-version) + (source %rdf4j-source) + (build-system ant-build-system) + (arguments + (rdf4j-common-arguments "rdf4j-model-api.jar" + "core/model-api")) + (home-page "https://rdf4j.org/") + (synopsis "RDF4J model interfaces") + (description "This package provides interfaces for the RDF data model used +in the RDF4J framework.") + (license license:epl1.0))) -- cgit v1.2.3