From 05264034618371be98cb333f9e28cd8922100dd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Sat, 31 Aug 2013 14:27:40 +0200 Subject: [PATCH] basex: new package BaseX is a very fast and light-weight, yet powerful XML database and XPath/XQuery processor, including support for the latest W3C Full Text and Update Recommendations. It supports large XML instances and offers a highly interactive front-end (basexgui). Apart from two local standalone modes, BaseX offers a client/server architecture. Homepage: http://basex.org/ Implementation notes: - I'm using the pre-built java package (because it's simple) - I copied the basex.svg icon file from the Ubuntu package because I couldn't find it anywhere else. It's 9.3 KiB. --- pkgs/tools/text/xml/basex/basex.svg | 81 +++++++++++++++++++++++++++ pkgs/tools/text/xml/basex/default.nix | 73 ++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 3 files changed, 156 insertions(+) create mode 100644 pkgs/tools/text/xml/basex/basex.svg create mode 100644 pkgs/tools/text/xml/basex/default.nix diff --git a/pkgs/tools/text/xml/basex/basex.svg b/pkgs/tools/text/xml/basex/basex.svg new file mode 100644 index 000000000000..9d476cec2ca1 --- /dev/null +++ b/pkgs/tools/text/xml/basex/basex.svg @@ -0,0 +1,81 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/pkgs/tools/text/xml/basex/default.nix b/pkgs/tools/text/xml/basex/default.nix new file mode 100644 index 000000000000..4f120601c8e7 --- /dev/null +++ b/pkgs/tools/text/xml/basex/default.nix @@ -0,0 +1,73 @@ +{ stdenv, fetchurl, unzip, jre, coreutils, makeDesktopItem }: + +stdenv.mkDerivation rec { + name = "basex-7.7"; + + src = fetchurl { + url = "http://files.basex.org/releases/7.7/BaseX77.zip"; + sha256 = "1wnndq8lcnfx29bc3j2sgswk6dxgv2nln2chmwbf7h4a05fcavdj"; + }; + + buildInputs = [ unzip jre ]; + + desktopItem = makeDesktopItem { + name = "basex"; + exec = "basexgui %f"; + icon = "${./basex.svg}"; # icon copied from Ubuntu basex package + comment = "Visually query and analyse your XML data"; + desktopName = "BaseX XML Database"; + genericName = "XML database tool"; + categories = "Development;Utility;Database"; + mimeType = "text/xml"; + }; + + # We're using a pre-built package + configurePhase = "true"; + buildPhase = "true"; + installPhase = '' + mkdir -p "$out" + cp -r * "$out" + + # Remove Windows batch files (unclutter $out/bin) + rm -f "$out"/bin/*.bat + + # Move some top-level stuff to $out/share/basex (unclutter $out) + mkdir -p "$out/share/basex" + mv "$out"/*.txt "$out/share/basex/" + mv "$out"/webapp "$out/share/basex/" + + # Remove empty directories + rmdir "$out/repo" + rmdir "$out/data" + + # Install desktop file + mkdir -p "$out/share/applications" + cp "$desktopItem"/share/applications/* "$out/share/applications/" + + # Use substitutions instead of wrapper scripts + for file in "$out"/bin/*; do + sed -i -e "s|/usr/bin/env bash|${stdenv.shell}|" \ + -e "s|java|${jre}/bin/java|" \ + -e "s|readlink|${coreutils}/bin/readlink|" \ + -e "s|dirname|${coreutils}/bin/dirname|" \ + -e "s|basename|${coreutils}/bin/basename|" \ + -e "s|echo|${coreutils}/bin/echo|" \ + "$file" + done + ''; + + meta = with stdenv.lib; { + description = "XML database and XPath/XQuery processor"; + longDescription = '' + BaseX is a very fast and light-weight, yet powerful XML database and + XPath/XQuery processor, including support for the latest W3C Full Text + and Update Recommendations. It supports large XML instances and offers a + highly interactive front-end (basexgui). Apart from two local standalone + modes, BaseX offers a client/server architecture. + ''; + homepage = http://basex.org/; + license = licenses.bsd3; + platforms = platforms.linux; + maintainers = [ maintainers.bjornfor ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 16ecbdef54cb..256a2b5cb4d7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -501,6 +501,8 @@ let azureus = callPackage ../tools/networking/p2p/azureus { }; + basex = callPackage ../tools/text/xml/basex { }; + babeld = callPackage ../tools/networking/babeld { }; banner = callPackage ../games/banner {};