about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/libpeas/2.x.nix
blob: 2b3bd0bc57970f4d458605d999ab376d0af2b21f (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
80
81
82
83
84
85
86
{ stdenv
, lib
, fetchurl
, pkg-config
, gi-docgen
, gobject-introspection
, meson
, ninja
, gjs
, glib
, lua5_1
, python3
, spidermonkey_115
, gnome
}:

stdenv.mkDerivation rec {
  pname = "libpeas";
  version = "2.0.0";

  outputs = [ "out" "dev" "devdoc" ];

  src = fetchurl {
    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
    hash = "sha256-VAesvAwS95D3DJ0rmCJKzBvjrEScYGA7gZLKAgtJcBE=";
  };

  depsBuildBuild = [
    pkg-config
  ];

  nativeBuildInputs = [
    gi-docgen
    gobject-introspection
    meson
    ninja
    pkg-config
  ];

  buildInputs = [
    gjs
    glib
    lua5_1
    lua5_1.pkgs.lgi
    python3
    python3.pkgs.pygobject3
    spidermonkey_115
  ];

  propagatedBuildInputs = [
    # Required by libpeas-2.pc
    gobject-introspection
  ];

  mesonFlags = [
    "-Dgtk_doc=true"
  ];

  postPatch = ''
    # Checks lua51 and lua5.1 executable but we have non of them.
    substituteInPlace meson.build --replace \
      "find_program('lua51', required: false)" \
      "find_program('lua', required: false)"
  '';

  postFixup = ''
    # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back.
    moveToOutput "share/doc" "$devdoc"
  '';

  passthru = {
    updateScript = gnome.updateScript {
      attrPath = "libpeas2";
      packageName = "libpeas";
      versionPolicy = "odd-unstable";
    };
  };

  meta = with lib; {
    description = "A GObject-based plugins engine";
    homepage = "https://wiki.gnome.org/Projects/Libpeas";
    license = licenses.gpl2Plus;
    platforms = platforms.unix;
    maintainers = teams.gnome.members;
  };
}