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