tribler: from 6.4.3 to 7.0.0-beta

removed old unused dependencies,
changed enablePlayer to true by default,
added myself as maintainer.
This commit is contained in:
Marti Serra 2017-03-22 01:01:51 +01:00 committed by Robin Gloster
parent f9e688e8a1
commit ad75bffb06
No known key found for this signature in database
GPG key ID: 5E4C836C632C2882

View file

@ -1,14 +1,17 @@
{ stdenv, fetchurl, pythonPackages, makeWrapper, nettools, libtorrentRasterbar, imagemagick
, enablePlayer ? false, vlc ? null }:
{ stdenv, fetchgit, pythonPackages, makeWrapper, nettools, libtorrentRasterbar, imagemagick
, enablePlayer ? true, vlc ? null }:
stdenv.mkDerivation rec {
name = "tribler-${version}";
version = "v6.4.3";
pname = "tribler";
name = "${pname}-${version}";
version = "7.0.0-beta";
revision = "1d3ddb8";
src = fetchurl {
url = "https://github.com/Tribler/tribler/releases/download/${version}/Tribler-${version}.tar.xz";
sha256 = "1n5qi3jlby41w60zg6dvl933ypyiflq3rb0qkwhxi4b26s3vwvgr";
src = fetchgit {
url = "https://github.com/Tribler/tribler";
rev = "v${revision}";
sha256 = "16mk76qgg7fgca11yvpygicxqbkc0kn6r82x73fly2310pagd845";
fetchSubmodules = true;
};
buildInputs = [
@ -20,42 +23,56 @@ stdenv.mkDerivation rec {
pythonPath = [
libtorrentRasterbar
pythonPackages.wxPython
pythonPackages.apsw
pythonPackages.twisted
pythonPackages.gmpy
pythonPackages.netifaces
pythonPackages.pillow
pythonPackages.pycrypto
pythonPackages.pyasn1
pythonPackages.requests
pythonPackages.setuptools
pythonPackages.m2crypto
pythonPackages.pyqt5
pythonPackages.chardet
pythonPackages.cherrypy
pythonPackages.cryptography
pythonPackages.libnacl
pythonPackages.configobj
pythonPackages.matplotlib
pythonPackages.plyvel
pythonPackages.decorator
pythonPackages.feedparser
];
installPhase =
''
find . -name '*.png' -exec convert -strip {} {} \;
# Nasty hack; call wrapPythonPrograms to set program_PYTHONPATH.
wrapPythonPrograms
postPatch = ''
${stdenv.lib.optionalString enablePlayer ''
substituteInPlace "./TriblerGUI/vlc.py" --replace "ctypes.CDLL(p)" "ctypes.CDLL('${vlc}/lib/libvlc.so')"
substituteInPlace "./TriblerGUI/widgets/videoplayerpage.py" --replace "if vlc and vlc.plugin_path" "if vlc"
substituteInPlace "./TriblerGUI/widgets/videoplayerpage.py" --replace "os.environ['VLC_PLUGIN_PATH'] = vlc.plugin_path" "os.environ['VLC_PLUGIN_PATH'] = '${vlc}/lib/vlc/plugins'"
''}
'';
mkdir -p $out/share/tribler
cp -prvd Tribler $out/share/tribler/
installPhase = ''
find . -name '*.png' -exec convert -strip {} {} \;
mkdir -pv $out
# Nasty hack; call wrapPythonPrograms to set program_PYTHONPATH.
wrapPythonPrograms
cp -prvd ./* $out/
makeWrapper ${pythonPackages.python}/bin/python $out/bin/tribler \
--set _TRIBLERPATH $out \
--set PYTHONPATH $out:$program_PYTHONPATH \
--set NO_AT_BRIDGE 1 \
--run 'cd $_TRIBLERPATH' \
--add-flags "-O $out/run_tribler.py" \
${stdenv.lib.optionalString enablePlayer ''
--prefix LD_LIBRARY_PATH : ${vlc}/lib
''}
'';
makeWrapper ${pythonPackages.python}/bin/python $out/bin/tribler \
--set _TRIBLERPATH $out/share/tribler \
--set PYTHONPATH $out/share/tribler:$program_PYTHONPATH \
--run 'cd $_TRIBLERPATH' \
--add-flags "-O $out/share/tribler/Tribler/Main/tribler.py" \
${stdenv.lib.optionalString enablePlayer ''
--prefix LD_LIBRARY_PATH : ${vlc}/lib
''}
'';
meta = {
meta = with stdenv.lib; {
maintainers = with maintainers; [ xvapx ];
homepage = http://www.tribler.org/;
description = "A completely decentralised P2P filesharing client based on the Bittorrent protocol";
license = stdenv.lib.licenses.lgpl21;
platforms = stdenv.lib.platforms.linux;
license = licenses.lgpl21;
platforms = platforms.linux;
};
}