49 tiling_wm ? false, # if we are using a tiling wm, need to set _JAVA_AWT_WM_NONREPARENTING in wrapper
53 drvName = "${pname}-${version}";
54 filename = "asfp-${version}-linux.deb";
56 androidStudioForPlatform = stdenv.mkDerivation {
57 name = "${drvName}-unwrapped";
60 url = "https://dl.google.com/android/asfp/${filename}";
70 cp -r "./opt/${pname}/" $out
71 wrapProgram $out/bin/studio.sh \
72 --set-default JAVA_HOME "$out/jbr" \
73 --set QT_XKB_CONFIG_ROOT "${xkeyboard_config}/share/X11/xkb" \
74 ${lib.optionalString tiling_wm "--set _JAVA_AWT_WM_NONREPARENTING 1"} \
75 --set FONTCONFIG_FILE ${fontsConf} \
79 # Checked in studio.sh
86 # Used during setup wizard
104 --prefix LD_LIBRARY_PATH : "${
105 lib.makeLibraryPath [
106 # Crash at startup without these
115 # Support multiple monitors
129 desktopItem = makeDesktopItem {
133 desktopName = "Android Studio for Platform (${channel} channel)";
134 comment = "The official Android IDE for Android platform development";
139 startupNotify = true;
140 startupWMClass = "jetbrains-studio";
143 # Android Studio for Platform downloads prebuilt binaries as part of the SDK. These tools
144 # (e.g. `mksdcard`) have `/lib/ld-linux.so.2` set as the interpreter. An FHS
145 # environment is used as a work around for that.
146 fhsEnv = buildFHSEnv {
147 pname = "${drvName}-fhs-env";
155 export ALLOW_NINJA_ENV=true
156 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib:/usr/lib32
164 ${fhsEnv}/bin/${drvName}-fhs-env ${androidStudioForPlatform}/bin/studio.sh "$@"
166 preferLocalBuild = true;
167 allowSubstitutes = false;
169 unwrapped = androidStudioForPlatform;
172 description = "The Official IDE for Android platform development";
174 Android Studio for Platform (ASfP) is the version of the Android Studio IDE
175 for Android Open Source Project (AOSP) platform developers who build with the Soong build system.
177 homepage = "https://developer.android.com/studio/platform.html";
178 license = with licenses; [
181 ]; # The code is under Apache-2.0, but:
182 # If one selects Help -> Licenses in Android Studio, the dialog shows the following:
183 # "Android Studio includes proprietary code subject to separate license,
184 # including JetBrains CLion(R) (www.jetbrains.com/clion) and IntelliJ(R)
185 # IDEA Community Edition (www.jetbrains.com/idea)."
186 # Also: For actual development the Android SDK is required and the Google
187 # binaries are also distributed as proprietary software (unlike the
188 # source-code itself).
189 platforms = [ "x86_64-linux" ];
190 maintainers = with maintainers; [ robbins ];
195 mkdir -p $out/{bin,share/pixmaps}
197 echo -n "$startScript" > $out/bin/${pname}
198 chmod +x $out/bin/${pname}
200 ln -s ${androidStudioForPlatform}/bin/studio.png $out/share/pixmaps/${pname}.png
201 ln -s ${desktopItem}/share/applications $out/share/applications