nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 ant,
6 jdk,
7 jre,
8 makeWrapper,
9 copyDesktopItems,
10 stripJavaArchivesHook,
11}:
12
13stdenv.mkDerivation (finalAttrs: {
14 pname = "dayon";
15 version = "17.0.0";
16
17 src = fetchFromGitHub {
18 owner = "RetGal";
19 repo = "dayon";
20 rev = "v${finalAttrs.version}";
21 hash = "sha256-YGp27LYtiEHUkkHvAxm6M9ORPqOdpPcyDoRMqKGS8To=";
22 };
23
24 nativeBuildInputs = [
25 ant
26 jdk
27 makeWrapper
28 copyDesktopItems
29 stripJavaArchivesHook
30 ];
31
32 buildPhase = ''
33 runHook preBuild
34 ant
35 runHook postBuild
36 '';
37
38 installPhase = ''
39 runHook preInstall
40
41 install -Dm644 build/dayon.jar $out/share/dayon/dayon.jar
42 # jre is in PATH because dayon needs keytool to generate certificates
43 makeWrapper ${lib.getExe jre} $out/bin/dayon \
44 --prefix PATH : "${lib.makeBinPath [ jre ]}" \
45 --add-flags "-jar $out/share/dayon/dayon.jar"
46 makeWrapper ${lib.getExe jre} $out/bin/dayon_assisted \
47 --prefix PATH : "${lib.makeBinPath [ jre ]}" \
48 --add-flags "-cp $out/share/dayon/dayon.jar mpo.dayon.assisted.AssistedRunner"
49 makeWrapper ${lib.getExe jre} $out/bin/dayon_assistant \
50 --prefix PATH : "${lib.makeBinPath [ jre ]}" \
51 --add-flags "-cp $out/share/dayon/dayon.jar mpo.dayon.assistant.AssistantRunner"
52 install -Dm644 resources/dayon.png $out/share/icons/hicolor/128x128/apps/dayon.png
53
54 runHook postInstall
55 '';
56
57 desktopItems = [
58 "debian/dayon_assisted.desktop"
59 "debian/dayon_assistant.desktop"
60 ];
61
62 meta = {
63 description = "Easy to use, cross-platform remote desktop assistance solution";
64 homepage = "https://retgal.github.io/Dayon/index.html";
65 license = lib.licenses.gpl3Plus; # https://github.com/RetGal/Dayon/issues/59
66 mainProgram = "dayon";
67 maintainers = with lib.maintainers; [ fgaz ];
68 platforms = lib.platforms.all;
69 };
70})