summary refs log tree commit diff
path: root/pkgs/os-specific/linux/ell
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2020-12-27 13:18:05 +0100
committerFlorian Klink <flokli@flokli.de>2020-12-27 13:20:50 +0100
commit52261c4c2754ce26098eef93dd9354d3b6b4ef88 (patch)
treed72f7e32bf169c363c523da94ca2b15373a627fc /pkgs/os-specific/linux/ell
parent1cf19342f45702ffb4081287cc9a3eb394167c6c (diff)
downloadnixpkgs-52261c4c2754ce26098eef93dd9354d3b6b4ef88.tar
nixpkgs-52261c4c2754ce26098eef93dd9354d3b6b4ef88.tar.gz
nixpkgs-52261c4c2754ce26098eef93dd9354d3b6b4ef88.tar.bz2
nixpkgs-52261c4c2754ce26098eef93dd9354d3b6b4ef88.tar.lz
nixpkgs-52261c4c2754ce26098eef93dd9354d3b6b4ef88.tar.xz
nixpkgs-52261c4c2754ce26098eef93dd9354d3b6b4ef88.tar.zst
nixpkgs-52261c4c2754ce26098eef93dd9354d3b6b4ef88.zip
ell: fix cross compilation
The current `fix-dbus-tests.patch` uses automake and pkgconfig to figure
out the path of `dbus-daemon`. This fails when cross-compiling, as
tests aren't run (and `checkInputs`) not available.

