2020-02-22 16:58:17 +00:00
|
|
|
{ stdenv
|
|
|
|
, fetchurl
|
|
|
|
, pkgconfig
|
|
|
|
, file
|
|
|
|
, glib
|
2020-02-22 17:04:56 +00:00
|
|
|
# always required runtime dependencies
|
2020-02-22 16:58:17 +00:00
|
|
|
, dbus
|
2020-02-22 17:04:56 +00:00
|
|
|
, libmnl
|
2020-02-22 16:58:17 +00:00
|
|
|
, gnutls
|
2020-02-22 17:02:43 +00:00
|
|
|
, readline
|
2020-02-22 17:04:56 +00:00
|
|
|
# Choices one has to decide
|
|
|
|
, firewallType ? "iptables" # or "nftables"
|
|
|
|
, iptables ? null
|
|
|
|
, libnftnl ? null # for nftables
|
|
|
|
, dnsType ? "internal" # or "systemd-resolved"
|
|
|
|
# optional features which are turned *on* by default
|
|
|
|
, enableOpenconnect ? true
|
|
|
|
, openconnect ? null
|
|
|
|
, enableOpenvpn ? true
|
|
|
|
, openvpn ? null
|
|
|
|
, enableVpnc ? true
|
|
|
|
, vpnc ? true
|
|
|
|
, enablePolkit ? true
|
|
|
|
, polkit ? null
|
|
|
|
, enablePptp ? true
|
|
|
|
, pptp ? null
|
|
|
|
, ppp ? null
|
|
|
|
, enableLoopback ? true
|
|
|
|
, enableEthernet ? true
|
|
|
|
, enableWireguard ? true
|
|
|
|
, enableGadget ? true
|
|
|
|
, enableWifi ? true
|
|
|
|
, enableBluetooth ? true
|
|
|
|
, enableOfono ? true
|
|
|
|
, enableDundee ? true
|
|
|
|
, enablePacrunner ? true
|
|
|
|
, enableNeard ? true
|
|
|
|
, enableWispr ? true
|
|
|
|
, enableTools ? true
|
|
|
|
, enableStats ? true
|
|
|
|
, enableClient ? true
|
|
|
|
, enableDatafiles ? true
|
|
|
|
# optional features which are turned *off* by default
|
|
|
|
, enableNetworkManager ? false
|
|
|
|
, networkmanager ? null
|
|
|
|
, enableHh2serialGps ? false
|
|
|
|
, enableL2tp ? false
|
|
|
|
, enableIospm ? false
|
|
|
|
, enableTist ? false
|
2020-02-22 16:58:17 +00:00
|
|
|
}:
|
2014-01-04 00:13:26 +00:00
|
|
|
|
2020-02-22 17:04:56 +00:00
|
|
|
assert stdenv.lib.asserts.assertOneOf "firewallType" firewallType [ "iptables" "nftables" ];
|
|
|
|
assert stdenv.lib.asserts.assertOneOf "dnsType" dnsType [ "internal" "systemd-resolved" ];
|
|
|
|
|
2014-12-08 11:47:00 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "connman";
|
2020-02-22 16:58:25 +00:00
|
|
|
version = "1.38";
|
2016-05-03 18:03:14 +00:00
|
|
|
src = fetchurl {
|
2019-08-15 12:41:18 +00:00
|
|
|
url = "mirror://kernel/linux/network/connman/${pname}-${version}.tar.xz";
|
2020-02-22 16:58:25 +00:00
|
|
|
sha256 = "0awkqigvhwwxiapw0x6yd4whl465ka8a4al0v2pcqy9ggjlsqc6b";
|
2014-01-04 00:13:26 +00:00
|
|
|
};
|
|
|
|
|
2020-02-22 16:58:17 +00:00
|
|
|
buildInputs = [
|
|
|
|
glib
|
|
|
|
dbus
|
2020-02-22 17:03:52 +00:00
|
|
|
libmnl
|
2020-02-22 16:58:17 +00:00
|
|
|
gnutls
|
2020-02-22 17:02:43 +00:00
|
|
|
readline
|
2020-02-22 16:58:17 +00:00
|
|
|
];
|
2016-05-03 18:03:14 +00:00
|
|
|
|
2020-02-22 16:58:17 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pkgconfig
|
|
|
|
file
|
2020-02-22 17:04:56 +00:00
|
|
|
]
|
|
|
|
++ stdenv.lib.optionals (enableOpenvpn) [ openvpn ]
|
|
|
|
++ stdenv.lib.optionals (enableOpenconnect) [ openconnect ]
|
|
|
|
++ stdenv.lib.optionals (enableVpnc) [ vpnc ]
|
|
|
|
++ stdenv.lib.optionals (enablePolkit) [ polkit ]
|
|
|
|
++ stdenv.lib.optionals (enablePptp) [ pptp ppp ]
|
|
|
|
++ stdenv.lib.optionals (firewallType == "iptables") [ iptables ]
|
|
|
|
++ stdenv.lib.optionals (firewallType == "nftables") [ libnftnl ]
|
|
|
|
;
|
2014-01-04 00:13:26 +00:00
|
|
|
|
2020-02-22 17:04:56 +00:00
|
|
|
# Fix file program not found
|
2014-01-04 00:13:26 +00:00
|
|
|
preConfigure = ''
|
|
|
|
sed -i "s/\/usr\/bin\/file/file/g" ./configure
|
|
|
|
'';
|
|
|
|
|
|
|
|
configureFlags = [
|
2020-02-22 17:04:56 +00:00
|
|
|
# directories flags
|
2020-02-22 17:01:35 +00:00
|
|
|
"--sysconfdir=${placeholder "out"}/etc"
|
2014-01-04 00:13:26 +00:00
|
|
|
"--localstatedir=/var"
|
2019-09-16 16:43:21 +00:00
|
|
|
"--with-dbusconfdir=${placeholder "out"}/share"
|
|
|
|
"--with-dbusdatadir=${placeholder "out"}/share"
|
2020-02-22 17:04:56 +00:00
|
|
|
"--with-tmpfilesdir=${placeholder "out"}/lib/tmpfiles.d"
|
|
|
|
"--with-systemdunitdir=${placeholder "out"}/lib/systemd/system"
|
|
|
|
"--with-dns-backend=${dnsType}"
|
|
|
|
"--with-firewall=${firewallType}"
|
|
|
|
# production build flags
|
2014-01-04 00:13:26 +00:00
|
|
|
"--disable-maintainer-mode"
|
|
|
|
"--enable-session-policy-local=builtin"
|
2020-02-22 17:04:56 +00:00
|
|
|
# This is for building and running tests (probably enabled by default),
|
|
|
|
# --enable-tests installs the tests as well
|
2014-01-04 00:13:26 +00:00
|
|
|
"--enable-tools"
|
2020-02-22 17:04:56 +00:00
|
|
|
]
|
|
|
|
++ stdenv.lib.optionals (!enableLoopback) [ "--disable-loopback" ]
|
|
|
|
++ stdenv.lib.optionals (!enableEthernet) [ "--disable-ethernet" ]
|
|
|
|
++ stdenv.lib.optionals (!enableWireguard) [ "--disable-wireguard" ]
|
|
|
|
++ stdenv.lib.optionals (!enableGadget) [ "--disable-gadget" ]
|
|
|
|
++ stdenv.lib.optionals (!enableWifi) [ "--disable-wifi" ]
|
|
|
|
# We (almost) always turn on IWD support as it doesn't require any new dependencies
|
|
|
|
# and it's easier for the NixOS module to use only 1 connmand package when
|
|
|
|
# IWD is requested
|
|
|
|
++ stdenv.lib.optionals (enableWifi) [ "--enable-iwd" ]
|
|
|
|
++ stdenv.lib.optionals (!enableBluetooth) [ "--disable-bluetooth" ]
|
|
|
|
++ stdenv.lib.optionals (!enableOfono) [ "--disable-ofono" ]
|
|
|
|
++ stdenv.lib.optionals (!enableDundee) [ "--disable-dundee" ]
|
|
|
|
++ stdenv.lib.optionals (!enablePacrunner) [ "--disable-pacrunner" ]
|
|
|
|
++ stdenv.lib.optionals (!enableNeard) [ "--disable-neard" ]
|
|
|
|
++ stdenv.lib.optionals (!enableWispr) [ "--disable-wispr" ]
|
|
|
|
++ stdenv.lib.optionals (!enableTools) [ "--disable-tools" ]
|
|
|
|
++ stdenv.lib.optionals (!enableStats) [ "--disable-stats" ]
|
|
|
|
++ stdenv.lib.optionals (!enableClient) [ "--disable-client" ]
|
|
|
|
++ stdenv.lib.optionals (!enableDatafiles) [ "--disable-datafiles" ]
|
|
|
|
++ stdenv.lib.optionals (enableOpenconnect) [
|
|
|
|
"--enable-openconnect=builtin"
|
|
|
|
"--with-openconnect=${openconnect}/sbin/openconnect"
|
|
|
|
]
|
|
|
|
++ stdenv.lib.optionals (enableOpenvpn) [
|
|
|
|
"--enable-openvpn=builtin"
|
|
|
|
"--with-openvpn=${openvpn}/sbin/openvpn"
|
|
|
|
]
|
|
|
|
++ stdenv.lib.optionals (enableVpnc) [
|
|
|
|
"--enable-vpnc=builtin"
|
|
|
|
"--with-vpnc=${vpnc}/sbin/vpnc"
|
|
|
|
]
|
|
|
|
++ stdenv.lib.optionals (enablePolkit) [
|
|
|
|
"--enable-polkit"
|
|
|
|
]
|
|
|
|
++ stdenv.lib.optionals (enablePptp) [
|
|
|
|
"--enable-pptp"
|
|
|
|
"--with-pptp=${pptp}/sbin/pptp"
|
|
|
|
]
|
|
|
|
++ stdenv.lib.optionals (!enableWireguard) [
|
|
|
|
"--disable-wireguard"
|
|
|
|
]
|
|
|
|
++ stdenv.lib.optionals (enableNetworkManager) [
|
|
|
|
"--enable-nmcompat"
|
|
|
|
]
|
|
|
|
++ stdenv.lib.optionals (enableHh2serialGps) [
|
|
|
|
"--enable-hh2serial-gps"
|
|
|
|
]
|
|
|
|
++ stdenv.lib.optionals (enableL2tp) [
|
|
|
|
"--enable-l2tp"
|
|
|
|
]
|
|
|
|
++ stdenv.lib.optionals (enableIospm) [
|
|
|
|
"--enable-iospm"
|
|
|
|
]
|
|
|
|
++ stdenv.lib.optionals (enableTist) [
|
|
|
|
"--enable-tist"
|
|
|
|
]
|
|
|
|
;
|
2020-02-22 17:03:52 +00:00
|
|
|
|
2020-02-22 17:04:56 +00:00
|
|
|
doCheck = true;
|
2014-01-04 00:13:26 +00:00
|
|
|
|
2016-01-02 07:56:22 +00:00
|
|
|
meta = with stdenv.lib; {
|
2016-09-22 20:55:15 +00:00
|
|
|
description = "A daemon for managing internet connections";
|
2020-02-22 17:01:44 +00:00
|
|
|
homepage = "https://01.org/connman";
|
2016-01-02 07:56:22 +00:00
|
|
|
maintainers = [ maintainers.matejc ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.gpl2;
|
2014-01-04 00:13:26 +00:00
|
|
|
};
|
|
|
|
}
|