2013-10-10 03:36:43 +00:00
|
|
|
{ stdenv, fetchurl, readline, patchelf, ncurses, qt48, libidn, expat, flac
|
|
|
|
, libvorbis }:
|
|
|
|
|
2015-09-20 13:07:46 +00:00
|
|
|
assert stdenv.system == "x86_64-linux" || stdenv.system == "i686-linux";
|
2015-06-06 17:42:37 +00:00
|
|
|
let
|
|
|
|
archUrl = name: arch: "http://dl.google.com/linux/musicmanager/deb/pool/main/g/google-musicmanager-beta/${name}_${arch}.deb";
|
|
|
|
in
|
2013-10-10 03:36:43 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2015-12-14 01:45:11 +00:00
|
|
|
version = "beta_1.0.243.1116-r0"; # friendly to nix-env version sorting algo
|
2013-10-10 03:36:43 +00: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 03:36:43 +00:00
|
|
|
# which will contain the links to all available *.debs for the arch.
|
|
|
|
|
|
|
|
src = if stdenv.system == "x86_64-linux"
|
|
|
|
then fetchurl {
|
2015-06-06 17:42:37 +00:00
|
|
|
url = archUrl name "amd64";
|
2015-12-14 01:45:11 +00:00
|
|
|
sha256 = "54f97f449136e173492d36084f2c01244b84f02d6e223fb8a40661093e0bec7c";
|
2013-10-10 03:36:43 +00:00
|
|
|
}
|
|
|
|
else fetchurl {
|
2015-06-06 17:42:37 +00:00
|
|
|
url = archUrl name "i386";
|
2015-12-14 01:45:11 +00:00
|
|
|
sha256 = "121a7939015e2270afa3f1c73554102e2b4f2e6a31482ff7be5e7c28dd101d3c";
|
2013-10-10 03:36:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
unpackPhase = ''
|
|
|
|
ar vx ${src}
|
|
|
|
tar -xvf data.tar.lzma
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildInputs = [ patchelf ];
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
patchelf \
|
2014-12-17 18:11:30 +00:00
|
|
|
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
2015-10-05 18:32:54 +00:00
|
|
|
--set-rpath "$out/opt/google/musicmanager:${stdenv.lib.makeLibraryPath [ readline ncurses stdenv.cc.libc.out qt48 stdenv.cc.cc libidn expat flac libvorbis ]}" opt/google/musicmanager/MusicManager
|
2013-10-10 03:36:43 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
dontPatchELF = true;
|
|
|
|
dontStrip = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p "$out"
|
|
|
|
cp -r opt "$out"
|
|
|
|
mkdir "$out/bin"
|
|
|
|
ln -s "$out/opt/google/musicmanager/google-musicmanager" "$out/bin"
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|