Merge pull request #4712 from schristo/phpstorm
IDEA Editor: Adds PHPStorm support
This commit is contained in:
commit
8185b6bba3
@ -124,6 +124,7 @@
|
|||||||
rszibele = "Richard Szibele <richard_szibele@hotmail.com>";
|
rszibele = "Richard Szibele <richard_szibele@hotmail.com>";
|
||||||
rycee = "Robert Helgesson <robert@rycee.net>";
|
rycee = "Robert Helgesson <robert@rycee.net>";
|
||||||
sander = "Sander van der Burg <s.vanderburg@tudelft.nl>";
|
sander = "Sander van der Burg <s.vanderburg@tudelft.nl>";
|
||||||
|
schristo = "Scott Christopher <schristopher@konputa.com>";
|
||||||
sepi = "Raffael Mancini <raffael@mancini.lu>";
|
sepi = "Raffael Mancini <raffael@mancini.lu>";
|
||||||
shell = "Shell Turner <cam.turn@gmail.com>";
|
shell = "Shell Turner <cam.turn@gmail.com>";
|
||||||
shlevy = "Shea Levy <shea@shealevy.com>";
|
shlevy = "Shea Levy <shea@shealevy.com>";
|
||||||
|
@ -7,7 +7,7 @@ assert stdenv.isLinux;
|
|||||||
let
|
let
|
||||||
|
|
||||||
mkIdeaProduct =
|
mkIdeaProduct =
|
||||||
{ name, product, version, build, src, meta }:
|
{ name, product, version, build, src, meta, patchSnappy ? true }:
|
||||||
|
|
||||||
let loName = stdenv.lib.toLower product;
|
let loName = stdenv.lib.toLower product;
|
||||||
hiName = stdenv.lib.toUpper product; in
|
hiName = stdenv.lib.toUpper product; in
|
||||||
@ -26,8 +26,8 @@ let
|
|||||||
|
|
||||||
buildInputs = [ makeWrapper patchelf p7zip unzip ];
|
buildInputs = [ makeWrapper patchelf p7zip unzip ];
|
||||||
|
|
||||||
patchPhase = ''
|
patchPhase = lib.concatStringsSep "\n" [
|
||||||
|
''
|
||||||
get_file_size() {
|
get_file_size() {
|
||||||
local fname="$1"
|
local fname="$1"
|
||||||
echo $(ls -l $fname | cut -d ' ' -f5)
|
echo $(ls -l $fname | cut -d ' ' -f5)
|
||||||
@ -41,23 +41,29 @@ let
|
|||||||
}
|
}
|
||||||
|
|
||||||
interpreter=$(echo ${stdenv.glibc}/lib/ld-linux*.so.2)
|
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
|
if [ "${stdenv.system}" == "x86_64-linux" ]; then
|
||||||
target_size=$(get_file_size bin/fsnotifier64)
|
target_size=$(get_file_size bin/fsnotifier64)
|
||||||
patchelf --set-interpreter "$interpreter" 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
|
munge_size_hack bin/fsnotifier64 $target_size
|
||||||
else
|
else
|
||||||
target_size=$(get_file_size bin/fsnotifier)
|
target_size=$(get_file_size bin/fsnotifier)
|
||||||
patchelf --set-interpreter "$interpreter" 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
|
munge_size_hack bin/fsnotifier $target_size
|
||||||
fi
|
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"/*
|
7z a -tzip "$snappyPath.jar" ./"$snappyPath"/*
|
||||||
rm -vr "$snappyPath"
|
rm -vr "$snappyPath"
|
||||||
'';
|
'')
|
||||||
|
];
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -vp "$out/bin" "$out/$name" "$out/share/pixmaps"
|
mkdir -vp "$out/bin" "$out/$name" "$out/share/pixmaps"
|
||||||
@ -68,6 +74,12 @@ let
|
|||||||
&& jdk=${jdk}/lib/openjdk \
|
&& jdk=${jdk}/lib/openjdk \
|
||||||
|| jdk=${jdk}
|
|| 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}" \
|
makeWrapper "$out/$name/bin/${loName}.sh" "$out/bin/${loName}" \
|
||||||
--prefix PATH : "${jdk}/bin:${coreutils}/bin:${gnugrep}/bin:${which}/bin:${git}/bin" \
|
--prefix PATH : "${jdk}/bin:${coreutils}/bin:${gnugrep}/bin:${which}/bin:${git}/bin" \
|
||||||
--prefix LD_RUN_PATH : "${stdenv.gcc.gcc}/lib/" \
|
--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
|
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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user