19 gobject-introspection,
25 enableSystemdResolved ? true,
28 stdenv.mkDerivation rec {
30 # also update openvpn3-core
33 src = fetchFromGitHub {
35 repo = "openvpn3-linux";
36 rev = "refs/tags/v${version}";
37 hash = "sha256-5gkutqyUPZDwRPzSFdUXg2G5mtQKbdhZu8xnNAdXoF0=";
38 # `openvpn3-core` is a submodule.
39 # TODO: make it into a separate package
40 fetchSubmodules = true;
44 # Merged in upstream, will land in v24
45 # https://github.com/OpenVPN/openvpn3-linux/commit/75abb7dc9366ba85fb1a144d88f02a1e8a62f538
46 ./0001-build-reduce-hardcode-in-asio_path.patch
47 ./0002-build-allow-installation-directories-customization.patch
51 echo '#define OPENVPN_VERSION "3.git:unknown:unknown"
52 #define PACKAGE_GUIVERSION "v${builtins.replaceStrings [ "_" ] [ ":" ] version}"
53 #define PACKAGE_NAME "openvpn3-linux"
54 ' > ./src/build-version.h
58 ./src/python/{openvpn2,openvpn3-as,openvpn3-autoload} \
59 ./distro/systemd/openvpn3-systemd \
60 ./src/tests/dbus/netcfg-subscription-test \
61 ./src/shell/bash-completion/gen-openvpn2-completion.py
64 pythonPath = python3.withPackages (ps: [
77 python3.pkgs.wrapPython
80 python3.pkgs.dbus-python
97 ] ++ lib.optionals enableSystemdResolved [ systemd.dev ];
100 (lib.mesonOption "selinux" "disabled")
101 (lib.mesonOption "selinux_policy" "disabled")
102 (lib.mesonOption "bash-completion" "enabled")
103 (lib.mesonOption "test_programs" "disabled")
104 (lib.mesonOption "unit_tests" "disabled")
105 (lib.mesonOption "asio_path" "${asio}")
106 (lib.mesonOption "dbus_policy_dir" "${placeholder "out"}/share/dbus-1/system.d")
107 (lib.mesonOption "dbus_system_service_dir" "${placeholder "out"}/share/dbus-1/system-services")
108 (lib.mesonOption "systemd_system_unit_dir" "${placeholder "out"}/lib/systemd/system")
109 (lib.mesonOption "create_statedir" "disabled")
110 (lib.mesonOption "sharedstatedir" "/etc")
113 dontWrapGApps = true;
115 makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
119 wrapPythonProgramsIn "$out/libexec/openvpn3-linux" "$out ${pythonPath}"
122 NIX_LDFLAGS = "-lpthread";
125 description = "OpenVPN 3 Linux client";
126 license = lib.licenses.agpl3Plus;
127 homepage = "https://github.com/OpenVPN/openvpn3-linux/";
128 changelog = "https://github.com/OpenVPN/openvpn3-linux/releases/tag/v${version}";
129 maintainers = with lib.maintainers; [
133 platforms = lib.platforms.linux;