1{
2 lib,
3 stdenv,
4 fetchurl,
5 jre,
6 makeWrapper,
7}:
8
9stdenv.mkDerivation rec {
10 version = "6.13.3";
11 pname = "frostwire";
12
13 src = fetchurl {
14 url = "https://github.com/frostwire/frostwire/releases/download/frostwire-desktop-${version}-build-322/frostwire-${version}.amd64.tar.gz";
15 hash = "sha256-wRT8Oo+niOFBpEnq3pgjO9jpagZMgSE44V9RBYnGwig=";
16 };
17
18 nativeBuildInputs = [ makeWrapper ];
19
20 installPhase = ''
21 runHook preInstall
22
23 mkdir -p $out/share/java
24 mv $(ls */*.jar) $out/share/java
25
26 makeWrapper $out/share/java/frostwire $out/bin/frostwire \
27 --prefix PATH : ${jre}/bin \
28 --prefix LD_LIBRARY_PATH : $out/share/java \
29 --set JAVA_HOME "${jre}"
30
31 substituteInPlace $out/share/java/frostwire \
32 --replace "export JAVA_PROGRAM_DIR=/usr/lib/frostwire/jre/bin" \
33 "export JAVA_PROGRAM_DIR=${jre}/bin/"
34
35 substituteInPlace $out/share/java/frostwire.desktop \
36 --replace "Exec=/usr/bin/frostwire %U" "Exec=${placeholder "out"}/bin/frostwire %U"
37
38 runHook postInstall
39 '';
40
41 meta = with lib; {
42 homepage = "https://www.frostwire.com/";
43 description = "BitTorrent Client and Cloud File Downloader";
44 mainProgram = "frostwire";
45 sourceProvenance = with sourceTypes; [
46 binaryBytecode
47 binaryNativeCode
48 ];
49 license = licenses.gpl3Plus;
50 maintainers = with maintainers; [ gavin ];
51 platforms = [ "x86_64-linux" ];
52 };
53}