androidStudioPackages: Use more intuitive names for the derivations

This commit is contained in:
Michael Weiss 2018-08-01 18:40:07 +02:00
parent 31583d7cb6
commit d8b44edd8f
2 changed files with 7 additions and 7 deletions

View File

@ -37,8 +37,9 @@
}: }:
let let
drvName = "android-studio-${channel}-${version}";
androidStudio = stdenv.mkDerivation { androidStudio = stdenv.mkDerivation {
name = "${pname}-${version}"; name = drvName;
src = fetchurl { src = fetchurl {
url = "https://dl.google.com/dl/android/studio/ide-zips/${version}/android-studio-ide-${build}-linux.zip"; url = "https://dl.google.com/dl/android/studio/ide-zips/${version}/android-studio-ide-${build}-linux.zip";
@ -116,18 +117,19 @@ let
# (e.g. `mksdcard`) have `/lib/ld-linux.so.2` set as the interpreter. An FHS # (e.g. `mksdcard`) have `/lib/ld-linux.so.2` set as the interpreter. An FHS
# environment is used as a work around for that. # environment is used as a work around for that.
fhsEnv = buildFHSUserEnv { fhsEnv = buildFHSUserEnv {
name = "${pname}-fhs-env"; name = "${drvName}-fhs-env";
multiPkgs = pkgs: [ pkgs.ncurses5 ]; multiPkgs = pkgs: [ pkgs.ncurses5 ];
}; };
in in
writeTextFile { writeTextFile {
name = "${pname}-${version}"; name = "${drvName}-wrapper";
# TODO: Rename preview -> beta (and add -stable suffix?):
destination = "/bin/${pname}"; destination = "/bin/${pname}";
executable = true; executable = true;
text = '' text = ''
#!${bash}/bin/bash #!${bash}/bin/bash
${fhsEnv}/bin/${pname}-fhs-env ${androidStudio}/bin/studio.sh ${fhsEnv}/bin/${drvName}-fhs-env ${androidStudio}/bin/studio.sh
''; '';
} // { } // {
meta = with stdenv.lib; { meta = with stdenv.lib; {

View File

@ -26,18 +26,16 @@ in rec {
# Old alias # Old alias
preview = beta; preview = beta;
# Attributes are named by the corresponding release channels # Attributes are named by their corresponding release channels
stable = mkStudio (stableVersion // { stable = mkStudio (stableVersion // {
channel = "stable"; channel = "stable";
pname = "android-studio"; pname = "android-studio";
#pname = "android-studio-stable"; # TODO: Rename and provide symlink
}); });
beta = mkStudio (betaVersion // { beta = mkStudio (betaVersion // {
channel = "beta"; channel = "beta";
pname = "android-studio-preview"; pname = "android-studio-preview";
#pname = "android-studio-beta"; # TODO: Rename and provide symlink
}); });
dev = mkStudio (latestVersion // { dev = mkStudio (latestVersion // {