about summary refs log tree commit diff
path: root/pkgs/tools/text/xml
diff options
context:
space:
mode:
authorNikolay Korotkiy <sikmir@gmail.com>2021-11-12 16:17:56 +0300
committerBjørn Forsman <bjorn.forsman@gmail.com>2021-11-12 15:04:15 +0100
commitc6f83b3433c04c948d6990b02e0e2b32d89a48ef (patch)
tree3ccd1077aa0c8895851ef6db55fdc09a2d42038f /pkgs/tools/text/xml
parent6199892bef28e36ad9778eaaaf579980d0dce495 (diff)
basex: 9.4.3 → 9.6.3, enable on darwin
Diffstat (limited to 'pkgs/tools/text/xml')
-rw-r--r--pkgs/tools/text/xml/basex/default.nix23
1 files changed, 12 insertions, 11 deletions
diff --git a/pkgs/tools/text/xml/basex/default.nix b/pkgs/tools/text/xml/basex/default.nix
index 0e2c8b824f5e4..92fde60c23c00 100644
--- a/pkgs/tools/text/xml/basex/default.nix
+++ b/pkgs/tools/text/xml/basex/default.nix
@@ -1,18 +1,18 @@
-{ lib, stdenv, fetchurl, unzip, jre, coreutils, makeDesktopItem }:
+{ lib, stdenv, fetchurl, unzip, jre, coreutils, makeDesktopItem, copyDesktopItems }:
 
 stdenv.mkDerivation rec {
   pname = "basex";
-  version = "9.4.3";
+  version = "9.6.3";
 
   src = fetchurl {
     url = "http://files.basex.org/releases/${version}/BaseX${builtins.replaceStrings ["."] [""] version}.zip";
-    hash = "sha256-IZhRg2JcYQXQKU/lYZpLLcsSdjZZO+toY5yvk+RKUCY=";
+    hash = "sha256-OlIAyGUQKrl+Zu79p6cahHpx59zLozGkUDAEvykGN6Y=";
   };
 
-  nativeBuildInputs = [ unzip ];
+  nativeBuildInputs = [ unzip copyDesktopItems ];
   buildInputs = [ jre ];
 
-  desktopItem = makeDesktopItem {
+  desktopItems = lib.optional (!stdenv.isDarwin) (makeDesktopItem {
     name = "basex";
     exec = "basexgui %f";
     icon = "${./basex.svg}"; # icon copied from Ubuntu basex package
@@ -21,22 +21,21 @@ stdenv.mkDerivation rec {
     genericName = "XML database tool";
     categories = "Development;Utility;Database";
     mimeType = "text/xml";
-  };
+  });
 
   dontBuild = true;
 
   installPhase = ''
+    runHook preInstall
+
     # Remove Windows batch files (unclutter $out/bin)
     rm ./bin/*.bat
 
-    mkdir -p "$out/share/basex" "$out/share/applications"
+    mkdir -p "$out/share/basex"
 
     cp -R bin etc lib webapp src BaseX.jar "$out"
     cp -R readme.txt webapp "$out/share/basex"
 
-    # Install desktop file
-    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}|" \
@@ -47,6 +46,8 @@ stdenv.mkDerivation rec {
                -e "s|echo|${coreutils}/bin/echo|" \
             "$file"
     done
+
+    runHook postInstall
   '';
 
   meta = with lib; {
@@ -60,7 +61,7 @@ stdenv.mkDerivation rec {
     '';
     homepage = "https://basex.org/";
     license = licenses.bsd3;
-    platforms = platforms.linux;
+    platforms = platforms.unix;
     maintainers = [ maintainers.bjornfor ];
   };
 }