summary refs log tree commit diff
path: root/pkgs/desktops/deepin/deepin-wallpapers/default.nix
blob: 82f7214471fb863c5de43ae7133beeba02d1b17b (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
{ stdenv, fetchFromGitHub, dde-api, deepin }:

stdenv.mkDerivation rec {
  pname = "deepin-wallpapers";
  version = "1.7.7";

  src = fetchFromGitHub {
    owner = "linuxdeepin";
    repo = "deepin-wallpapers";
    rev = version;
    sha256 = "09cfnxbpms98ibqbi4xd51181q3az5n8rmndcdr9w12kyzniz7xv";
  };

  nativeBuildInputs = [ dde-api deepin.setupHook ];

  postPatch = ''
    searchHardCodedPaths # debugging

    sed -i -e "s:/usr/lib/deepin-api:${dde-api}/lib/deepin-api:" Makefile
    sed -i -e "s:/usr/share/wallpapers:$out/share/wallpapers:" Makefile
  '';

  installPhase = ''
    mkdir -p $out/share/wallpapers/deepin
    cp -a deepin/* deepin-community/* deepin-private/* $out/share/wallpapers/deepin
    mkdir -p $out/var/cache
    cp -a image-blur $out/var/cache
    
    # Suggested by upstream
    mkdir -p $out/share/backgrounds/deepin
    ln -s ../../wallpapers/deepin/Hummingbird_by_Shu_Le.jpg $out/share/backgrounds/deepin/desktop.jpg
    ln -s $(echo -n $out/share/wallpapers/deepin/Hummingbird_by_Shu_Le.jpg | md5sum | cut -d " " -f 1).jpg \
      $out/var/cache/image-blur/$(echo -n $out/share/backgrounds/deepin/desktop.jpg | md5sum | cut -d " " -f 1).jpg
  '';

  passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };

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