mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2025-01-04 01:42:53 +03:00
Merge pull request #244495 from 7c6f434c/fuseki-path
apache-jena-fuseki: 4.8.0 -> 4.9.0, add a test
This commit is contained in:
commit
0ba31f5b5b
@ -1,11 +1,20 @@
|
||||
{ lib, stdenv, fetchurl, java, makeWrapper }:
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchurl
|
||||
, java
|
||||
, coreutils
|
||||
, which
|
||||
, makeWrapper
|
||||
# For the test
|
||||
, pkgs
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "apache-jena-fuseki";
|
||||
version = "4.8.0";
|
||||
version = "4.9.0";
|
||||
src = fetchurl {
|
||||
url = "mirror://apache/jena/binaries/apache-jena-fuseki-${version}.tar.gz";
|
||||
hash = "sha256-rJCY8vG1vfEGGA0gsIqNFXKl75O2Zp4zUIWSDfplpVE=";
|
||||
hash = "sha256-t25Q0lb+ecR12cDD1p6eZnzLxW0kZpPOFGvo5YK7AlI=";
|
||||
};
|
||||
nativeBuildInputs = [
|
||||
makeWrapper
|
||||
@ -16,11 +25,16 @@ stdenv.mkDerivation rec {
|
||||
ln -s "$out"/{fuseki-backup,fuseki-server,fuseki} "$out/bin"
|
||||
for i in "$out"/bin/*; do
|
||||
wrapProgram "$i" \
|
||||
--prefix "PATH" : "${java}/bin/" \
|
||||
--prefix "PATH" : "${java}/bin/:${coreutils}/bin:${which}/bin" \
|
||||
--set-default "FUSEKI_HOME" "$out" \
|
||||
;
|
||||
done
|
||||
'';
|
||||
passthru = {
|
||||
tests = {
|
||||
basic-test = pkgs.callPackage ./fuseki-test.nix { };
|
||||
};
|
||||
};
|
||||
meta = with lib; {
|
||||
description = "SPARQL server";
|
||||
license = licenses.asl20;
|
||||
|
18
pkgs/servers/nosql/apache-jena/fuseki-test.nix
Normal file
18
pkgs/servers/nosql/apache-jena/fuseki-test.nix
Normal file
@ -0,0 +1,18 @@
|
||||
{ lib, runCommandNoCC, apache-jena-fuseki, curl }:
|
||||
runCommandNoCC "fuseki-test-${apache-jena-fuseki.name}"
|
||||
{ nativeBuildInputs = [ curl apache-jena-fuseki ]; } ''
|
||||
export FUSEKI_BASE="$PWD/fuseki-base"
|
||||
mkdir -p "$FUSEKI_BASE/db"
|
||||
FUSEKI_ARGS="--update --loc=$FUSEKI_BASE/db /dataset" fuseki start
|
||||
fuseki status
|
||||
for i in $(seq 120); do
|
||||
if curl http://127.0.0.1:3030/dataset/data; then
|
||||
break;
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
curl -d 'update=insert+data+{+<test://subject>+<test://predicate>+<test://object>+}' http://127.0.0.1:3030/dataset/update > /dev/null
|
||||
curl http://127.0.0.1:3030/dataset/data | grep -C999 'test://predicate'
|
||||
curl -d 'query=select+?s+?p+?o+where+{+?s+?p+?o+.+}' http://127.0.0.1:3030/dataset/query | grep -C999 'test://predicate'
|
||||
touch $out
|
||||
''
|
Loading…
Reference in New Issue
Block a user