summary refs log tree commit diff
path: root/pkgs/tools/misc
diff options
context:
space:
mode:
authorOrivej Desh <orivej@gmx.fr>2018-06-22 13:16:01 +0000
committerOrivej Desh <orivej@gmx.fr>2018-06-22 13:23:58 +0000
commit9af0ed346d710afbaa37b44b651199381c37543a (patch)
treed0804f299e16d3d5c05b531a0b23bc4152407edf /pkgs/tools/misc
parent75879177e839bf1c1d561419f15ff5551d927e37 (diff)
downloadnixlib-9af0ed346d710afbaa37b44b651199381c37543a.tar
nixlib-9af0ed346d710afbaa37b44b651199381c37543a.tar.gz
nixlib-9af0ed346d710afbaa37b44b651199381c37543a.tar.bz2
nixlib-9af0ed346d710afbaa37b44b651199381c37543a.tar.lz
nixlib-9af0ed346d710afbaa37b44b651199381c37543a.tar.xz
nixlib-9af0ed346d710afbaa37b44b651199381c37543a.tar.zst
nixlib-9af0ed346d710afbaa37b44b651199381c37543a.zip
libcpuid: clean up
Diffstat (limited to 'pkgs/tools/misc')
-rw-r--r--pkgs/tools/misc/libcpuid/default.nix60
-rw-r--r--pkgs/tools/misc/libcpuid/stdint.patch5
2 files changed, 16 insertions, 49 deletions
diff --git a/pkgs/tools/misc/libcpuid/default.nix b/pkgs/tools/misc/libcpuid/default.nix
index 410ab4543123..5941b8056b19 100644
--- a/pkgs/tools/misc/libcpuid/default.nix
+++ b/pkgs/tools/misc/libcpuid/default.nix
@@ -1,10 +1,5 @@
-{ stdenv
-, fetchFromGitHub
-, libtool
-, automake
-, autoconf
-, python2 # Needed for tests
-}:
+{ stdenv, fetchFromGitHub, autoreconfHook }:
+
 stdenv.mkDerivation rec {
   name = "libcpuid-${version}";
   version = "0.4.0";
@@ -16,51 +11,18 @@ stdenv.mkDerivation rec {
     sha256 = "136kv6m666f7s18mim0vdbzqvs4s0wvixa12brj9p3kmfbx48bw7";
   };
 
-  patchPhase = ''
-    libtoolize
-    autoreconf --install
-  '';
-
-  configurePhase = ''
-    mkdir -p Install
-    ./configure --prefix=$(pwd)/Install
-    substituteInPlace Makefile --replace "/usr/local" "$out"
-  '';
-
-  buildPhase = ''
-    make all
-  '';
-
-  postInstall = ''
-    pushd Install
-    LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/lib ${python2.interpreter} ../tests/run_tests.py ./bin/cpuid_tool ../tests/
-    popd
-
-    function fixRunPath {
-      p0=$(patchelf --print-rpath $1)
-      p1=$(echo $p0 | sed -re 's#.*Install/lib:##g')
-      patchelf --set-rpath $p1 $1
-    }
-
-    fixRunPath Install/bin/cpuid_tool
-
-    mkdir -p $out
-    sed -i -re "s#(prefix=).*Install#\1$out#g" Install/lib/pkgconfig/libcpuid.pc
-
-    cp -r Install/* $out
-    cp -r tests $out
-  '';
-
-  nativeBuildInputs = [
-    libtool
-    automake
-    autoconf
+  patches = [
+    # Work around https://github.com/anrieff/libcpuid/pull/102.
+    ./stdint.patch
   ];
 
+  nativeBuildInputs = [ autoreconfHook ];
+
   meta = with stdenv.lib; {
     homepage = http://libcpuid.sourceforge.net/;
-    description = "a small C library for x86 CPU detection and feature extraction";
-    license = licenses.bsd3;
-    maintainers = with maintainers; [ artuuge ];
+    description = "A small C library for x86 CPU detection and feature extraction";
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ orivej artuuge ];
+    platforms = platforms.all;
   };
 }
diff --git a/pkgs/tools/misc/libcpuid/stdint.patch b/pkgs/tools/misc/libcpuid/stdint.patch
new file mode 100644
index 000000000000..beb8890c5a28
--- /dev/null
+++ b/pkgs/tools/misc/libcpuid/stdint.patch
@@ -0,0 +1,5 @@
+--- a/libcpuid/libcpuid.h
++++ b/libcpuid/libcpuid.h
+@@ -88 +88 @@
+-#include "libcpuid_types.h"
++#include <stdint.h>