summary refs log tree commit diff
diff options
context:
space:
mode:
authorGraham Christensen <graham@grahamc.com>2020-11-24 09:48:34 -0500
committerGraham Christensen <graham@grahamc.com>2020-11-24 09:50:33 -0500
commit22965d84d5e57307d4f6f02d32b50adac2cbb6bb (patch)
tree07fdb31d4581f2660da42e77e2fcc4ad098f91a7
parent79086e5d55e037b994c839c2894a3667ae72547b (diff)
downloadnixpkgs-22965d84d5e57307d4f6f02d32b50adac2cbb6bb.tar
nixpkgs-22965d84d5e57307d4f6f02d32b50adac2cbb6bb.tar.gz
nixpkgs-22965d84d5e57307d4f6f02d32b50adac2cbb6bb.tar.bz2
nixpkgs-22965d84d5e57307d4f6f02d32b50adac2cbb6bb.tar.lz
nixpkgs-22965d84d5e57307d4f6f02d32b50adac2cbb6bb.tar.xz
nixpkgs-22965d84d5e57307d4f6f02d32b50adac2cbb6bb.tar.zst
nixpkgs-22965d84d5e57307d4f6f02d32b50adac2cbb6bb.zip
sssd: fix build on glibc-2.32
For https://hydra.nixos.org/build/128488320 which errored with:

    src/responder/nss/nss_cmd.c:733:16: error: 'nss_setnetgrent' redeclared as different kind of symbol
      733 | static errno_t nss_setnetgrent(struct cli_ctx *cli_ctx,
          |                ^~~~~~~~~~~~~~~
    In file included from ./src/sss_client/sss_cli.h:28,
                     from ./src/db/sysdb.h:27,
                     from src/responder/nss/nss_cmd.c:26:
    /nix/store/a2n8nrsf215x01a7fv8l94crdjwf69pa-glibc-2.32-dev/include/nss.h:184:25: note: previous declaration of 'nss_setnetgrent' was here
      184 | typedef enum nss_status nss_setnetgrent (const char *, struct __netgrent *);
          |                         ^~~~~~~~~~~~~~~
    make[2]: *** [Makefile:17818: src/responder/nss/nss_cmd.o] Error 1
    make[2]: Leaving directory '/build/sssd-1.16.4'
    make[1]: *** [Makefile:33824: all-recursive] Error 1
    make[1]: Leaving directory '/build/sssd-1.16.4'
    make: *** [Makefile:10123: all] Error 2
-rw-r--r--pkgs/os-specific/linux/sssd/default.nix10
1 files changed, 10 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/sssd/default.nix b/pkgs/os-specific/linux/sssd/default.nix
index 22e2da79c8c..537764e0c73 100644
--- a/pkgs/os-specific/linux/sssd/default.nix
+++ b/pkgs/os-specific/linux/sssd/default.nix
@@ -54,6 +54,16 @@ stdenv.mkDerivation rec {
     configureFlagsArray+=("--with-sudo")
   '';
 
+  preBuild = ''
+    # glibc-2.32 includes a full set of NSS stub module declarations
+    # that conflict with the ones in sssd source. Define _NSS_H to
+    # prevent them from breaking the compilation, but just for this
+    # one file.
+    cat >> Makefile <<EOF
+      src/responder/nss/nss_cmd.\$(OBJEXT) : DEFS = -DHAVE_CONFIG_H -D_NSS_H
+    EOF
+  '';
+
   enableParallelBuilding = true;
   buildInputs = [ augeas dnsutils c-ares curl cyrus_sasl ding-libs libnl libunistring nss
                   samba nfs-utils doxygen python python3 popt