From 1682265db7feb0720277802902a85b6fcca27e2c Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Sun, 26 Feb 2023 15:07:10 -0800 Subject: [PATCH] baresip: use cmake for configurePhase, fixes cross Although baresip is a cmake-based project, our expression was not using cmake for the configurePhase. This commit causes it to do so, which fixes cross-compilation for this package. Incorporates: - https://github.com/NixOS/nixpkgs/pull/218518 - https://github.com/NixOS/nixpkgs/pull/218520 - https://github.com/NixOS/nixpkgs/pull/218522 - https://github.com/NixOS/nixpkgs/pull/218521 - https://github.com/NixOS/nixpkgs/pull/218523 --- .../instant-messengers/baresip/default.nix | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/instant-messengers/baresip/default.nix b/pkgs/applications/networking/instant-messengers/baresip/default.nix index f76a4c984d5e..5aa3629bd38e 100644 --- a/pkgs/applications/networking/instant-messengers/baresip/default.nix +++ b/pkgs/applications/networking/instant-messengers/baresip/default.nix @@ -23,6 +23,8 @@ , spandsp3 , libuuid , libvpx +, cmake +, dbusSupport ? true }: stdenv.mkDerivation rec { version = "2.9.0"; @@ -33,7 +35,10 @@ stdenv.mkDerivation rec { rev = "v${version}"; sha256 = "sha256-B4d8D4IfLYAIYVN80Lrh5bywD5iacSnUVwEzbc6Xq7g="; }; - nativeBuildInputs = [ pkg-config ]; + prePatch = lib.optionalString (!dbusSupport) '' + substituteInPlace cmake/modules.cmake --replace 'list(APPEND MODULES ctrl_dbus)' "" + ''; + nativeBuildInputs = [ pkg-config cmake ]; buildInputs = [ zlib openssl @@ -56,9 +61,14 @@ stdenv.mkDerivation rec { libuuid libvpx ] ++ (with gst_all_1; [ gstreamer gst-libav gst-plugins-base gst-plugins-bad gst-plugins-good ]); + + cmakeFlags = [ + "-DCMAKE_SKIP_BUILD_RPATH=ON" + "-Dre_DIR=${libre}/include/re" + ]; + makeFlags = [ "LIBRE_MK=${libre}/share/re/re.mk" - "LIBRE_INC=${libre}/include/re" "LIBRE_SO=${libre}/lib" "LIBREM_PATH=${librem}" "PREFIX=$(out)"