2018-07-21 01:44:44 +01:00
|
|
|
{ stdenv, fetchurl, pythonPackages, makeWrapper, libtorrentRasterbar, imagemagick
|
2017-09-10 11:06:01 +01:00
|
|
|
, enablePlayer ? true, vlc ? null, qt5 }:
|
2011-09-02 12:11:48 +01:00
|
|
|
|
2015-07-11 23:09:46 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2018-04-13 16:09:47 +01:00
|
|
|
name = "tribler-${version}";
|
|
|
|
version = "7.0.2";
|
2011-05-03 18:12:31 +01:00
|
|
|
|
2017-09-10 11:06:01 +01:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/Tribler/tribler/releases/download/v${version}/Tribler-v${version}.tar.xz";
|
2018-04-13 16:09:47 +01:00
|
|
|
sha256 = "1p0d0l0sa0nrnbyx2gg50nklkljwvl581i9w3z5qbkfzc7jsdy42";
|
2011-05-03 18:12:31 +01:00
|
|
|
};
|
|
|
|
|
2015-07-11 23:09:46 +01:00
|
|
|
buildInputs = [
|
|
|
|
pythonPackages.python
|
|
|
|
pythonPackages.wrapPython
|
|
|
|
makeWrapper
|
2015-07-14 05:28:36 +01:00
|
|
|
imagemagick
|
2015-07-11 23:09:46 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
pythonPath = [
|
|
|
|
libtorrentRasterbar
|
|
|
|
pythonPackages.apsw
|
|
|
|
pythonPackages.twisted
|
|
|
|
pythonPackages.netifaces
|
|
|
|
pythonPackages.pycrypto
|
|
|
|
pythonPackages.pyasn1
|
|
|
|
pythonPackages.requests
|
|
|
|
pythonPackages.setuptools
|
|
|
|
pythonPackages.m2crypto
|
2017-03-22 00:01:51 +00:00
|
|
|
pythonPackages.pyqt5
|
|
|
|
pythonPackages.chardet
|
|
|
|
pythonPackages.cherrypy
|
|
|
|
pythonPackages.cryptography
|
|
|
|
pythonPackages.libnacl
|
|
|
|
pythonPackages.configobj
|
|
|
|
pythonPackages.matplotlib
|
|
|
|
pythonPackages.plyvel
|
|
|
|
pythonPackages.decorator
|
|
|
|
pythonPackages.feedparser
|
2017-09-10 11:06:01 +01:00
|
|
|
pythonPackages.service-identity
|
2017-10-17 11:48:17 +01:00
|
|
|
pythonPackages.psutil
|
|
|
|
pythonPackages.meliae
|
2018-04-13 16:09:47 +01:00
|
|
|
pythonPackages.sip
|
2015-07-11 23:09:46 +01:00
|
|
|
];
|
2011-05-03 18:12:31 +01:00
|
|
|
|
2017-03-22 00:01:51 +00:00
|
|
|
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'"
|
|
|
|
''}
|
|
|
|
'';
|
2011-05-03 18:12:31 +01:00
|
|
|
|
2017-03-22 00:01:51 +00:00
|
|
|
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 \
|
2017-09-10 11:06:01 +01:00
|
|
|
--set QT_QPA_PLATFORM_PLUGIN_PATH ${qt5.qtbase.bin}/lib/qt-*/plugins/platforms \
|
2017-03-22 00:01:51 +00:00
|
|
|
--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
|
|
|
|
''}
|
|
|
|
'';
|
2011-05-03 18:12:31 +01:00
|
|
|
|
2017-03-22 00:01:51 +00:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
maintainers = with maintainers; [ xvapx ];
|
2018-01-05 19:42:46 +00:00
|
|
|
homepage = https://www.tribler.org/;
|
2011-05-03 18:12:31 +01:00
|
|
|
description = "A completely decentralised P2P filesharing client based on the Bittorrent protocol";
|
2017-03-22 00:01:51 +00:00
|
|
|
license = licenses.lgpl21;
|
|
|
|
platforms = platforms.linux;
|
2011-05-03 18:12:31 +01:00
|
|
|
};
|
|
|
|
}
|