From 4e513cbc9fbc0fc0ead6f8f897fcc73d544a62be Mon Sep 17 00:00:00 2001 From: Hoang Xuan Phu Date: Wed, 28 Dec 2016 20:28:35 +0800 Subject: [PATCH 1/4] android-studio: no need for jdk anymore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Android Studio now bundles its own JDK ¯\_(ツ)_/¯ --- pkgs/applications/editors/android-studio/default.nix | 2 -- pkgs/top-level/all-packages.nix | 11 ----------- 2 files changed, 13 deletions(-) diff --git a/pkgs/applications/editors/android-studio/default.nix b/pkgs/applications/editors/android-studio/default.nix index 2e14ae339cf..eb2d27c6139 100644 --- a/pkgs/applications/editors/android-studio/default.nix +++ b/pkgs/applications/editors/android-studio/default.nix @@ -9,7 +9,6 @@ , gnugrep , gnutar , gzip -, jdk , fontconfig , freetype , libpulseaudio @@ -50,7 +49,6 @@ let coreutils findutils gnugrep - jdk which # For Android emulator diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 52e4194fab1..0f2f9186562 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12322,17 +12322,6 @@ in amsn = callPackage ../applications/networking/instant-messengers/amsn { }; - # Oracle JDK is recommended upstream, but unfree and requires a manual - # download. OpenJDK is straightforward, but may suffer from compatibility - # problems e.g. https://code.google.com/p/android/issues/detail?id=174496. - # To use Oracle JDK add an override to ~/.nixpkgs/config.nix: - # { - # packageOverrides = pkgs: { - # android-studio = pkgs.android-studio.override { - # jdk = pkgs.oraclejdk8; - # }; - # }; - # } android-studio = callPackage ../applications/editors/android-studio { inherit (xorg) libX11 libXext libXi libXrandr libXrender libXtst; }; From 1f67c179acb8b2d9b711d38b4ddd2103f386589f Mon Sep 17 00:00:00 2001 From: Hoang Xuan Phu Date: Wed, 28 Dec 2016 20:31:19 +0800 Subject: [PATCH 2/4] android-studio: rearrange dependencies --- .../editors/android-studio/default.nix | 15 +++++++++------ pkgs/top-level/all-packages.nix | 1 - 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/editors/android-studio/default.nix b/pkgs/applications/editors/android-studio/default.nix index eb2d27c6139..ac8140a845c 100644 --- a/pkgs/applications/editors/android-studio/default.nix +++ b/pkgs/applications/editors/android-studio/default.nix @@ -65,6 +65,15 @@ let git ]}" --prefix LD_LIBRARY_PATH : "${stdenv.lib.makeLibraryPath [ + + # Crash at startup without these + fontconfig + freetype + libXext + libXi + libXrender + libXtst + # Gradle wants libstdc++.so.6 stdenv.cc.cc.lib # mksdcard wants 32 bit libstdc++.so.6 @@ -79,12 +88,6 @@ let # For Android emulator libpulseaudio libX11 - libXext - libXrender - libXtst - libXi - freetype - fontconfig ]}" --set QT_XKB_CONFIG_ROOT "${xkeyboard_config}/share/X11/xkb" ''; src = fetchurl { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0f2f9186562..7c4039c374f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12323,7 +12323,6 @@ in amsn = callPackage ../applications/networking/instant-messengers/amsn { }; android-studio = callPackage ../applications/editors/android-studio { - inherit (xorg) libX11 libXext libXi libXrandr libXrender libXtst; }; antimony = qt5.callPackage ../applications/graphics/antimony {}; From d849f00af52c0cebe8d09e026d9871b9a2a175ca Mon Sep 17 00:00:00 2001 From: Hoang Xuan Phu Date: Wed, 28 Dec 2016 20:34:50 +0800 Subject: [PATCH 3/4] android-studio: reindent wrapProgram parameters --- .../editors/android-studio/default.nix | 78 ++++++++++--------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/pkgs/applications/editors/android-studio/default.nix b/pkgs/applications/editors/android-studio/default.nix index ac8140a845c..abb93d745a6 100644 --- a/pkgs/applications/editors/android-studio/default.nix +++ b/pkgs/applications/editors/android-studio/default.nix @@ -43,52 +43,56 @@ let ]; installPhase = '' cp -r . $out - wrapProgram $out/bin/studio.sh --set PATH "${stdenv.lib.makeBinPath [ + wrapProgram $out/bin/studio.sh \ + --set PATH "${stdenv.lib.makeBinPath [ - # Checked in studio.sh - coreutils - findutils - gnugrep - which + # Checked in studio.sh + coreutils + findutils + gnugrep + which - # For Android emulator - file - glxinfo - pciutils - setxkbmap + # For Android emulator + file + glxinfo + pciutils + setxkbmap - # Used during setup wizard - gnutar - gzip + # Used during setup wizard + gnutar + gzip - # Runtime stuff - git + # Runtime stuff + git - ]}" --prefix LD_LIBRARY_PATH : "${stdenv.lib.makeLibraryPath [ + ]}" \ + --prefix LD_LIBRARY_PATH : "${stdenv.lib.makeLibraryPath [ - # Crash at startup without these - fontconfig - freetype - libXext - libXi - libXrender - libXtst + # Crash at startup without these + fontconfig + freetype + libXext + libXi + libXrender + libXtst - # Gradle wants libstdc++.so.6 - stdenv.cc.cc.lib - # mksdcard wants 32 bit libstdc++.so.6 - pkgsi686Linux.stdenv.cc.cc.lib + # Gradle wants libstdc++.so.6 + stdenv.cc.cc.lib + # mksdcard wants 32 bit libstdc++.so.6 + pkgsi686Linux.stdenv.cc.cc.lib - # aapt wants libz.so.1 - zlib - pkgsi686Linux.zlib - # Support multiple monitors - libXrandr + # aapt wants libz.so.1 + zlib + pkgsi686Linux.zlib + # Support multiple monitors + libXrandr - # For Android emulator - libpulseaudio - libX11 - ]}" --set QT_XKB_CONFIG_ROOT "${xkeyboard_config}/share/X11/xkb" + # For Android emulator + libpulseaudio + libX11 + + ]}" \ + --set QT_XKB_CONFIG_ROOT "${xkeyboard_config}/share/X11/xkb" ''; src = fetchurl { url = "https://dl.google.com/dl/android/studio/ide-zips/${version}/android-studio-ide-${build}-linux.zip"; From 4b3f79b3ca0f1aa771c5838c030f72bdd159d343 Mon Sep 17 00:00:00 2001 From: Hoang Xuan Phu Date: Wed, 28 Dec 2016 20:37:03 +0800 Subject: [PATCH 4/4] android-studio: use a dedicated fontconfig file --- pkgs/applications/editors/android-studio/default.nix | 4 +++- pkgs/top-level/all-packages.nix | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/editors/android-studio/default.nix b/pkgs/applications/editors/android-studio/default.nix index abb93d745a6..28b6b2b85ad 100644 --- a/pkgs/applications/editors/android-studio/default.nix +++ b/pkgs/applications/editors/android-studio/default.nix @@ -28,6 +28,7 @@ , writeTextFile , xkeyboard_config , zlib +, fontsConf }: let @@ -92,7 +93,8 @@ let libX11 ]}" \ - --set QT_XKB_CONFIG_ROOT "${xkeyboard_config}/share/X11/xkb" + --set QT_XKB_CONFIG_ROOT "${xkeyboard_config}/share/X11/xkb" \ + --set FONTCONFIG_FILE ${fontsConf} ''; src = fetchurl { url = "https://dl.google.com/dl/android/studio/ide-zips/${version}/android-studio-ide-${build}-linux.zip"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7c4039c374f..a63f419b3e0 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12323,6 +12323,9 @@ in amsn = callPackage ../applications/networking/instant-messengers/amsn { }; android-studio = callPackage ../applications/editors/android-studio { + fontsConf = makeFontsConf { + fontDirectories = []; + }; }; antimony = qt5.callPackage ../applications/graphics/antimony {};