Merge pull request #21462 from phunehehe/android-studio

Fontconfig for Android Studio
This commit is contained in:
Graham Christensen 2017-01-10 20:05:42 -05:00 committed by GitHub
commit acc889f5ed
2 changed files with 48 additions and 50 deletions

View File

@ -9,7 +9,6 @@
, gnugrep , gnugrep
, gnutar , gnutar
, gzip , gzip
, jdk
, fontconfig , fontconfig
, freetype , freetype
, libpulseaudio , libpulseaudio
@ -29,6 +28,7 @@
, writeTextFile , writeTextFile
, xkeyboard_config , xkeyboard_config
, zlib , zlib
, fontsConf
}: }:
let let
@ -44,50 +44,57 @@ let
]; ];
installPhase = '' installPhase = ''
cp -r . $out 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 # Checked in studio.sh
coreutils coreutils
findutils findutils
gnugrep gnugrep
jdk which
which
# For Android emulator # For Android emulator
file file
glxinfo glxinfo
pciutils pciutils
setxkbmap setxkbmap
# Used during setup wizard # Used during setup wizard
gnutar gnutar
gzip gzip
# Runtime stuff # Runtime stuff
git git
]}" --prefix LD_LIBRARY_PATH : "${stdenv.lib.makeLibraryPath [ ]}" \
# Gradle wants libstdc++.so.6 --prefix LD_LIBRARY_PATH : "${stdenv.lib.makeLibraryPath [
stdenv.cc.cc.lib
# mksdcard wants 32 bit libstdc++.so.6
pkgsi686Linux.stdenv.cc.cc.lib
# aapt wants libz.so.1 # Crash at startup without these
zlib fontconfig
pkgsi686Linux.zlib freetype
# Support multiple monitors libXext
libXrandr libXi
libXrender
libXtst
# For Android emulator # Gradle wants libstdc++.so.6
libpulseaudio stdenv.cc.cc.lib
libX11 # mksdcard wants 32 bit libstdc++.so.6
libXext pkgsi686Linux.stdenv.cc.cc.lib
libXrender
libXtst # aapt wants libz.so.1
libXi zlib
freetype pkgsi686Linux.zlib
fontconfig # Support multiple monitors
]}" --set QT_XKB_CONFIG_ROOT "${xkeyboard_config}/share/X11/xkb" libXrandr
# For Android emulator
libpulseaudio
libX11
]}" \
--set QT_XKB_CONFIG_ROOT "${xkeyboard_config}/share/X11/xkb" \
--set FONTCONFIG_FILE ${fontsConf}
''; '';
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";

View File

@ -12361,19 +12361,10 @@ in
amsn = callPackage ../applications/networking/instant-messengers/amsn { }; 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 { android-studio = callPackage ../applications/editors/android-studio {
inherit (xorg) libX11 libXext libXi libXrandr libXrender libXtst; fontsConf = makeFontsConf {
fontDirectories = [];
};
}; };
antimony = qt5.callPackage ../applications/graphics/antimony {}; antimony = qt5.callPackage ../applications/graphics/antimony {};