Merge pull request #329823 from ExpidusOS/fix/pkgsllvm/elfutils
[NixPkgs.git] / pkgs / by-name / or / oreo-cursors-plus / package.nix
blobd998718ad085cbdc91e7fe71148a275f0a3b37ab
2   lib,
3   stdenvNoCC,
4   fetchFromGitHub,
5   ruby,
6   inkscape,
7   xorg,
8   writeText,
9   cursorsConf ? null, # If set to a string, overwrites contents of './cursors.conf'
11 let
12   newCursorsConf = writeText "oreo-cursors-plus.conf" cursorsConf;
14 stdenvNoCC.mkDerivation {
15   pname = "oreo-cursors-plus";
16   version = "unstable-2023-06-05";
17   src = fetchFromGitHub {
18     owner = "Souravgoswami";
19     repo = "oreo-cursors";
20     # At the time of writing, there are no version tags. The author will add them starting with the next version release.
21     # Using the latest commit instead.
22     rev = "9133204d60ca2c54be0df03b836968a1deac6b20";
23     hash = "sha256-6oTyOQK7mkr+jWYbPNBlJ4BpT815lNJvsJjzdTmj+68=";
24   };
26   nativeBuildInputs = lib.optionals (cursorsConf != null) [ ruby inkscape xorg.xcursorgen ];
28   # './cursors.conf' contains definitions of cursor variations to generate.
29   configurePhase = ''
30     runHook preConfigure
32     ${lib.optionalString (cursorsConf != null) ''
33       cp ${newCursorsConf} cursors.conf
34     ''}
36     runHook postConfigure
37   '';
39   # The repo already contains the default cursors pre-generated in './dist'. Just copy these if './cursors.conf' is not overwritten.
40   # Otherwise firs remove all default variations and build.
41   buildPhase =''
42       runHook preBuild
44       ${lib.optionalString (cursorsConf != null) ''
45         rm -r {dist,src/oreo_*}
46         export HOME=$TMP
47         ruby generator/convert.rb
48         make build
49       ''}
51       runHook postBuild
52     '';
54   installPhase = ''
55       runHook preInstall
57       mkdir -p $out/share
58       mv ./dist $out/share/icons
60       runHook postInstall
61     '';
63   meta = {
64     description = "Colored Material cursors with cute animations";
65     homepage = "https://github.com/Souravgoswami/oreo-cursors";
66     license = lib.licenses.gpl2Only;
67     platforms = lib.platforms.all;
68     maintainers = with lib.maintainers; [michaelBrunner];
69   };