2020-08-16 14:18:25 +01:00
|
|
|
{ stdenv
|
|
|
|
, fetchurl
|
|
|
|
, lib
|
|
|
|
, unzip
|
|
|
|
, makeWrapper
|
|
|
|
, openjdk11
|
|
|
|
, makeDesktopItem
|
|
|
|
, icoutils
|
|
|
|
, config
|
|
|
|
, acceptLicense ? config.xxe-pe.acceptLicense or false
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
pkg_path = "$out/lib/xxe";
|
|
|
|
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "XMLmind XML Editor Personal Edition";
|
|
|
|
exec = "xxe";
|
|
|
|
icon = "xxe";
|
|
|
|
desktopName = "xxe";
|
|
|
|
genericName = "XML Editor";
|
2022-02-22 14:56:15 +00:00
|
|
|
categories = [ "Development" "IDE" "TextEditor" "Java" ];
|
2020-08-16 14:18:25 +01:00
|
|
|
};
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "xxe-pe";
|
2022-05-03 21:42:27 +01:00
|
|
|
version = "10.1.0";
|
2020-08-16 14:18:25 +01:00
|
|
|
|
|
|
|
src =
|
|
|
|
assert !acceptLicense -> throw ''
|
|
|
|
You must accept the XMLmind XML Editor Personal Edition License at
|
|
|
|
https://www.xmlmind.com/xmleditor/license_xxe_perso.html
|
|
|
|
by setting nixpkgs config option `xxe-pe.acceptLicense = true;`
|
|
|
|
or by using `xxe-pe.override { acceptLicense = true; }` package.
|
|
|
|
'';
|
|
|
|
fetchurl {
|
|
|
|
url = "https://www.xmlmind.com/xmleditor/_download/xxe-perso-${builtins.replaceStrings [ "." ] [ "_" ] version}.zip";
|
2022-05-03 21:42:27 +01:00
|
|
|
sha256 = "sha256-AeyaJSEJQQJ/XxvaIky4fnEr+7fVAEqhSxtYhN8L2JA=";
|
2020-08-16 14:18:25 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
unzip
|
|
|
|
makeWrapper
|
|
|
|
icoutils
|
|
|
|
];
|
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p "${pkg_path}"
|
|
|
|
mkdir -p "${pkg_path}" "$out/share/applications"
|
|
|
|
cp -a * "${pkg_path}"
|
|
|
|
ln -s ${desktopItem}/share/applications/* $out/share/applications
|
|
|
|
|
|
|
|
icotool -x "${pkg_path}/bin/icon/xxe.ico"
|
|
|
|
ls
|
|
|
|
for f in xxe_*.png; do
|
|
|
|
res=$(basename "$f" ".png" | cut -d"_" -f3 | cut -d"x" -f1-2)
|
|
|
|
mkdir -pv "$out/share/icons/hicolor/$res/apps"
|
|
|
|
mv "$f" "$out/share/icons/hicolor/$res/apps/xxe.png"
|
|
|
|
done;
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
mkdir -p "$out/bin"
|
|
|
|
makeWrapper "${pkg_path}/bin/xxe" "$out/bin/xxe" \
|
|
|
|
--prefix PATH : ${lib.makeBinPath [ openjdk11 ]}
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Strictly validating, near WYSIWYG, XML editor with DocBook support";
|
|
|
|
homepage = "https://www.xmlmind.com/xmleditor/";
|
|
|
|
license = licenses.unfree;
|
|
|
|
maintainers = [ maintainers.jtojnar ];
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|