diff --git a/pkgs/applications/editors/idea/default.nix b/pkgs/applications/editors/idea/default.nix index ab0d5fea018f..f67f23e9e09b 100644 --- a/pkgs/applications/editors/idea/default.nix +++ b/pkgs/applications/editors/idea/default.nix @@ -1,5 +1,5 @@ { stdenv, fetchurl, makeDesktopItem, makeWrapper, patchelf, p7zip, jdk -, coreutils, gnugrep, which, git, python +, coreutils, gnugrep, which, git, python, unzip }: assert stdenv.isLinux; @@ -24,19 +24,36 @@ let icon = loName; }; - buildInputs = [ makeWrapper patchelf p7zip ]; + buildInputs = [ makeWrapper patchelf p7zip unzip ]; patchPhase = '' + + get_file_size() { + local fname="$1" + echo $(ls -l $fname | cut -d ' ' -f5) + } + + munge_size_hack() { + local fname="$1" + local size="$2" + strip $fname + truncate --size=$size $fname + } + interpreter=$(echo ${stdenv.glibc}/lib/ld-linux*.so.2) snappyPath="lib/snappy-java-1.0.5" 7z x -o"$snappyPath" "$snappyPath.jar" if [ "${stdenv.system}" == "x86_64-linux" ]; then + target_size=$(get_file_size bin/fsnotifier64) patchelf --set-interpreter "$interpreter" bin/fsnotifier64 patchelf --set-rpath ${stdenv.gcc.gcc}/lib64/ "$snappyPath/org/xerial/snappy/native/Linux/amd64/libsnappyjava.so" + munge_size_hack bin/fsnotifier64 $target_size else + target_size=$(get_file_size bin/fsnotifier) patchelf --set-interpreter "$interpreter" bin/fsnotifier patchelf --set-rpath ${stdenv.gcc.gcc}/lib/ "$snappyPath/org/xerial/snappy/native/Linux/i386/libsnappyjava.so" + munge_size_hack bin/fsnotifier $target_size fi 7z a -tzip "$snappyPath.jar" ./"$snappyPath"/* rm -vr "$snappyPath" @@ -62,6 +79,24 @@ let }; + buildAndroidStudio = { name, version, build, src, license, description }: + (mkIdeaProduct rec { + inherit name version build src; + product = "Studio"; + meta = with stdenv.lib; { + homepage = https://developer.android.com/sdk/installing/studio.html; + inherit description license; + longDescription = '' + Android development environment based on IntelliJ + IDEA providing new features and improvements over + Eclipse ADT and will be the official Android IDE + once it's ready. + ''; + platforms = platforms.linux; + maintainers = with maintainers; [ edwtjo ]; + }; + }); + buildPycharm = { name, version, build, src, license, description }: (mkIdeaProduct rec { inherit name version build src; @@ -110,6 +145,19 @@ in { + android-studio = buildAndroidStudio rec { + name = "android-studio-${version}"; + version = "0.8.10"; + build = "135.1428667"; + description = "Android development environment based on IntelliJ IDEA"; + license = stdenv.lib.licenses.asl20; + src = fetchurl { + url = "https://dl.google.com/dl/android/studio/ide-zips/${version}" + + "/android-studio-ide-${build}-linux.zip"; + sha256 = "5736a92ffda24233026ff45a47f1b4f9567ba40347cfa0c9f351112e729b5401"; + }; + }; + idea-community = buildIdea rec { name = "idea-community-${version}"; version = "13.1.4b";