Unverified Commit 8ed6a3e6 authored by John Ericson's avatar John Ericson Committed by GitHub
Browse files

Merge pull request #231973 from obsidiansystems/netbsd-libcpu

libcpuid: Fix NetBSD cross build
parents 4aafa10a a4e81589
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
{ lib, stdenv, fetchFromGitHub, autoreconfHook }:
{ lib, stdenv, fetchFromGitHub, fetchpatch, autoreconfHook }:

stdenv.mkDerivation rec {
  pname = "libcpuid";
@@ -11,6 +11,16 @@ stdenv.mkDerivation rec {
    sha256 = "sha256-lhoHqdS5tke462guORg+PURjVmjAgviT5KJHp6PyvUA=";
  };

  patches = [
    # Fixes cross-compilation to NetBSD
    # https://github.com/anrieff/libcpuid/pull/190
    (fetchpatch {
      name = "pass-pthread-to-linker.patch";
      url = "https://github.com/anrieff/libcpuid/commit/c28436e7239f28dab0e2a3bcdbce95f41e1363b1.patch";
      sha256 = "sha256-J2mB010JcE4si0rERjcrL9kJgbWHKaQCIZPDkmRvcq4=";
    })
  ];

  nativeBuildInputs = [ autoreconfHook ];

  meta = with lib; {