@@ -1,5 +1,5 @@
11{ stdenv, fetchurl, makeDesktopItem, makeWrapper, patchelf, p7zip, jdk
2−, coreutils, gnugrep, which, git, python, unzip
2+, coreutils, gnugrep, which, git, python, unzip, androidsdk
33}:
44
55assert stdenv.isLinux;
@@ -54,25 +54,26 @@ let
5454 '';
5555
5656 installPhase = ''
57− mkdir -vp $out/{bin,$name,share/pixmaps,libexec/${name}}
58− cp -va . $out/$name
57+ mkdir -p $out/{bin,$name,share/pixmaps,libexec/${name}}
58+ cp -a . $out/$name
5959 ln -s $out/$name/bin/${loName}.png $out/share/pixmaps/${execName}.png
6060 mv bin/fsnotifier* $out/libexec/${name}/.
6161
6262 jdk=${jdk.home}
63+ item=${desktopItem}
6364
6465 makeWrapper "$out/$name/bin/${loName}.sh" "$out/bin/${execName}" \
6566 --prefix PATH : "$out/libexec/${name},${jdk}/bin:${coreutils}/bin:${gnugrep}/bin:${which}/bin:${git}/bin" \
6667 --prefix JDK_HOME : "$jdk" \
6768 --prefix ${hiName}_JDK : "$jdk"
6869
69− cp -a "${desktopItem}"/* "$out"
70+ ln -s "$item/share/applications" $out/share
7071 '';
7172
7273 };
7374
7475 buildAndroidStudio = { name, version, build, src, license, description }:
75− (mkIdeaProduct rec {
76+ let drv = (mkIdeaProduct rec {
7677 inherit name version build src;
7778 product = "Studio";
7879 meta = with stdenv.lib; {
@@ -88,6 +89,13 @@ let
8889 maintainers = with maintainers; [ edwtjo ];
8990 };
9091 });
92+ in stdenv.lib.overrideDerivation drv (x : {
93+ buildInputs = x.buildInputs ++ [ makeWrapper ];
94+ installPhase = x.installPhase + ''
95+ wrapProgram "$out/bin/android-studio" \
96+ --set ANDROID_HOME "${androidsdk}/libexec/android-sdk-linux/"
97+ '';
98+ });
9199
92100 buildClion = { name, version, build, src, license, description }:
93101 (mkIdeaProduct rec {
@@ -185,14 +193,14 @@ in
185193
186194 android-studio = buildAndroidStudio rec {
187195 name = "android-studio-${version}";
188− version = "1.1.0b2";
189− build = "135.1711524";
196+ version = "1.1.0";
197+ build = "135.1740770";
190198 description = "Android development environment based on IntelliJ IDEA";
191199 license = stdenv.lib.licenses.asl20;
192200 src = fetchurl {
193201 url = "https://dl.google.com/dl/android/studio/ide-zips/${version}" +
194202 "/android-studio-ide-${build}-linux.zip";
195− sha256 = "0pkmyk7ipd4bfbryhanak5mq3x8ix1yv4czx8yi9vdpa34b6pnkw";
203+ sha256 = "1r2hrld3yfaxq3mw2xmzhvrrhc7w5xlv3d18rv758hy9n40c2nr1";
196204 };
197205 };
198206