summary refs log tree commit diff
path: root/pkgs/tools/misc/ocz-ssd-guru/default.nix
blob: c5ac32af3be4e65021284c2aa5e09b5c8161cdf7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{ fetchurl, lib, stdenv, xorg, freetype, fontconfig, libGLU, libGL, glibc, makeWrapper }:

let
  system = if stdenv.hostPlatform.system == "x86_64-linux" then "linux64" else "linux32";
in
stdenv.mkDerivation rec {
  pname = "ocz-ssd-guru";
  version = "1.0.1170";

  src = fetchurl {
    url = "http://ocz.com/consumer/download/ssd-guru/SSDGuru_${version}.tar.gz";
    sha256 = "0ri7qmpc1xpy12lpzl6k298c641wcibcwrzz8jn75wdg4rr176r5";
  };

  buildInputs = [ makeWrapper ];

  libPath = lib.makeLibraryPath [
      xorg.libX11
      xorg.libxcb
      freetype
      fontconfig
      xorg.libXext
      xorg.libXi
      xorg.libXrender
      stdenv.cc.cc
      glibc
      libGLU libGL
  ];

  installPhase = ''
    mkdir -p $out/bin
    cp ${system}/SSDGuru $out/bin/
    rm -rf linux{32,64}
    patchelf \
      --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
      --set-rpath $libPath:$out \
      $out/bin/SSDGuru

    wrapProgram $out/bin/SSDGuru --prefix LD_LIBRARY_PATH : $libPath
  '';

  dontStrip = true;
  dontPatchELF = true;

  meta = {
    homepage = "http://ocz.com/ssd-guru";
    description = "SSD Management Tool for OCZ disks";
    license = lib.licenses.unfree;
    platforms = lib.platforms.linux;
    maintainers = with lib.maintainers; [ jagajaga ];
  };

}