diff options
author | Alyssa Ross <hi@alyssa.is> | 2019-01-07 02:18:36 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2019-01-07 02:18:47 +0000 |
commit | 36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch) | |
tree | b3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/development/libraries/liboil | |
parent | 4e31070265257dc67d120c27e0f75c2344fdfa9a (diff) | |
parent | abf060725d7614bd3b9f96764262dfbc2f9c2199 (diff) | |
download | nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2 nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip |
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/liboil')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/liboil/default.nix | 32 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/libraries/liboil/x86_64-cpuid.patch | 38 |
2 files changed, 70 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/liboil/default.nix b/nixpkgs/pkgs/development/libraries/liboil/default.nix new file mode 100644 index 000000000000..fb2dad605252 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/liboil/default.nix @@ -0,0 +1,32 @@ +{stdenv, fetchurl, pkgconfig }: + +stdenv.mkDerivation rec { + name = "liboil-0.3.17"; + + src = fetchurl { + url = "${meta.homepage}/download/${name}.tar.gz"; + sha256 = "0sgwic99hxlb1av8cm0albzh8myb7r3lpcwxfm606l0bkc3h4pqh"; + }; + + patches = [ ./x86_64-cpuid.patch ]; + + outputs = [ "out" "dev" "devdoc" ]; + outputBin = "dev"; # oil-bugreport + + nativeBuildInputs = [ pkgconfig ]; + + # fix "argb_paint_i386.c:53:Incorrect register `%rax' used with `l' suffix" + # errors + configureFlags = stdenv.lib.optional stdenv.isDarwin "--build=x86_64"; + + # fixes a cast in inline asm: easier than patching + buildFlags = stdenv.lib.optional stdenv.isDarwin "CFLAGS=-fheinous-gnu-extensions"; + + meta = with stdenv.lib; { + 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; + }; +} diff --git a/nixpkgs/pkgs/development/libraries/liboil/x86_64-cpuid.patch b/nixpkgs/pkgs/development/libraries/liboil/x86_64-cpuid.patch new file mode 100644 index 000000000000..d86dd79c3bcb --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/liboil/x86_64-cpuid.patch @@ -0,0 +1,38 @@ +From 705916007fba0a845229a02dc6474cb523eff150 Mon Sep 17 00:00:00 2001 +From: David Schleef <ds@schleef.org> +Date: Tue, 20 Jul 2010 21:05:26 +0000 +Subject: x86: Fix cpuid function on x86-64 + +Fixes: #28956. +--- +diff --git a/liboil/liboilcpu-x86.c b/liboil/liboilcpu-x86.c +index e7a1978..ef4d3f2 100644 +--- a/liboil/liboilcpu-x86.c ++++ b/liboil/liboilcpu-x86.c +@@ -162,13 +162,10 @@ get_cpuid (uint32_t op, uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d) + static void + get_cpuid (uint32_t op, uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d) + { ++ *a = op; + __asm__ ( +- " pushq %%rbx\n" + " cpuid\n" +- " mov %%ebx, %%esi\n" +- " popq %%rbx\n" +- : "=a" (*a), "=S" (*b), "=c" (*c), "=d" (*d) +- : "0" (op)); ++ : "+a" (*a), "=b" (*b), "=c" (*c), "=d" (*d)); + } + #endif + +@@ -185,7 +182,7 @@ oil_cpu_detect_cpuid (void) + { + uint32_t eax, ebx, ecx, edx; + uint32_t level; +- char vendor[13] = { 0 }; ++ char vendor[13+4] = { 0 }; + int ret; + + oil_fault_check_enable (); +-- +cgit v0.9.0.2-2-gbebe |