summary refs log tree commit diff
path: root/pkgs/development/libraries/libsoup/default.nix
blob: 2804486e2f0a51f0573ddcc80c4a5161f17d5b2c (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
{ stdenv, fetchurl, glib, libxml2, pkgconfig, gnome3
, gnomeSupport ? true, sqlite, glib-networking, gobjectIntrospection
, valaSupport ? true, vala_0_40
, intltool, python3 }:

stdenv.mkDerivation rec {
  name = "${pname}-${version}";
  pname = "libsoup";
  version = "2.62.2";

  src = fetchurl {
    url = "mirror://gnome/sources/${pname}/${gnome3.versionBranch version}/${name}.tar.xz";
    sha256 = "1dkrz1iwsswscayfmjxqv2q00b87snlq9nxdccn5vck0vbinylwy";
  };

  postPatch = ''
    patchShebangs libsoup/
  '' + stdenv.lib.optionalString valaSupport ''
     substituteInPlace libsoup/Makefile.in --replace "\$(DESTDIR)\$(vapidir)" "\$(DESTDIR)\$(girdir)/../vala/vapi"
  '';

  outputs = [ "out" "dev" ];

  buildInputs = [ python3 sqlite ];
  nativeBuildInputs = [ pkgconfig intltool gobjectIntrospection ]
    ++ stdenv.lib.optionals valaSupport [ vala_0_40 ];
  propagatedBuildInputs = [ glib libxml2 ];

  # glib-networking is a runtime dependency, not a compile-time dependency
  configureFlags = [
    "--disable-tls-check"
    "--enable-vala=${if valaSupport then "yes" else "no"}"
    "--with-gnome=${if gnomeSupport then "yes" else "no"}"
  ];

  doCheck = false; # fails with "no: command not found"

  passthru = {
    propagatedUserEnvPackages = [ glib-networking.out ];
    updateScript = gnome3.updateScript {
      packageName = pname;
    };
  };

  meta = {
    description = "HTTP client/server library for GNOME";
    homepage = https://wiki.gnome.org/Projects/libsoup;
    license = stdenv.lib.licenses.gpl2;
    inherit (glib.meta) maintainers platforms;
  };
}