summary refs log tree commit diff
path: root/pkgs/applications/editors
diff options
context:
space:
mode:
authorScott Christopher <schristopher@konputa.com>2014-10-30 21:48:09 +1100
committerScott Christopher <schristopher@konputa.com>2014-10-30 22:25:28 +1100
commit36308f6bbcb128a22e93a962a4888889401a07ae (patch)
treecf53df807e0ebf67f100b26512fc7c2152143e1a /pkgs/applications/editors
parent77afbf0bb9dae1ecf1307576eb59f240dcaa2f77 (diff)
downloadnixlib-36308f6bbcb128a22e93a962a4888889401a07ae.tar
nixlib-36308f6bbcb128a22e93a962a4888889401a07ae.tar.gz
nixlib-36308f6bbcb128a22e93a962a4888889401a07ae.tar.bz2
nixlib-36308f6bbcb128a22e93a962a4888889401a07ae.tar.lz
nixlib-36308f6bbcb128a22e93a962a4888889401a07ae.tar.xz
nixlib-36308f6bbcb128a22e93a962a4888889401a07ae.tar.zst
nixlib-36308f6bbcb128a22e93a962a4888889401a07ae.zip
IDEA Editor: Adds PHPStorm support.
Diffstat (limited to 'pkgs/applications/editors')
-rw-r--r--pkgs/applications/editors/idea/default.nix94
1 files changed, 68 insertions, 26 deletions
diff --git a/pkgs/applications/editors/idea/default.nix b/pkgs/applications/editors/idea/default.nix
index 5a9ad5e71606..7fbe58f1b292 100644
--- a/pkgs/applications/editors/idea/default.nix
+++ b/pkgs/applications/editors/idea/default.nix
@@ -7,7 +7,7 @@ assert stdenv.isLinux;
 let
 
   mkIdeaProduct =
-  { name, product, version, build, src, meta }:
+  { name, product, version, build, src, meta, patchSnappy ? true }:
 
   let loName = stdenv.lib.toLower product;
       hiName = stdenv.lib.toUpper product; in
@@ -26,38 +26,44 @@ let
 
     buildInputs = [ makeWrapper patchelf p7zip unzip ];
 
-    patchPhase = ''
-
-      get_file_size() {
+    patchPhase = lib.concatStringsSep "\n" [
+      ''
+        get_file_size() {
           local fname="$1"
           echo $(ls -l $fname | cut -d ' ' -f5)
-      }
+        }
 
-      munge_size_hack() {
+        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"
-    '';
+        }
+
+        interpreter=$(echo ${stdenv.glibc}/lib/ld-linux*.so.2)
+        if [ "${stdenv.system}" == "x86_64-linux" ]; then
+          target_size=$(get_file_size bin/fsnotifier64)
+          patchelf --set-interpreter "$interpreter" bin/fsnotifier64
+          munge_size_hack bin/fsnotifier64 $target_size
+        else
+          target_size=$(get_file_size bin/fsnotifier)
+          patchelf --set-interpreter "$interpreter" bin/fsnotifier
+          munge_size_hack bin/fsnotifier $target_size
+        fi
+      ''
+
+      (lib.optionalString patchSnappy ''
+        snappyPath="lib/snappy-java-1.0.5"
+        7z x -o"$snappyPath" "$snappyPath.jar"
+        if [ "${stdenv.system}" == "x86_64-linux" ]; then
+          patchelf --set-rpath ${stdenv.gcc.gcc}/lib64 "$snappyPath/org/xerial/snappy/native/Linux/amd64/libsnappyjava.so"
+        else
+          patchelf --set-rpath ${stdenv.gcc.gcc}/lib "$snappyPath/org/xerial/snappy/native/Linux/i386/libsnappyjava.so"
+        fi
+        7z a -tzip "$snappyPath.jar" ./"$snappyPath"/*
+        rm -vr "$snappyPath"
+      '')
+    ];
 
     installPhase = ''
       mkdir -vp "$out/bin" "$out/$name" "$out/share/pixmaps"
@@ -68,6 +74,12 @@ let
         && jdk=${jdk}/lib/openjdk \
         || jdk=${jdk}
 
+      if [ "${stdenv.system}" == "x86_64-linux" ]; then
+        makeWrapper "$out/$name/bin/fsnotifier64" "$out/bin/fsnotifier64"
+      else
+        makeWrapper "$out/$name/bin/fsnotifier" "$out/bin/fsnotifier"
+      fi
+
       makeWrapper "$out/$name/bin/${loName}.sh" "$out/bin/${loName}" \
         --prefix PATH : "${jdk}/bin:${coreutils}/bin:${gnugrep}/bin:${which}/bin:${git}/bin" \
         --prefix LD_RUN_PATH : "${stdenv.gcc.gcc}/lib/" \
@@ -141,6 +153,24 @@ let
       };
     });
 
+  buildPhpStorm = { name, version, build, src, license, description }:
+    (mkIdeaProduct {
+      inherit name version build src;
+      product = "PhpStorm";
+      patchSnappy = false;
+      meta = with stdenv.lib; {
+        homepage = "https://www.jetbrains.com/phpstorm/";
+        inherit description license;
+        longDescription = ''
+          PhpStorm provides an editor for PHP, HTML and JavaScript
+          with on-the-fly code analysis, error prevention and
+          automated refactorings for PHP and JavaScript code.
+        '';
+        maintainers = with maintainers; [ schristo ];
+        platforms = platforms.linux;
+      };
+    });
+
 in
 
 {
@@ -206,4 +236,16 @@ in
     };
   };
 
+  phpstorm = buildPhpStorm rec {
+    name = "phpstorm-${version}";
+    version = "8.0.1";
+    build = "PS-138.2001";
+    description = "Professional IDE for Web and PHP developers";
+    license = stdenv.lib.licenses.unfree;
+    src = fetchurl {
+      url = "http://download.jetbrains.com/webide/PhpStorm-${version}.tar.gz";
+      sha256 = "0d46442aa32174fe16846c3c31428178ab69b827d2e0ce31f633f13b64c01afc";
+    };
+  };
+
 }