nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 fetchurl,
3 lib,
4 stdenv,
5}:
6let
7 version = "2016-01-26";
8 rpath = lib.makeLibraryPath [
9 "$out/lib"
10 "$out/bin"
11 ];
12 platform =
13 with stdenv;
14 if isx86_64 then
15 "64bit"
16 else if isi686 then
17 "32bit"
18 else
19 throw "${system} not considered in build derivation. Might still be supported.";
20 sha256 =
21 with stdenv;
22 if isx86_64 then
23 "1jfsng5n3phw5rqpkid9m5j7m7zgj5bifh7swvba7f97y6imdaax"
24 else
25 "15y6r5w306pcq4g1rn9f7vf70f3a7qhq237ngaf0wxh2nr0aamxp";
26in
27stdenv.mkDerivation {
28 src = fetchurl {
29 url = "http://www.sundtek.de/media/netinst/${platform}/installer.tar.gz";
30 sha256 = sha256;
31 };
32 pname = "sundtek";
33 inherit version;
34
35 sourceRoot = ".";
36
37 installPhase = ''
38 cp -r opt $out
39
40 # add and fix pkg-config file
41 mkdir -p $out/lib/pkgconfig
42 substitute $out/doc/libmedia.pc $out/lib/pkgconfig/libmedia.pc \
43 --replace /opt $out
44 '';
45
46 postFixup = ''
47 find $out -type f -exec \
48 patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" {} \
49 patchelf --set-rpath ${rpath} {} \;
50 '';
51
52 preferLocalBuild = true;
53
54 meta = with lib; {
55 description = "Sundtek MediaTV driver";
56 maintainers = [ maintainers.simonvandel ];
57 sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
58 platforms = platforms.unix;
59 license = licenses.unfree;
60 homepage = "https://support.sundtek.com/index.php/topic,1573.0.html";
61 };
62}