summary refs log tree commit diff
diff options
context:
space:
mode:
authorAdam Joseph <adam@westernsemico.com>2023-06-07 10:37:55 -0700
committerEmery Hemingway <ehmry@posteo.net>2023-06-07 21:10:09 +0100
commitd61bdc7ded28212cddbd0eaf870b43301bdbf974 (patch)
treebfd99655bbada50542fcf42d5adbd14bc0205943
parent2c5682c927e612b785a250fbcf774593943c6fad (diff)
downloadnixpkgs-d61bdc7ded28212cddbd0eaf870b43301bdbf974.tar
nixpkgs-d61bdc7ded28212cddbd0eaf870b43301bdbf974.tar.gz
nixpkgs-d61bdc7ded28212cddbd0eaf870b43301bdbf974.tar.bz2
nixpkgs-d61bdc7ded28212cddbd0eaf870b43301bdbf974.tar.lz
nixpkgs-d61bdc7ded28212cddbd0eaf870b43301bdbf974.tar.xz
nixpkgs-d61bdc7ded28212cddbd0eaf870b43301bdbf974.tar.zst
nixpkgs-d61bdc7ded28212cddbd0eaf870b43301bdbf974.zip
recoll: fix cross
This commit fixes cross-compilation of recoll by:

1. Disabling the python module when cross compiling

2. Removing `file` from `nativeBuildInputs`, since it leaks into
   recoll-*.so, and forcing use of the hostPlatform `file` by adding
   the configureFlag that does that.

3. Adding `qtbase` to `nativeBuildInputs` if `withGui`
-rw-r--r--pkgs/applications/search/recoll/default.nix12
1 files changed, 10 insertions, 2 deletions
diff --git a/pkgs/applications/search/recoll/default.nix b/pkgs/applications/search/recoll/default.nix
index daf611b91f7..898f1040d59 100644
--- a/pkgs/applications/search/recoll/default.nix
+++ b/pkgs/applications/search/recoll/default.nix
@@ -49,6 +49,12 @@ mkDerivation rec {
     "--enable-recollq"
     "--disable-webkit"
     "--without-systemd"
+
+    # this leaks into the final `librecoll-*.so` binary, so we need
+    # to be sure it is taken from `pkgs.file` rather than `stdenv`,
+    # especially when cross-compiling
+    "--with-file-command=${file}/bin/file"
+
   ] ++ lib.optionals (!withPython) [
     "--disable-python-module"
     "--disable-python-chm"
@@ -68,8 +74,9 @@ mkDerivation rec {
     ./fix-datadir.patch
   ];
 
-  nativeBuildInputs = [
-    file
+  nativeBuildInputs = lib.optionals withGui [
+    qtbase
+  ] ++ [
     pkg-config
   ] ++ lib.optionals withPython [
     python3Packages.setuptools
@@ -87,6 +94,7 @@ mkDerivation rec {
   ] ++ [
     xapian
     zlib
+    file
   ] ++ lib.optionals withGui [
     qtbase
   ] ++ lib.optionals stdenv.isDarwin [