1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-15 19:23:01 +03:00

cross-workarounds: Work around libselinux dependency issue

It fails with:

```
/nix/store/m7080pw0ryjk0jhljp55rq1hd2qy8gki-python3-3.8.6/include/python3.8/pyport.h:726:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
  726 | #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."

[...]

builder for '/nix/store/cdysjc47jc4z49r25xzwf2sazqd4w4rg-libselinux-3.0-armv7l-unknown-linux-gnueabihf.drv' failed with exit code 2
```
This commit is contained in:
Samuel Dionne-Riel 2021-01-02 02:00:04 -05:00
parent 7332254db2
commit 90167b0b64

View File

@ -1,4 +1,4 @@
{ lib, config, ... }:
{ config, lib, pkgs, ... }:
# This module adds system-level workarounds when cross-compiling.
# These workarounds are only expected to be implemented for the *basic* build.
@ -8,6 +8,19 @@ let
config.nixpkgs.crossSystem != null &&
config.nixpkgs.localSystem.system != null &&
config.nixpkgs.crossSystem.system != config.nixpkgs.localSystem.system;
AArch32Overlay = final: super: {
# Works around libselinux failure with python on armv7l.
# LONG_BIT definition appears wrong for platform
libselinux = (super.libselinux
.override({
enablePython = false;
}))
.overrideAttrs (_: {
preInstall = ":";
})
;
};
in
lib.mkIf isCross
{
@ -21,4 +34,8 @@ lib.mkIf isCross
# udisks fails due to gobject-introspection being not cross-compilation friendly.
services.udisks2.enable = false;
nixpkgs.overlays = lib.mkMerge [
(lib.mkIf config.nixpkgs.crossSystem.isAarch32 [ AArch32Overlay ])
];
}