summary refs log tree commit diff
path: root/pkgs/desktops/deepin/go-package/deepin-desktop-schemas/default.nix
blob: 274c81bfce96b3b8f066a8731f1eff55bee70836 (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
{ stdenv
, lib
, fetchFromGitHub
, buildGoPackage
, go-lib
, glib
}:
buildGoPackage rec {
  pname = "deepin-desktop-schemas";
  version = "5.10.11";

  goPackagePath = "github.com/linuxdeepin/deepin-desktop-schemas";

  src = fetchFromGitHub {
    owner = "linuxdeepin";
    repo = pname;
    rev = version;
    sha256 = "sha256-MboNj0zC3azavDUsmeNNafCcUa0GeoySl610+WOtNww=";
  };

  nativeBuildInputs = [ glib ];
  buildInputs = [ go-lib ];

  postPatch = ''
    # Relocate files path for backgrounds and wallpapers
    for file in $(grep -rl "/usr/share")
    do
      substituteInPlace $file \
        --replace "/usr/share" "/run/current-system/sw/share"
    done
  '';

  buildPhase = ''
    runHook preBuild
    addToSearchPath GOPATH "${go-lib}/share/gocode"
    make ARCH=${stdenv.targetPlatform.linuxArch} -C go/src/${goPackagePath}
    runHook postBuild
  '';

  installPhase = ''
    runHook preInstall
    make install DESTDIR="$out" PREFIX="/" -C go/src/${goPackagePath}
    runHook postInstall
  '';

  preFixup = ''
    glib-compile-schemas ${glib.makeSchemaPath "$out" "${pname}-${version}"}
  '';

  meta = with lib; {
    description = "GSettings deepin desktop-wide schemas";
    homepage = "https://github.com/linuxdeepin/deepin-desktop-schemas";
    license = licenses.gpl3Plus;
    platforms = platforms.linux;
    maintainers = teams.deepin.members;
  };
}