diff options
Diffstat (limited to 'pkgs/applications/editors/android-studio/common.nix')
-rw-r--r-- | pkgs/applications/editors/android-studio/common.nix | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/pkgs/applications/editors/android-studio/common.nix b/pkgs/applications/editors/android-studio/common.nix index 8a536bad9c48..cd031ce5ac8c 100644 --- a/pkgs/applications/editors/android-studio/common.nix +++ b/pkgs/applications/editors/android-studio/common.nix @@ -1,4 +1,5 @@ -{ pname, version, build, sha256Hash, meta }: +{ channel, pname, version, build, sha256Hash }: + { bash , buildFHSUserEnv , coreutils @@ -36,8 +37,9 @@ }: let + drvName = "android-studio-${channel}-${version}"; androidStudio = stdenv.mkDerivation { - name = "${pname}-${version}"; + name = drvName; src = fetchurl { url = "https://dl.google.com/dl/android/studio/ide-zips/${version}/android-studio-ide-${build}-linux.zip"; @@ -115,17 +117,32 @@ let # (e.g. `mksdcard`) have `/lib/ld-linux.so.2` set as the interpreter. An FHS # environment is used as a work around for that. fhsEnv = buildFHSUserEnv { - name = "${pname}-fhs-env"; + name = "${drvName}-fhs-env"; multiPkgs = pkgs: [ pkgs.ncurses5 ]; }; in writeTextFile { - name = "${pname}-${version}"; + name = "${drvName}-wrapper"; + # TODO: Rename preview -> beta (and add -stable suffix?): destination = "/bin/${pname}"; executable = true; text = '' #!${bash}/bin/bash - ${fhsEnv}/bin/${pname}-fhs-env ${androidStudio}/bin/studio.sh + ${fhsEnv}/bin/${drvName}-fhs-env ${androidStudio}/bin/studio.sh ''; - } // { inherit meta; } + } // { + meta = with stdenv.lib; { + description = "The Official IDE for Android (${channel} channel)"; + longDescription = '' + Android Studio is the official IDE for Android app development, based on + IntelliJ IDEA. + ''; + homepage = if channel == "stable" + then https://developer.android.com/studio/index.html + else https://developer.android.com/studio/preview/index.html; + license = licenses.asl20; + platforms = [ "x86_64-linux" ]; + maintainers = with maintainers; [ primeos ]; + }; + } |