From 90af6344ab0c62ff654ed4c64ad87e53a382e439 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Sun, 16 Jan 2022 18:35:27 +0100 Subject: [PATCH] apache-jena: refactor, apache-jena-fuseki: refactor --- pkgs/servers/nosql/apache-jena/binary.nix | 33 +++++++------------ .../nosql/apache-jena/fuseki-binary.nix | 32 +++++++----------- 2 files changed, 22 insertions(+), 43 deletions(-) diff --git a/pkgs/servers/nosql/apache-jena/binary.nix b/pkgs/servers/nosql/apache-jena/binary.nix index 099920b28418..32bc4449e12f 100644 --- a/pkgs/servers/nosql/apache-jena/binary.nix +++ b/pkgs/servers/nosql/apache-jena/binary.nix @@ -1,38 +1,27 @@ -{lib, stdenv, fetchurl, java, makeWrapper}: -let - s = # Generated upstream information - rec { - baseName="apache-jena"; - version = "4.3.2"; - name="${baseName}-${version}"; - url="https://dlcdn.apache.org/jena/binaries/apache-jena-${version}.tar.gz"; +{ lib, stdenv, fetchurl, java, makeWrapper }: + +stdenv.mkDerivation rec { + pname = "apache-jena"; + version = "4.3.2"; + src = fetchurl { + url = "https://dlcdn.apache.org/jena/binaries/apache-jena-${version}.tar.gz"; sha256 = "sha256-+GNxf79RkmHUXI99e3BZIyboiEj8TiVfVtlgQADku+Y="; }; buildInputs = [ makeWrapper ]; -in -stdenv.mkDerivation { - inherit (s) name version; - inherit buildInputs; - src = fetchurl { - inherit (s) url sha256; - }; installPhase = '' cp -r . "$out" for i in "$out"/bin/*; do wrapProgram "$i" --prefix "PATH" : "${java}/bin/" done ''; - meta = { - inherit (s) version; + meta = with lib; { description = "RDF database"; - license = lib.licenses.asl20; - maintainers = [lib.maintainers.raskin]; - platforms = lib.platforms.linux; + license = licenses.asl20; + maintainers = with maintainers; [ raskin ]; + platforms = platforms.linux; homepage = "https://jena.apache.org"; downloadPage = "https://archive.apache.org/dist/jena/binaries/"; - updateWalker = true; - downloadURLRegexp = "apache-jena-.*[.]tar[.]gz\$"; }; } diff --git a/pkgs/servers/nosql/apache-jena/fuseki-binary.nix b/pkgs/servers/nosql/apache-jena/fuseki-binary.nix index 65a9dff34178..d7c53bc7aa83 100644 --- a/pkgs/servers/nosql/apache-jena/fuseki-binary.nix +++ b/pkgs/servers/nosql/apache-jena/fuseki-binary.nix @@ -1,23 +1,15 @@ -{lib, stdenv, fetchurl, java, makeWrapper}: -let - s = # Generated upstream information - rec { - baseName="apache-jena-fuseki"; - version = "4.3.1"; - name="${baseName}-${version}"; - url="https://dlcdn.apache.org/jena/binaries/apache-jena-fuseki-${version}.tar.gz"; +{ lib, stdenv, fetchurl, java, makeWrapper }: + +stdenv.mkDerivation rec { + pname = "apache-jena-fuseki"; + version = "4.3.1"; + src = fetchurl { + url = "https://dlcdn.apache.org/jena/binaries/apache-jena-fuseki-${version}.tar.gz"; sha256 = "1r0vfa7d55lzw22yfx46mxxmz8x8pkr666vggqw2m1rzzj52z9nx"; }; buildInputs = [ makeWrapper ]; -in -stdenv.mkDerivation { - inherit (s) name version; - inherit buildInputs; - src = fetchurl { - inherit (s) url sha256; - }; installPhase = '' cp -r . "$out" chmod +x $out/fuseki @@ -29,14 +21,12 @@ stdenv.mkDerivation { ; done ''; - meta = { - inherit (s) version; + meta = with lib; { description = "SPARQL server"; - license = lib.licenses.asl20; - maintainers = [lib.maintainers.raskin]; - platforms = lib.platforms.linux; + license = licenses.asl20; + maintainers = with maintainers; [ raskin ]; + platforms = platforms.linux; homepage = "https://jena.apache.org"; downloadPage = "https://archive.apache.org/dist/jena/binaries/"; - downloadURLRegexp = "apache-jena-fuseki-.*[.]tar[.]gz\$"; }; }