2021-12-06 16:07:01 +00:00
|
|
|
{ lib, stdenv, fetchurl, unzip, jre, coreutils, makeDesktopItem, copyDesktopItems }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "basex";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "10.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2020-10-11 12:50:04 +00:00
|
|
|
url = "http://files.basex.org/releases/${version}/BaseX${builtins.replaceStrings ["."] [""] version}.zip";
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-Jr73UoyJfhtXLnYgOPh+jqKc3XZs+WMwJaO5nuD+Vmw=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
nativeBuildInputs = [ unzip copyDesktopItems ];
|
2021-03-19 17:17:44 +00:00
|
|
|
buildInputs = [ jre ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
desktopItems = lib.optional (!stdenv.isDarwin) (makeDesktopItem {
|
2020-04-24 23:36:52 +00:00
|
|
|
name = "basex";
|
|
|
|
exec = "basexgui %f";
|
2021-09-18 10:52:07 +00:00
|
|
|
icon = "${./basex.svg}"; # icon copied from Ubuntu basex package
|
2020-04-24 23:36:52 +00:00
|
|
|
comment = "Visually query and analyse your XML data";
|
|
|
|
desktopName = "BaseX XML Database";
|
|
|
|
genericName = "XML database tool";
|
2022-03-05 16:20:37 +00:00
|
|
|
categories = [ "Development" "Utility" "Database" ];
|
|
|
|
mimeTypes = [ "text/xml" ];
|
2021-12-06 16:07:01 +00:00
|
|
|
});
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
2021-12-06 16:07:01 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# Remove Windows batch files (unclutter $out/bin)
|
2020-10-11 12:50:04 +00:00
|
|
|
rm ./bin/*.bat
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
mkdir -p "$out/share/basex"
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-10-11 12:50:04 +00:00
|
|
|
cp -R bin etc lib webapp src BaseX.jar "$out"
|
|
|
|
cp -R readme.txt webapp "$out/share/basex"
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# 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
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
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.
|
|
|
|
'';
|
2020-10-07 09:15:18 +00:00
|
|
|
homepage = "https://basex.org/";
|
2022-06-16 17:23:12 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryBytecode ];
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.bsd3;
|
2021-12-06 16:07:01 +00:00
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = [ maintainers.bjornfor ];
|
|
|
|
};
|
|
|
|
}
|