biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / applications / editors / xxe-pe / default.nix
blob6df56b9773bd530f7ae048e7465875e64340a96e
1 { stdenv
2 , fetchurl
3 , lib
4 , unzip
5 , makeWrapper
6 , openjdk11
7 , makeDesktopItem
8 , icoutils
9 , config
10 , acceptLicense ? config.xxe-pe.acceptLicense or false
13 let
14   pkg_path = "$out/lib/xxe";
16   desktopItem = makeDesktopItem {
17     name = "XMLmind XML Editor Personal Edition";
18     exec = "xxe";
19     icon = "xxe";
20     desktopName = "xxe";
21     genericName = "XML Editor";
22     categories = [ "Development" "IDE" "TextEditor" "Java" ];
23   };
25 stdenv.mkDerivation rec {
26   pname = "xxe-pe";
27   version = "10.2.0";
29   src =
30     assert !acceptLicense -> throw ''
31       You must accept the XMLmind XML Editor Personal Edition License at
32       https://www.xmlmind.com/xmleditor/license_xxe_perso.html
33       by setting nixpkgs config option `xxe-pe.acceptLicense = true;`
34       or by using `xxe-pe.override { acceptLicense = true; }` package.
35     '';
36       fetchurl {
37         url = "https://www.xmlmind.com/xmleditor/_download/xxe-perso-${builtins.replaceStrings [ "." ] [ "_" ] version}.zip";
38         sha256 = "sha256-JZ9nQwMrQL/1HKGwvXoWlnTx55ZK/UYjMJAddCtm0rw=";
39       };
41   nativeBuildInputs = [
42     unzip
43     makeWrapper
44     icoutils
45   ];
47   dontStrip = true;
49   installPhase = ''
50     mkdir -p "${pkg_path}"
51     mkdir -p "${pkg_path}" "$out/share/applications"
52     cp -a * "${pkg_path}"
53     ln -s ${desktopItem}/share/applications/* $out/share/applications
55     icotool -x "${pkg_path}/bin/icon/xxe.ico"
56     ls
57     for f in xxe_*.png; do
58       res=$(basename "$f" ".png" | cut -d"_" -f3 | cut -d"x" -f1-2)
59       mkdir -pv "$out/share/icons/hicolor/$res/apps"
60       mv "$f" "$out/share/icons/hicolor/$res/apps/xxe.png"
61     done;
62   '';
64   postFixup = ''
65     mkdir -p "$out/bin"
66     makeWrapper "${pkg_path}/bin/xxe" "$out/bin/xxe" \
67       --prefix PATH : ${lib.makeBinPath [ openjdk11 ]}
68   '';
70   meta = with lib; {
71     description = "Strictly validating, near WYSIWYG, XML editor with DocBook support";
72     homepage = "https://www.xmlmind.com/xmleditor/";
73     license = licenses.unfree;
74     maintainers = [ ];
75     platforms = [ "x86_64-linux" ];
76   };