From b2d958c94fab9e720ef94f87eb71e85d15844bbf Mon Sep 17 00:00:00 2001 From: Rouven Czerwinski Date: Sun, 5 Mar 2023 23:47:12 +0000 Subject: [PATCH] rauc: switch buildsystem to meson Adjust the buildsystem to use meson instead of autotools and add additional dependencies. Also add a page to install the man page when using meson. --- pkgs/tools/misc/rauc/default.nix | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/pkgs/tools/misc/rauc/default.nix b/pkgs/tools/misc/rauc/default.nix index 7bc613ac3f9..3548ba6975f 100644 --- a/pkgs/tools/misc/rauc/default.nix +++ b/pkgs/tools/misc/rauc/default.nix @@ -1,7 +1,7 @@ -{ autoreconfHook -, curl +{ curl , dbus , fetchFromGitHub +, fetchpatch , glib , json-glib , lib @@ -9,6 +9,11 @@ , openssl , pkg-config , stdenv +, meson +, ninja +, util-linux +, libnl +, systemd }: stdenv.mkDerivation rec { @@ -22,21 +27,29 @@ stdenv.mkDerivation rec { sha256 = "sha256-VpHcJUTRZ5aJyfYypjVsYyRNrK0+9ci42mmlZQSkWAk="; }; + patches = [ + (fetchpatch { + # Patch to install the man page when using meson, remove on package bump + url = "https://github.com/rauc/rauc/commit/756c677d031c435070a6900e6778d06961822261.patch"; + hash = "sha256-QgIUagioRo61PeC0JyKjZtnauFiYP1Fz9wrxGEikBGI="; + }) + ]; passthru = { updateScript = nix-update-script { }; }; enableParallelBuilding = true; - nativeBuildInputs = [ pkg-config autoreconfHook ]; + nativeBuildInputs = [ pkg-config meson ninja ]; - buildInputs = [ curl dbus glib json-glib openssl ]; + buildInputs = [ curl dbus glib json-glib openssl util-linux libnl systemd ]; - configureFlags = [ - "--with-systemdunitdir=${placeholder "out"}/lib/systemd/system" - "--with-dbusinterfacesdir=${placeholder "out"}/share/dbus-1/interfaces" - "--with-dbuspolicydir=${placeholder "out"}/share/dbus-1/system.d" - "--with-dbussystemservicedir=${placeholder "out"}/share/dbus-1/system-services" + mesonFlags = [ + "--buildtype=release" + (lib.mesonOption "systemdunitdir" "${placeholder "out"}/lib/systemd/system") + (lib.mesonOption "dbusinterfacesdir" "${placeholder "out"}/share/dbus-1/interfaces") + (lib.mesonOption "dbuspolicydir" "${placeholder "out"}/share/dbus-1/system.d") + (lib.mesonOption "dbussystemservicedir" "${placeholder "out"}/share/dbus-1/system-services") ]; meta = with lib; {