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,38 +26,44 @@ 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)
|
||||||
}
|
}
|
||||||
|
|
||||||
munge_size_hack() {
|
munge_size_hack() {
|
||||||
local fname="$1"
|
local fname="$1"
|
||||||
local size="$2"
|
local size="$2"
|
||||||
strip $fname
|
strip $fname
|
||||||
truncate --size=$size $fname
|
truncate --size=$size $fname
|
||||||
}
|
}
|
||||||
|
|
||||||
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"
|
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
|
||||||
|
''
|
||||||
|
|
||||||
7z x -o"$snappyPath" "$snappyPath.jar"
|
(lib.optionalString patchSnappy ''
|
||||||
if [ "${stdenv.system}" == "x86_64-linux" ]; then
|
snappyPath="lib/snappy-java-1.0.5"
|
||||||
target_size=$(get_file_size bin/fsnotifier64)
|
7z x -o"$snappyPath" "$snappyPath.jar"
|
||||||
patchelf --set-interpreter "$interpreter" bin/fsnotifier64
|
if [ "${stdenv.system}" == "x86_64-linux" ]; then
|
||||||
patchelf --set-rpath ${stdenv.gcc.gcc}/lib64/ "$snappyPath/org/xerial/snappy/native/Linux/amd64/libsnappyjava.so"
|
patchelf --set-rpath ${stdenv.gcc.gcc}/lib64 "$snappyPath/org/xerial/snappy/native/Linux/amd64/libsnappyjava.so"
|
||||||
munge_size_hack bin/fsnotifier64 $target_size
|
else
|
||||||
else
|
patchelf --set-rpath ${stdenv.gcc.gcc}/lib "$snappyPath/org/xerial/snappy/native/Linux/i386/libsnappyjava.so"
|
||||||
target_size=$(get_file_size bin/fsnotifier)
|
fi
|
||||||
patchelf --set-interpreter "$interpreter" bin/fsnotifier
|
7z a -tzip "$snappyPath.jar" ./"$snappyPath"/*
|
||||||
patchelf --set-rpath ${stdenv.gcc.gcc}/lib/ "$snappyPath/org/xerial/snappy/native/Linux/i386/libsnappyjava.so"
|
rm -vr "$snappyPath"
|
||||||
munge_size_hack bin/fsnotifier $target_size
|
'')
|
||||||
fi
|
];
|
||||||
7z a -tzip "$snappyPath.jar" ./"$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