2021-02-18 15:58:04 +00:00
|
|
|
{ stdenv, fetchurl, python3Packages, makeWrapper
|
|
|
|
, enablePlayer ? true, libvlc, qt5, lib }:
|
2011-09-02 12:11:48 +01:00
|
|
|
|
2015-07-11 23:09:46 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "tribler";
|
2020-03-03 19:29:13 +00:00
|
|
|
version = "7.4.4";
|
2011-05-03 18:12:31 +01:00
|
|
|
|
2017-09-10 11:06:01 +01:00
|
|
|
src = fetchurl {
|
2019-11-25 19:32:28 +00:00
|
|
|
url = "https://github.com/Tribler/tribler/releases/download/v${version}/Tribler-v${version}.tar.xz";
|
2020-03-03 19:29:13 +00:00
|
|
|
sha256 = "0hxiyf1k07ngym2p8r1b5mcx1y2crkyz43gi9sgvsvsyijyaff3p";
|
2011-05-03 18:12:31 +01:00
|
|
|
};
|
|
|
|
|
2019-11-25 19:32:28 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
python3Packages.wrapPython
|
2015-07-11 23:09:46 +01:00
|
|
|
makeWrapper
|
2019-11-25 19:32:28 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
python3Packages.python
|
2015-07-11 23:09:46 +01:00
|
|
|
];
|
|
|
|
|
2021-01-03 08:22:27 +00:00
|
|
|
pythonPath = with python3Packages; [
|
|
|
|
libtorrent-rasterbar
|
|
|
|
twisted
|
|
|
|
netifaces
|
|
|
|
pycrypto
|
|
|
|
pyasn1
|
|
|
|
requests
|
|
|
|
m2crypto
|
|
|
|
pyqt5
|
|
|
|
chardet
|
|
|
|
cherrypy
|
|
|
|
cryptography
|
|
|
|
libnacl
|
|
|
|
configobj
|
|
|
|
decorator
|
|
|
|
feedparser
|
|
|
|
service-identity
|
|
|
|
psutil
|
|
|
|
pillow
|
|
|
|
networkx
|
|
|
|
pony
|
|
|
|
lz4
|
|
|
|
pyqtgraph
|
2019-11-25 19:32:28 +00:00
|
|
|
|
|
|
|
# there is a BTC feature, but it requires some unclear version of
|
|
|
|
# bitcoinlib, so this doesn't work right now.
|
2021-01-03 08:22:27 +00:00
|
|
|
# bitcoinlib
|
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 = ''
|
2021-01-15 13:21:58 +00:00
|
|
|
${lib.optionalString enablePlayer ''
|
2020-09-25 16:53:34 +01:00
|
|
|
substituteInPlace "./TriblerGUI/vlc.py" --replace "ctypes.CDLL(p)" "ctypes.CDLL('${libvlc}/lib/libvlc.so')"
|
2021-01-03 08:22:27 +00:00
|
|
|
substituteInPlace "./TriblerGUI/widgets/videoplayerpage.py" \
|
|
|
|
--replace "if vlc and vlc.plugin_path" "if vlc" \
|
|
|
|
--replace "os.environ['VLC_PLUGIN_PATH'] = vlc.plugin_path" "os.environ['VLC_PLUGIN_PATH'] = '${libvlc}/lib/vlc/plugins'"
|
2017-03-22 00:01:51 +00:00
|
|
|
''}
|
|
|
|
'';
|
2011-05-03 18:12:31 +01:00
|
|
|
|
2017-03-22 00:01:51 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -pv $out
|
|
|
|
# Nasty hack; call wrapPythonPrograms to set program_PYTHONPATH.
|
|
|
|
wrapPythonPrograms
|
|
|
|
cp -prvd ./* $out/
|
2019-11-25 19:32:28 +00:00
|
|
|
makeWrapper ${python3Packages.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" \
|
2021-01-15 13:21:58 +00:00
|
|
|
${lib.optionalString enablePlayer ''
|
2020-09-25 16:53:34 +01:00
|
|
|
--prefix LD_LIBRARY_PATH : ${libvlc}/lib
|
2017-03-22 00:01:51 +00:00
|
|
|
''}
|
2020-03-16 20:37:41 +00:00
|
|
|
|
|
|
|
mkdir -p $out/share/applications $out/share/icons $out/share/man/man1
|
|
|
|
cp $out/Tribler/Main/Build/Ubuntu/tribler.desktop $out/share/applications/tribler.desktop
|
|
|
|
cp $out/Tribler/Main/Build/Ubuntu/tribler_big.xpm $out/share/icons/tribler.xpm
|
|
|
|
cp $out/Tribler/Main/Build/Ubuntu/tribler.1 $out/share/man/man1/tribler.1
|
2017-03-22 00:01:51 +00:00
|
|
|
'';
|
2011-05-03 18:12:31 +01:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2017-03-22 00:01:51 +00:00
|
|
|
maintainers = with maintainers; [ xvapx ];
|
2020-03-03 19:29:13 +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
|
|
|
};
|
|
|
|
}
|