nixpkgs/pkgs/applications/networking/p2p/tribler/default.nix

82 lines
2.6 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, pythonPackages, makeWrapper, imagemagick
, enablePlayer ? true, vlc ? null, qt5 }:
2015-07-11 22:09:46 +00:00
stdenv.mkDerivation rec {
2018-04-13 15:09:47 +00:00
name = "tribler-${version}";
2018-10-31 19:08:18 +00:00
version = "7.1.2";
src = fetchurl {
2018-10-31 19:08:18 +00:00
url = "https://github.com/Tribler/tribler/releases/download/v${version}/Tribler-v${version}.tar.gz";
sha256 = "1ayzqx4358qlx56hsnsn5s8xl6mzdb6nw4kwsalmp86dw6vmmis8";
};
2015-07-11 22:09:46 +00:00
buildInputs = [
pythonPackages.python
pythonPackages.wrapPython
makeWrapper
imagemagick
2015-07-11 22:09:46 +00:00
];
pythonPath = [
pythonPackages.libtorrentRasterbar
2015-07-11 22:09:46 +00:00
pythonPackages.apsw
pythonPackages.twisted
pythonPackages.netifaces
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
pythonPackages.service-identity
2017-10-17 10:48:17 +00:00
pythonPackages.psutil
pythonPackages.meliae
2018-04-13 15:09:47 +00:00
pythonPackages.sip
2018-10-31 19:08:18 +00:00
pythonPackages.pillow
pythonPackages.networkx
2015-07-11 22:09:46 +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'"
''}
'';
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 QT_QPA_PLATFORM_PLUGIN_PATH ${qt5.qtbase.bin}/lib/qt-*/plugins/platforms \
--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
''}
'';
meta = with stdenv.lib; {
maintainers = with maintainers; [ xvapx ];
homepage = https://www.tribler.org/;
description = "A completely decentralised P2P filesharing client based on the Bittorrent protocol";
license = licenses.lgpl21;
platforms = platforms.linux;
};
}