2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchurl
|
2018-08-19 15:15:34 +01:00
|
|
|
, flac, expat, libidn, qtbase, qtwebkit, libvorbis }:
|
2018-08-20 20:11:29 +01:00
|
|
|
assert stdenv.hostPlatform.system == "x86_64-linux";
|
2013-10-10 04:36:43 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2018-08-19 15:15:34 +01:00
|
|
|
version = "beta_1.0.467.4929-r0"; # friendly to nix-env version sorting algo
|
2013-10-10 04:36:43 +01:00
|
|
|
product = "google-musicmanager";
|
|
|
|
name = "${product}-${version}";
|
|
|
|
|
|
|
|
# When looking for newer versions, since google doesn't let you list their repo dirs,
|
|
|
|
# curl http://dl.google.com/linux/musicmanager/deb/dists/stable/Release
|
2015-12-14 01:45:11 +00:00
|
|
|
# fetch an appropriate packages file such as main/binary-amd64/Packages:
|
|
|
|
# curl http://dl.google.com/linux/musicmanager/deb/dists/stable/main/binary-amd64/Packages
|
2013-10-10 04:36:43 +01:00
|
|
|
# which will contain the links to all available *.debs for the arch.
|
|
|
|
|
2018-08-19 15:15:34 +01:00
|
|
|
src = fetchurl {
|
|
|
|
url = "http://dl.google.com/linux/musicmanager/deb/pool/main/g/google-musicmanager-beta/${name}_amd64.deb";
|
|
|
|
sha256 = "0yaprpbp44var88kdj1h11fqkhgcklixr69jyia49v9m22529gg2";
|
|
|
|
};
|
2013-10-10 04:36:43 +01:00
|
|
|
|
|
|
|
unpackPhase = ''
|
|
|
|
ar vx ${src}
|
2018-08-19 15:15:34 +01:00
|
|
|
tar xvf data.tar.xz
|
|
|
|
tar xvf control.tar.gz
|
2013-10-10 04:36:43 +01:00
|
|
|
'';
|
|
|
|
|
2018-08-19 15:15:34 +01:00
|
|
|
prePatch = ''
|
|
|
|
sed -i "s@\(Exec=\).*@\1$out/bin/google-musicmanager@" opt/google/musicmanager/google-musicmanager.desktop
|
|
|
|
'';
|
2013-10-10 04:36:43 +01:00
|
|
|
|
2018-08-19 15:15:34 +01:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
mkdir -p $out/lib
|
|
|
|
mkdir -p $out/share/applications
|
|
|
|
|
|
|
|
cp -r opt $out
|
|
|
|
find -name "*.so*" -exec cp "{}" $out/lib \;
|
|
|
|
ln -s $out/opt/google/musicmanager/google-musicmanager $out/bin
|
|
|
|
ln -s $out/opt/google/musicmanager/google-musicmanager.desktop $out/share/applications
|
|
|
|
|
|
|
|
for i in 16 32 48 128
|
|
|
|
do
|
|
|
|
iconDirectory=$out/usr/share/icons/hicolor/"$i"x"$i"/apps
|
|
|
|
|
|
|
|
mkdir -p $iconDirectory
|
|
|
|
ln -s $out/opt/google/musicmanager/product_logo_"$i".png $iconDirectory/google-musicmanager.png
|
|
|
|
done
|
2013-10-10 04:36:43 +01:00
|
|
|
'';
|
|
|
|
|
2018-08-19 15:15:34 +01:00
|
|
|
postFixup = ''
|
|
|
|
patchelf \
|
|
|
|
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
2021-01-15 13:21:58 +00:00
|
|
|
--set-rpath "$(patchelf --print-rpath $out/opt/google/musicmanager/minidump_upload):${lib.makeLibraryPath [ stdenv.cc.cc.lib ]}" \
|
2018-08-19 15:15:34 +01:00
|
|
|
$out/opt/google/musicmanager/minidump_upload
|
2013-10-10 04:36:43 +01:00
|
|
|
|
2018-08-19 15:15:34 +01:00
|
|
|
patchelf \
|
|
|
|
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
2021-01-15 13:21:58 +00:00
|
|
|
--set-rpath "$(patchelf --print-rpath $out/opt/google/musicmanager/MusicManager):$out/lib:${lib.makeLibraryPath [
|
2018-08-19 15:15:34 +01:00
|
|
|
flac
|
|
|
|
expat
|
|
|
|
libidn
|
|
|
|
qtbase
|
|
|
|
qtwebkit
|
|
|
|
libvorbis
|
|
|
|
stdenv.cc.cc.lib
|
|
|
|
]}" \
|
|
|
|
$out/opt/google/musicmanager/MusicManager
|
2013-10-10 04:36:43 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2013-10-10 04:36:43 +01:00
|
|
|
description = "Uploads music from your computer to Google Play";
|
|
|
|
homepage = "https://support.google.com/googleplay/answer/1229970";
|
|
|
|
license = licenses.unfree;
|
|
|
|
maintainers = with maintainers; [ lovek323 ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|