lol
1{lib, stdenv, fetchurl, pkg-config }:
2
3stdenv.mkDerivation rec {
4 pname = "liboil";
5 version = "0.3.17";
6
7 src = fetchurl {
8 url = "${meta.homepage}/download/liboil-${version}.tar.gz";
9 sha256 = "0sgwic99hxlb1av8cm0albzh8myb7r3lpcwxfm606l0bkc3h4pqh";
10 };
11
12 patches = [ ./x86_64-cpuid.patch ];
13
14 outputs = [ "out" "dev" "devdoc" ];
15 outputBin = "dev"; # oil-bugreport
16
17 nativeBuildInputs = [ pkg-config ];
18
19 # fix "argb_paint_i386.c:53:Incorrect register `%rax' used with `l' suffix"
20 # errors
21 configureFlags = lib.optional stdenv.isDarwin "--build=x86_64";
22
23 # fixes a cast in inline asm: easier than patching
24 buildFlags = lib.optional stdenv.isDarwin "CFLAGS=-fheinous-gnu-extensions";
25
26 meta = with lib; {
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;
32 };
33}