aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/desktops/deepin/deepin-icon-theme/default.nix
blob: b56b219faffafc1721e494a90d58a18994c445e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{ stdenv
, fetchFromGitHub
, gtk3
, xcursorgen
, papirus-icon-theme
, hicolor-icon-theme
, deepin
}:

stdenv.mkDerivation rec {
  pname = "deepin-icon-theme";
  version = "2020.05.21";

  src = fetchFromGitHub {
    owner = "linuxdeepin";
    repo = pname;
    rev = version;
    sha256 = "0b1s6kf0q804zbbghly981wzacy1spi8168shf3x8w95rqj6463p";
  };

  nativeBuildInputs = [
    gtk3
    xcursorgen
  ];

  propagatedBuildInputs = [
    papirus-icon-theme
    hicolor-icon-theme
  ];

  dontDropIconThemeCache = true;

  buildTargets = "all hicolor-links";

  postPatch = ''
    # fix: hicolor links should follow the deepin -> bloom naming change
    # https://github.com/linuxdeepin/deepin-icon-theme/pull/24
    substituteInPlace tools/hicolor.links --replace deepin bloom

    substituteInPlace Sea/index.theme --replace Inherits=deepin Inherits=bloom
  '';

  installPhase = ''
    runHook preInstall

    mkdir -p $out/share/icons
    cp -vai bloom* Sea $out/share/icons

    for theme in $out/share/icons/*; do
      gtk-update-icon-cache $theme
    done

    cp -vai usr/share/icons/hicolor $out/share/icons

    runHook postInstall
  '';

  passthru.updateScript = deepin.updateScript { inherit pname version src; };

  meta = with stdenv.lib; {
    description = "Icons for the Deepin Desktop Environment";
    homepage = "https://github.com/linuxdeepin/deepin-icon-theme";
    license = licenses.gpl3;
    platforms = platforms.unix;
    maintainers = with maintainers; [ romildo ];
  };
}