1{ stdenv, fetchurl, glib, libxml2, pkgconfig, gnome3
2, gnomeSupport ? true, sqlite, glib-networking, gobjectIntrospection
3, valaSupport ? true, vala_0_40
4, intltool, python3 }:
5
6stdenv.mkDerivation rec {
7 name = "${pname}-${version}";
8 pname = "libsoup";
9 version = "2.62.2";
10
11 src = fetchurl {
12 url = "mirror://gnome/sources/${pname}/${gnome3.versionBranch version}/${name}.tar.xz";
13 sha256 = "1dkrz1iwsswscayfmjxqv2q00b87snlq9nxdccn5vck0vbinylwy";
14 };
15
16 postPatch = ''
17 patchShebangs libsoup/
18 '' + stdenv.lib.optionalString valaSupport ''
19 substituteInPlace libsoup/Makefile.in --replace "\$(DESTDIR)\$(vapidir)" "\$(DESTDIR)\$(girdir)/../vala/vapi"
20 '';
21
22 outputs = [ "out" "dev" ];
23
24 buildInputs = [ python3 sqlite ];
25 nativeBuildInputs = [ pkgconfig intltool gobjectIntrospection ]
26 ++ stdenv.lib.optionals valaSupport [ vala_0_40 ];
27 propagatedBuildInputs = [ glib libxml2 ];
28
29 # glib-networking is a runtime dependency, not a compile-time dependency
30 configureFlags = [
31 "--disable-tls-check"
32 "--enable-vala=${if valaSupport then "yes" else "no"}"
33 "--with-gnome=${if gnomeSupport then "yes" else "no"}"
34 ];
35
36 doCheck = false; # fails with "no: command not found"
37
38 passthru = {
39 propagatedUserEnvPackages = [ glib-networking.out ];
40 updateScript = gnome3.updateScript {
41 packageName = pname;
42 };
43 };
44
45 meta = {
46 description = "HTTP client/server library for GNOME";
47 homepage = https://wiki.gnome.org/Projects/libsoup;
48 license = stdenv.lib.licenses.gpl2;
49 inherit (glib.meta) maintainers platforms;
50 };
51}