Instead of doing this, we can simply teach the tests to pick up
dbus-daemon from $PATH. This was also sent upstream in
https://lists.01.org/hyperkitty/list/ell@lists.01.org/thread/SQEZAIS2LZXSXGTXOW3GTAM5ZPXRLTN4/.
Diffstat (limited to 'pkgs/os-specific/linux/ell')
-rw-r--r--pkgs/os-specific/linux/ell/0001-unit-test-dbus-pick-up-dbus-daemon-from-PATH.patch84
-rw-r--r--pkgs/os-specific/linux/ell/default.nix9
-rw-r--r--pkgs/os-specific/linux/ell/fix-dbus-tests.patch65
3 files changed, 89 insertions, 69 deletions
diff --git a/pkgs/os-specific/linux/ell/0001-unit-test-dbus-pick-up-dbus-daemon-from-PATH.patch b/pkgs/os-specific/linux/ell/0001-unit-test-dbus-pick-up-dbus-daemon-from-PATH.patch
new file mode 100644
index 00000000000..c2d844edecd
--- /dev/null
+++ b/pkgs/os-specific/linux/ell/0001-unit-test-dbus-pick-up-dbus-daemon-from-PATH.patch
@@ -0,0 +1,84 @@
+From 55d499f4cd5667c04c21f7201d7f10484e187907 Mon Sep 17 00:00:00 2001
+From: Florian Klink <flokli@flokli.de>
+Date: Sun, 27 Dec 2020 13:03:12 +0100
+Subject: [PATCH] unit/test-dbus: pick up dbus-daemon from $PATH
+
+This allows running the unit tests in environments where `dbus-daemon`
+isn't in /usr/bin, but in $PATH.
+
+Signed-off-by: Florian Klink <flokli@flokli.de>
+---
+ unit/test-dbus-message-fds.c | 4 ++--
+ unit/test-dbus-properties.c  | 4 ++--
+ unit/test-dbus.c             | 4 ++--
+ 3 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/unit/test-dbus-message-fds.c b/unit/test-dbus-message-fds.c
+index 6f68bae..4b5662e 100644
+--- a/unit/test-dbus-message-fds.c
++++ b/unit/test-dbus-message-fds.c
+@@ -51,7 +51,7 @@ static bool start_dbus_daemon(void)
+ 	char *prg_envp[1];
+ 	pid_t pid;
+ 
+-	prg_argv[0] = "/usr/bin/dbus-daemon";
++	prg_argv[0] = "dbus-daemon";
+ 	prg_argv[1] = "--nopidfile";
+ 	prg_argv[2] = "--nofork";
+ 	prg_argv[3] = "--config-file=" UNITDIR "dbus.conf";
+@@ -68,7 +68,7 @@ static bool start_dbus_daemon(void)
+ 	}
+ 
+ 	if (pid == 0) {
+-		execve(prg_argv[0], prg_argv, prg_envp);
++		execvpe(prg_argv[0], prg_argv, prg_envp);
+ 		exit(EXIT_SUCCESS);
+ 	}
+ 
+diff --git a/unit/test-dbus-properties.c b/unit/test-dbus-properties.c
+index b435062..049f0f4 100644
+--- a/unit/test-dbus-properties.c
++++ b/unit/test-dbus-properties.c
+@@ -49,7 +49,7 @@ static bool start_dbus_daemon(void)
+ 	char *prg_envp[1];
+ 	pid_t pid;
+ 
+-	prg_argv[0] = "/usr/bin/dbus-daemon";
++	prg_argv[0] = "dbus-daemon";
+ 	prg_argv[1] = "--nopidfile";
+ 	prg_argv[2] = "--nofork";
+ 	prg_argv[3] = "--config-file=" UNITDIR "dbus.conf";
+@@ -66,7 +66,7 @@ static bool start_dbus_daemon(void)
+ 	}
+ 
+ 	if (pid == 0) {
+-		execve(prg_argv[0], prg_argv, prg_envp);
++		execvpe(prg_argv[0], prg_argv, prg_envp);
+ 		exit(EXIT_SUCCESS);
+ 	}
+ 
+diff --git a/unit/test-dbus.c b/unit/test-dbus.c
+index 67f0a7b..582847e 100644
+--- a/unit/test-dbus.c
++++ b/unit/test-dbus.c
+@@ -45,7 +45,7 @@ static void start_dbus_daemon(void)
+ 	char *prg_envp[1];
+ 	pid_t pid;
+ 
+-	prg_argv[0] = "/usr/bin/dbus-daemon";
++	prg_argv[0] = "dbus-daemon";
+ 	prg_argv[1] = "--nopidfile";
+ 	prg_argv[2] = "--nofork";
+ 	prg_argv[3] = "--config-file=" UNITDIR "dbus.conf";
+@@ -62,7 +62,7 @@ static void start_dbus_daemon(void)
+ 	}
+ 
+ 	if (pid == 0) {
+-		execve(prg_argv[0], prg_argv, prg_envp);
++		execvpe(prg_argv[0], prg_argv, prg_envp);
+ 		exit(EXIT_SUCCESS);
+ 	}
+ 
+-- 
+2.29.2
+
diff --git a/pkgs/os-specific/linux/ell/default.nix b/pkgs/os-specific/linux/ell/default.nix
index 21f98889ca5..c6aed21cd8e 100644
--- a/pkgs/os-specific/linux/ell/default.nix
+++ b/pkgs/os-specific/linux/ell/default.nix
@@ -12,13 +12,14 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" ];
 
   src = fetchgit {
-     url = "https://git.kernel.org/pub/scm/libs/${pname}/${pname}.git";
-     rev = version;
-     sha256 = "16z7xwlrpx1bsr2y1rgxxxixzwc84cwn2g557iqxhwsxfzy6q3dk";
+    url = "https://git.kernel.org/pub/scm/libs/${pname}/${pname}.git";
+    rev = version;
+    sha256 = "16z7xwlrpx1bsr2y1rgxxxixzwc84cwn2g557iqxhwsxfzy6q3dk";
   };
 
   patches = [
-    ./fix-dbus-tests.patch
+    # Sent upstream in https://lists.01.org/hyperkitty/list/ell@lists.01.org/thread/SQEZAIS2LZXSXGTXOW3GTAM5ZPXRLTN4/
+    ./0001-unit-test-dbus-pick-up-dbus-daemon-from-PATH.patch
   ];
 
   nativeBuildInputs = [
diff --git a/pkgs/os-specific/linux/ell/fix-dbus-tests.patch b/pkgs/os-specific/linux/ell/fix-dbus-tests.patch
deleted file mode 100644
index b494ba8b43c..00000000000
--- a/pkgs/os-specific/linux/ell/fix-dbus-tests.patch
+++ /dev/null
@@ -1,65 +0,0 @@
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -140,6 +140,7 @@
- ell_libell_private_la_SOURCES = $(ell_libell_la_SOURCES)
- 
- AM_CFLAGS = -fvisibility=hidden -DUNITDIR=\""$(top_srcdir)/unit/"\" \
-+				-DDBUS_DAEMON=\""$(DBUS_DAEMONDIR)/dbus-daemon"\" \
- 				-DCERTDIR=\""$(top_builddir)/unit/"\"
- 
- pkgconfigdir = $(libdir)/pkgconfig
---- a/configure.ac
-+++ b/configure.ac
-@@ -14,6 +14,8 @@
- 
- AC_PREFIX_DEFAULT(/usr/local)
- 
-+PKG_PROG_PKG_CONFIG
-+
- COMPILER_FLAGS
- 
- AC_LANG_C
-@@ -131,6 +133,10 @@
- 	AC_CHECK_PROG(have_xxd, [xxd], [yes], [no])
- fi
- 
-+PKG_CHECK_MODULES(DBUS, dbus-1, dummy=yes,
-+			AC_MSG_ERROR(D-Bus is required for running tests))
-+PKG_CHECK_VAR(DBUS_DAEMONDIR, dbus-1, daemondir)
-+
- AM_CONDITIONAL(DBUS_TESTS, test "${little_endian}" = "yes")
- AM_CONDITIONAL(CERT_TESTS, test "${have_openssl}" = "yes")
- 
---- a/unit/test-dbus-message-fds.c
-+++ b/unit/test-dbus-message-fds.c
-@@ -51,7 +51,7 @@
- 	char *prg_envp[1];
- 	pid_t pid;
- 
--	prg_argv[0] = "/usr/bin/dbus-daemon";
-+	prg_argv[0] = DBUS_DAEMON;
- 	prg_argv[1] = "--nopidfile";
- 	prg_argv[2] = "--nofork";
- 	prg_argv[3] = "--config-file=" UNITDIR "dbus.conf";
---- a/unit/test-dbus-properties.c
-+++ b/unit/test-dbus-properties.c
-@@ -48,7 +48,7 @@
- 	char *prg_envp[1];
- 	pid_t pid;
- 
--	prg_argv[0] = "/usr/bin/dbus-daemon";
-+	prg_argv[0] = DBUS_DAEMON;
- 	prg_argv[1] = "--nopidfile";
- 	prg_argv[2] = "--nofork";
- 	prg_argv[3] = "--config-file=" UNITDIR "dbus.conf";
---- a/unit/test-dbus.c
-+++ b/unit/test-dbus.c
-@@ -45,7 +45,7 @@
- 	char *prg_envp[1];
- 	pid_t pid;
- 
--	prg_argv[0] = "/usr/bin/dbus-daemon";
-+	prg_argv[0] = DBUS_DAEMON;
- 	prg_argv[1] = "--nopidfile";
- 	prg_argv[2] = "--nofork";
- 	prg_argv[3] = "--config-file=" UNITDIR "dbus.conf";