From 07896ee61dba47bc57c4c3b3b819033dc0324a1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Mon, 8 Aug 2022 08:27:06 +0200 Subject: Turris Omnia cross build now should work --- nixos/default.nix | 2 + nixos/modules/armv7l-overlay.nix | 86 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 nixos/modules/armv7l-overlay.nix (limited to 'nixos') diff --git a/nixos/default.nix b/nixos/default.nix index 7274f66..080ec0d 100644 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -7,6 +7,8 @@ self: let turris-tarball = import ./modules/turris-tarball.nix; turris-crossbuild = import ./modules/turris-crossbuild.nix; + armv7l-overlay = import ./modules/armv7l-overlay.nix; + hostapd = import ./modules/hostapd.nix; }; diff --git a/nixos/modules/armv7l-overlay.nix b/nixos/modules/armv7l-overlay.nix new file mode 100644 index 0000000..a1b2449 --- /dev/null +++ b/nixos/modules/armv7l-overlay.nix @@ -0,0 +1,86 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + + is_native = config.nixpkgs.crossSystem == null && config.nixpkgs.system == "armv7l-linux"; + is_cross = config.nixpkgs.crossSystem != null && config.nixpkgs.crossSystem.system == "armv7l-linux"; + +in { + nixpkgs.overlays = (optionals is_native [ + (self: super: let + + disableCheck = pkg: pkg.overrideAttrs (oldAttrs: { + doCheck = false; + doInstallCheck = false; + }); + + in { + + boehmgc = disableCheck super.boehmgc; + libseccomp = disableCheck super.libseccomp; + libuv = disableCheck super.libuv; + elfutils = disableCheck super.elfutils; + gobject-introspection = disableCheck super.gobject-introspection; + nlohmann_json = disableCheck super.nlohmann_json; + openldap = disableCheck super.openldap; + + + python310 = super.python310.override { + + packageOverrides = python-self: python-super: let + noTest = pkg: pkg.overrideAttrs (oldAttrs: { + dontUsePytestCheck = true; + dontUseSetuptoolsCheck = true; + }); + in { + + pytest-xdist = noTest python-super.pytest-xdist; + requests = noTest python-super.requests; + + }; + }; + python310Packages = self.python310.pkgs; + python = self.python310; + pythonPackages = self.python.pkgs; + + # Overrides to get build to work + #boehmgc = armv7lDisableCheck nixpkgs.boehmgc; + #libseccomp = armv7lDisableCheck nixpkgs.libseccomp; + #libuv = armv7lDisableCheck nixpkgs.libuv; + #elfutils = armv7lDisableCheck nixpkgs.elfutils; + #patchelf = armv7lDisableCheck nixpkgs.patchelf; + #bison = armv7lDisableCheck nixpkgs.bison; + #findutils = armv7lDisableCheck nixpkgs.findutils; + #p11-kit = armv7lDisableCheck nixpkgs.p11-kit; + #glib = armv7lDisableCheck nixpkgs.glib; + #rustc = armv7lDisableCheck nixpkgs.rustc; + #mdbook = armv7lDisableCheck nixpkgs.mdbook; + #ell = armv7lDisableCheck nixpkgs.ell; + #polkit = armv7lDisableCheck nixpkgs.polkit; + #udisks2 = disableCheck nixpkgs.udisks2; + #udisks = udisks2; + #llvm = armv7lDisableCheck nixpkgs.llvm; + #llvm_14 = armv7lDisableCheck nixpkgs.llvm_14; + #jemalloc = armv7lDisableCheck nixpkgs.jemalloc; + #openssh = armv7lDisableCheck nixpkgs.openssh; + #nlohmann_json = armv7lDisableCheck nixpkgs.nlohmann_json; + + }) + ]) ++ (optionals is_cross [ + (self: super: { + + btrfs-progs = super.btrfs-progs.overrideAttrs (oldAttrs: { + configureFlags = ["--disable-python"]; + installFlags = []; + }); + pixz = super.pixz.overrideAttrs (oldAttrs: { + configureFlags = ["--without-manpage"]; + patches = [ ../../pkgs/patches/0001-configure.ac-replace-AC_CHECK_FILE.patch ]; + }); + + }) + ]); + +} -- cgit v1.2.3