summary refs log tree commit diff
path: root/pkgs/desktops/deepin/deepin-desktop-schemas/default.nix
blob: 15f9498cf0db5bbd43dcf60c458f5baa0dd803e8 (plain) (blame)
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
68
69
70
71
72
73
74
75
76
77
78
79
{ stdenv
, fetchFromGitHub
, python3
, dconf
, glib
, deepin-gtk-theme
, deepin-icon-theme
, deepin-sound-theme
, deepin-wallpapers
, deepin
}:

stdenv.mkDerivation rec {
  pname = "deepin-desktop-schemas";
  version = "3.13.9";

  src = fetchFromGitHub {
    owner = "linuxdeepin";
    repo = pname;
    rev = version;
    sha256 = "1c69j6s7561zb1hrd1j3ihji1nvpgfzfgnp6svsv8jd8dg8vs8l1";
  };

  nativeBuildInputs = [
    python3
    glib.dev
    deepin.setupHook
  ];

  buildInputs = [
    dconf
    deepin-gtk-theme
    deepin-icon-theme
    deepin-sound-theme
    deepin-wallpapers
  ];

  postPatch = ''
    searchHardCodedPaths

    # fix default background url
    sed -i -e 's,/usr/share/backgrounds/default_background.jpg,/usr/share/backgrounds/deepin/desktop.jpg,' \
      overrides/common/com.deepin.wrap.gnome.desktop.override

    fixPath ${deepin-wallpapers} /usr/share/backgrounds \
      overrides/common/com.deepin.wrap.gnome.desktop.override

    fixPath ${deepin-wallpapers} /usr/share/wallpapers/deepin \
      schemas/com.deepin.dde.appearance.gschema.xml

    # still hardcoded paths:
    #   /etc/gnome-settings-daemon/xrandr/monitors.xml                                ? gnome3.gnome-settings-daemon
    #   /usr/share/backgrounds/gnome/adwaita-lock.jpg                                 ? gnome3.gnome-backgrounds
    #   /usr/share/backgrounds/gnome/adwaita-timed.xml                                gnome3.gnome-backgrounds
    #   /usr/share/desktop-directories
  '';

  makeFlags = [
    "PREFIX=${placeholder "out"}"
  ];

  doCheck = true;
  checkTarget = "test";

  postInstall = ''
    glib-compile-schemas --strict $out/share/glib-2.0/schemas
    searchHardCodedPaths $out
  '';

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

  meta = with stdenv.lib; {
    description = "GSettings deepin desktop-wide schemas";
    homepage = "https://github.com/linuxdeepin/deepin-desktop-schemas";
    license = licenses.gpl3;
    platforms = platforms.linux;
    maintainers = with maintainers; [ romildo ];
  };
}