Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 stdenvNoCC,
4 fetchFromGitHub,
5 clickgen,
6 python3,
7 themeVariants ? [ ],
8 sizeVariants ? [ ],
9 platformVariants ? [ ],
10}:
11
12let
13 pname = "fuchsia-cursor";
14in
15lib.checkListOfEnum "${pname}: theme variants" [ "Fuchsia" "Fuchsia-Pop" "Fuchsia-Red" ]
16 themeVariants
17 lib.checkListOfEnum
18 "${pname}: size variants"
19 [ "16" "24" "32" "48" ]
20 sizeVariants
21 lib.checkListOfEnum
22 "${pname}: platform variants"
23 [ "x11" "windows" ]
24 platformVariants
25
26 stdenvNoCC.mkDerivation
27 rec {
28 inherit pname;
29 version = "2.0.0";
30
31 src = fetchFromGitHub {
32 owner = "ful1e5";
33 repo = "fuchsia-cursor";
34 rev = "v${version}";
35 hash = "sha256-WnDtUsjRXT7bMppgwU5BIDqphP69DmPzQM/0qXES5tM=";
36 };
37
38 nativeBuildInputs = [
39 clickgen
40 python3.pkgs.attrs
41 ];
42
43 installPhase = ''
44 runHook preInstall
45
46 ${
47 if themeVariants != [ ] then
48 ''
49 name= ctgen build.toml \
50 ${
51 lib.optionalString (themeVariants != [ ]) "-d bitmaps/"
52 + toString themeVariants
53 + " -n "
54 + toString themeVariants
55 } \
56 ${lib.optionalString (sizeVariants != [ ]) "-s " + toString sizeVariants} \
57 ${lib.optionalString (platformVariants != [ ]) "-p " + toString platformVariants} \
58 -o $out/share/icons
59 ''
60 else
61 ''
62 name= ctgen build.toml -d bitmaps/Fuchsia -n Fuchsia \
63 ${lib.optionalString (sizeVariants != [ ]) "-s " + toString sizeVariants} \
64 ${lib.optionalString (platformVariants != [ ]) "-p " + toString platformVariants} \
65 -o $out/share/icons
66 ''
67 }
68
69 runHook postInstall
70 '';
71
72 meta = with lib; {
73 description = "First OpenSource port of FuchsiaOS's cursors for Linux and Windows";
74 homepage = "https://github.com/ful1e5/fuchsia-cursor";
75 maintainers = with maintainers; [ d3vil0p3r ];
76 platforms = platforms.all;
77 license = licenses.gpl3Plus;
78 };
79 }