about summary refs log tree commit diff
path: root/nixpkgs/pkgs/desktops/deepin/go-gir-generator/default.nix
blob: 0c282aaa227666441f330933715246bf98705eb0 (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
{ stdenv
, fetchpatch
, fetchFromGitHub
, pkgconfig
, go
, gobject-introspection
, libgudev
, deepin
}:

stdenv.mkDerivation rec {
  pname = "go-gir-generator";
  version = "2.0.2";

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

  patches = [
    # Fix compatibility with glib 2.63+
    # https://github.com/linuxdeepin/go-gir-generator/pull/11
    (fetchpatch {
      url = "https://github.com/linuxdeepin/go-gir-generator/commit/7dea15a1a491f28d2ac8c411068ccefeba01aae3.patch";
      sha256 = "7bn/mtruCcK+AIXMzhN2e3o7CuzuJ3mtTz0HOTEYTaA=";
    })
  ];

  nativeBuildInputs = [
    pkgconfig
    go
  ];

  buildInputs = [
    gobject-introspection
    libgudev
  ];

  postPatch = ''
    sed -i -e 's:/share/gocode:/share/go:' Makefile
  '';

  makeFlags = [
    "PREFIX=${placeholder "out"}"
    "GOCACHE=$(TMPDIR)/go-cache"
  ];

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

  meta = with stdenv.lib; {
    description = "Generate static golang bindings for GObject";
    homepage = "https://github.com/linuxdeepin/go-gir-generator";
    license = licenses.gpl3;
    platforms = platforms.linux;
    maintainers = with maintainers; [ romildo ];
  };
}