1 {lib, stdenv, fetchurl, pkg-config }:
3 stdenv.mkDerivation rec {
8 url = "${meta.homepage}/download/liboil-${version}.tar.gz";
9 sha256 = "0sgwic99hxlb1av8cm0albzh8myb7r3lpcwxfm606l0bkc3h4pqh";
12 patches = [ ./x86_64-cpuid.patch ];
14 outputs = [ "out" "dev" "devdoc" ];
15 outputBin = "dev"; # oil-bugreport
17 nativeBuildInputs = [ pkg-config ];
19 # fix "argb_paint_i386.c:53:Incorrect register `%rax' used with `l' suffix"
21 configureFlags = lib.optional (stdenv.isDarwin && stdenv.isx86_64) "--build=x86_64";
23 # fixes a cast in inline asm: easier than patching
24 buildFlags = lib.optional stdenv.isDarwin "CFLAGS=-fheinous-gnu-extensions";
27 description = "A library of simple functions that are optimized for various CPUs";
28 homepage = "https://liboil.freedesktop.org";
29 license = licenses.bsd2;
30 maintainers = with maintainers; [ lovek323 ];
31 platforms = platforms.all;