at v192 48 lines 1.3 kB view raw
1{ fetchurl, stdenv }: 2 3with stdenv.lib; 4 5let 6 version = "2015-09-07"; 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 abort "${system} not considered in build derivation. Might still be supported."; 13 14in 15 stdenv.mkDerivation { 16 src = fetchurl { 17 url = "http://www.sundtek.de/media/netinst/${platform}/installer.tar.gz"; 18 sha256 = "159221lxxs5a37akamp8jc3b5ny36451mgjljajvck0c6qb6fkpr"; 19 }; 20 name = "sundtek-${version}"; 21 22 phases = [ "unpackPhase" "installPhase" "fixupPhase" ]; 23 24 sourceRoot = "."; 25 26 installPhase = '' 27 cp -r opt $out 28 29 # add and fix pkg-config file 30 mkdir -p $out/lib/pkgconfig 31 substitute $out/doc/libmedia.pc $out/lib/pkgconfig/libmedia.pc \ 32 --replace /opt $out 33 ''; 34 35 postFixup = '' 36 find $out -type f -exec \ 37 patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" {} \ 38 patchelf --set-rpath ${rpath} {} \; 39 ''; 40 41 meta = { 42 description = "Sundtek MediaTV driver"; 43 maintainers = [ maintainers.simonvandel ]; 44 platforms = platforms.unix; 45 license = licenses.unfree; 46 homepage = "http://support.sundtek.com/index.php/topic,1573.0.html"; 47 }; 48 }