2021-02-05 17:12:51 +00:00
|
|
|
{lib, stdenv, fetchurl, pkg-config }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2022-01-13 20:06:32 +00:00
|
|
|
pname = "liboil";
|
|
|
|
version = "0.3.17";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2022-01-13 20:06:32 +00:00
|
|
|
url = "${meta.homepage}/download/liboil-${version}.tar.gz";
|
2020-04-24 23:36:52 +00:00
|
|
|
sha256 = "0sgwic99hxlb1av8cm0albzh8myb7r3lpcwxfm606l0bkc3h4pqh";
|
|
|
|
};
|
|
|
|
|
|
|
|
patches = [ ./x86_64-cpuid.patch ];
|
|
|
|
|
|
|
|
outputs = [ "out" "dev" "devdoc" ];
|
|
|
|
outputBin = "dev"; # oil-bugreport
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# fix "argb_paint_i386.c:53:Incorrect register `%rax' used with `l' suffix"
|
|
|
|
# errors
|
2021-02-05 17:12:51 +00:00
|
|
|
configureFlags = lib.optional stdenv.isDarwin "--build=x86_64";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# fixes a cast in inline asm: easier than patching
|
2021-02-05 17:12:51 +00:00
|
|
|
buildFlags = lib.optional stdenv.isDarwin "CFLAGS=-fheinous-gnu-extensions";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A library of simple functions that are optimized for various CPUs";
|
|
|
|
homepage = "https://liboil.freedesktop.org";
|
|
|
|
license = licenses.bsd2;
|
|
|
|
maintainers = with maintainers; [ lovek323 ];
|
|
|
|
platforms = platforms.all;
|
2022-12-17 10:02:37 +00:00
|
|
|
# never built on aarch64-darwin since first introduction in nixpkgs
|
|
|
|
broken = stdenv.isDarwin && stdenv.isAarch64;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|