1 { lib, stdenv, fetchzip, jdk11, makeWrapper }:
3 stdenv.mkDerivation rec {
8 url = "https://github.com/JanusGraph/janusgraph/releases/download/v${version}/janusgraph-${version}.zip";
9 sha256 = "sha256-X/ZHvmCJzo0X/sUpbm1CkQcnNi3NMNAaVXep6cpoIAA=";
12 nativeBuildInputs = [ makeWrapper ];
15 mkdir -p $out/bin $out/share/janusgraph
16 install -D $src/lib/*.jar $out/share/janusgraph
18 find conf scripts -type f -exec install -D {} $out/share/janusgraph/{} \;
20 JANUSGRAPH_LIB=$out/share/janusgraph
22 # Add the slf4j-log4j12 binding
23 classpath="$classpath":$(find -L $JANUSGRAPH_LIB -name 'slf4j-log4j12*.jar' | sort | tr '\n' ':')
24 # Add the jars in $JANUSGRAPH_LIB that start with "janusgraph"
25 classpath="$classpath":$(find -L $JANUSGRAPH_LIB -name 'janusgraph*.jar' | sort | tr '\n' ':')
26 # Add the remaining jars in $JANUSGRAPH_LIB.
27 classpath="$classpath":$(find -L $JANUSGRAPH_LIB -name '*.jar' \
28 \! -name 'janusgraph*' \
29 \! -name 'slf4j-log4j12*.jar' | sort | tr '\n' ':')
31 makeWrapper ${jdk11}/bin/java $out/bin/janusgraph-server \
32 --add-flags "-classpath $classpath org.janusgraph.graphdb.server.JanusGraphServer"
34 # temporary workaround for
35 # https://github.com/NixOS/nixpkgs/pull/244400#issuecomment-1667330430
40 description = "An open-source, distributed graph database";
41 homepage = "https://janusgraph.org/";
42 mainProgram = "janusgraph-server";
43 license = licenses.asl20;
44 platforms = platforms.unix;
45 maintainers = [ maintainers.ners ];