nixpkgs/pkgs/development/libraries/glib-networking/default.nix
Väinö Järvelä 5291c2079b glib-networking: Disable ca-certificates on Darwin
macOS does not have certificates at /etc/ssl/certs. cacerts package
has been deprecated. And there is a long standing issue at
https://github.com/NixOS/nixpkgs/issues/8247 for figuring out how to
handle certificates.

Disabling glib-networking ca-certificates on Darwin removes constant
warnings when opening remote connections.
2018-02-24 07:53:35 +02:00

39 lines
1.1 KiB
Nix

{ stdenv, fetchurl, pkgconfig, glib, intltool, gnutls, libproxy
, gsettings_desktop_schemas }:
let
ver_maj = "2.54";
ver_min = "1";
in
stdenv.mkDerivation rec {
name = "glib-networking-${ver_maj}.${ver_min}";
src = fetchurl {
url = "mirror://gnome/sources/glib-networking/${ver_maj}/${name}.tar.xz";
sha256 = "0bq16m9nh3gcz9x2fvygr0iwxd2pxcbrm3lj3kihsnh1afv8g9za";
};
outputs = [ "out" "dev" ]; # to deal with propagatedBuildInputs
configureFlags = if stdenv.isDarwin then "--without-ca-certificates"
else "--with-ca-certificates=/etc/ssl/certs/ca-certificates.crt";
LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-lintl";
preBuild = ''
sed -e "s@${glib.out}/lib/gio/modules@$out/lib/gio/modules@g" -i $(find . -name Makefile)
'';
nativeBuildInputs = [ pkgconfig intltool ];
propagatedBuildInputs = [ glib gnutls libproxy gsettings_desktop_schemas ];
doCheck = false; # tests need to access the certificates (among other things)
meta = with stdenv.lib; {
description = "Network-related giomodules for glib";
license = licenses.lgpl2Plus;
platforms = platforms.unix;
};
}