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
|
2023-01-11 07:51:40 +00:00
|
|
|
configureFlags = lib.optional (stdenv.isDarwin && stdenv.isx86_64) "--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; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Library of simple functions that are optimized for various CPUs";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "oil-bugreport";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://liboil.freedesktop.org";
|
|
|
|
license = licenses.bsd2;
|
|
|
|
maintainers = with maintainers; [ lovek323 ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|