From a3b565f7a302a615069e6ee90ba026cab2383ae8 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Wed, 24 Sep 2014 12:13:54 +0200 Subject: [PATCH 1/2] idea: hack to get fsnotifier working more information: https://bugs.archlinux.org/task/34703 --- pkgs/applications/editors/idea/default.nix | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pkgs/applications/editors/idea/default.nix b/pkgs/applications/editors/idea/default.nix index ab0d5fea018f..5727cd12dc77 100644 --- a/pkgs/applications/editors/idea/default.nix +++ b/pkgs/applications/editors/idea/default.nix @@ -27,16 +27,33 @@ let buildInputs = [ makeWrapper patchelf p7zip ]; 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" From e223bc046cb899d5b72bc18a9b3a99c7175e4912 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Wed, 24 Sep 2014 12:13:55 +0200 Subject: [PATCH 2/2] android-studio: new package --- pkgs/applications/editors/idea/default.nix | 35 ++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/editors/idea/default.nix b/pkgs/applications/editors/idea/default.nix index 5727cd12dc77..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,7 +24,7 @@ let icon = loName; }; - buildInputs = [ makeWrapper patchelf p7zip ]; + buildInputs = [ makeWrapper patchelf p7zip unzip ]; patchPhase = '' @@ -79,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; @@ -127,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";