Merge pull request #148258 from sternenseemann/netbsd-fix-libcpuid

libcpuid: fix cross compilation to NetBSD
This commit is contained in:
sterni 2021-12-02 15:38:11 +01:00 committed by GitHub
commit 4ba3bb3298
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, autoreconfHook }:
{ lib, stdenv, fetchFromGitHub, fetchpatch, autoreconfHook }:
stdenv.mkDerivation rec {
pname = "libcpuid";
@ -14,6 +14,12 @@ stdenv.mkDerivation rec {
patches = [
# Work around https://github.com/anrieff/libcpuid/pull/102.
./stdint.patch
# Fixes cross-compilation to NetBSD, remove me for libcpuid > 0.5.1
(fetchpatch {
name = "use-popcount-from-libc.patch";
url = "https://github.com/anrieff/libcpuid/commit/1acaf9980b55ae180cc08db218b9face28202519.patch";
sha256 = "0lvsv9baq0sria1f1ncn1b2783js29lfs5fv8milp54pg1wd5b7q";
})
];
nativeBuildInputs = [ autoreconfHook ];

View File

@ -166,8 +166,7 @@ in
i686-embedded = mapTestOnCross lib.systems.examples.i686-embedded embedded;
x86_64-embedded = mapTestOnCross lib.systems.examples.x86_64-embedded embedded;
# TODO: fix cross compilation of nix{,Unstable} to netbsd and switch to common
x86_64-netbsd = mapTestOnCross lib.systems.examples.x86_64-netbsd embedded;
x86_64-netbsd = mapTestOnCross lib.systems.examples.x86_64-netbsd common;
# we test `embedded` instead of `linuxCommon` because very few packages
# successfully cross-compile to Redox so far