Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

baresip: use cmake for configurePhase, fixes cross #218525

Merged
6 commits merged into from Mar 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
, spandsp3
, libuuid
, libvpx
, cmake
, dbusSupport ? true
}:
stdenv.mkDerivation rec {
version = "2.9.0";
Expand All @@ -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
Expand All @@ -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)"
Expand Down Expand Up @@ -107,6 +117,8 @@ stdenv.mkDerivation rec {
++ lib.optional (stdenv.cc.libc != null) "SYSROOT=${stdenv.cc.libc}"
;

enableParallelBuilding = true;

env.NIX_CFLAGS_COMPILE = '' -I${librem}/include/rem -I${gsm}/include/gsm
-DHAVE_INTTYPES_H -D__GLIBC__
-D__need_timeval -D__need_timespec -D__need_time_t '';
Expand Down
6 changes: 5 additions & 1 deletion pkgs/development/libraries/libre/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{ lib, stdenv, fetchFromGitHub, zlib, openssl }:
{ lib, stdenv, fetchFromGitHub, zlib, openssl
, cmake }:

stdenv.mkDerivation rec {
version = "2.9.0";
pname = "libre";
Expand All @@ -9,10 +11,12 @@ stdenv.mkDerivation rec {
sha256 = "sha256-YNAfHmohMqGGF8N/VdndJJ32PF/GMBoNtjo/t2lt6HA=";
};
buildInputs = [ zlib openssl ];
nativeBuildInputs = [ cmake ];
makeFlags = [ "USE_ZLIB=1" "USE_OPENSSL=1" "PREFIX=$(out)" ]
++ lib.optional (stdenv.cc.cc != null) "SYSROOT_ALT=${stdenv.cc.cc}"
++ lib.optional (stdenv.cc.libc != null) "SYSROOT=${lib.getDev stdenv.cc.libc}"
;
enableParallelBuilding = true;
meta = {
description = "A library for real-time communications with async IO support and a complete SIP stack";
homepage = "https://github.com/baresip/re";
Expand Down
10 changes: 8 additions & 2 deletions pkgs/development/libraries/librem/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{ lib, stdenv, fetchFromGitHub, zlib, openssl, libre }:
{ lib, stdenv, fetchFromGitHub, zlib, openssl, libre
, cmake }:

stdenv.mkDerivation rec {
version = "2.10.0";
pname = "librem";
Expand All @@ -8,15 +10,19 @@ stdenv.mkDerivation rec {
rev = "v${version}";
sha256 = "sha256-wyzpx0WjQLA8UKx4S6QOETMehf51Af5napZsxMXttmM=";
};
nativeBuildInputs = [ cmake ];
buildInputs = [ zlib openssl libre ];
cmakeFlags = [
"-DRE_INCLUDE_DIR=${libre}/include/re"
];
makeFlags = [
"LIBRE_MK=${libre}/share/re/re.mk"
"LIBRE_INC=${libre}/include/re"
"PREFIX=$(out)"
]
++ lib.optional (stdenv.cc.cc != null) "SYSROOT_ALT=${lib.getDev stdenv.cc.cc}"
++ lib.optional (stdenv.cc.libc != null) "SYSROOT=${lib.getDev stdenv.cc.libc}"
;
enableParallelBuilding = true;
meta = {
description = "A library for real-time audio and video processing";
homepage = "https://github.com/baresip/rem";
Expand Down