2013-12-05 22:09:41 +00:00
|
|
|
{ stdenv, fetchurl, makeDesktopItem, makeWrapper, patchelf, p7zip, jdk
|
|
|
|
, coreutils, gnugrep, which, git
|
|
|
|
}:
|
|
|
|
|
2014-08-22 09:57:40 +00:00
|
|
|
assert stdenv.isLinux;
|
|
|
|
|
2013-12-05 22:09:41 +00:00
|
|
|
let
|
|
|
|
|
|
|
|
buildIdea =
|
2014-08-25 08:48:26 +00:00
|
|
|
{ name, version, build, src, description, longDescription, license }:
|
2013-12-05 22:09:41 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2014-08-05 05:19:00 +00:00
|
|
|
inherit name build src;
|
2013-12-05 22:09:41 +00:00
|
|
|
ideaItem = makeDesktopItem {
|
|
|
|
name = "IDEA";
|
|
|
|
exec = "idea";
|
|
|
|
comment = "Integrated Development Environment";
|
|
|
|
desktopName = "IntelliJ IDEA";
|
|
|
|
genericName = "Integrated Development Environment";
|
|
|
|
categories = "Application;Development;";
|
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ makeWrapper patchelf p7zip ];
|
|
|
|
|
|
|
|
buildCommand = ''
|
|
|
|
tar xvzf $src
|
|
|
|
mkdir -p $out
|
2014-02-22 22:42:11 +00:00
|
|
|
cp -a idea-$build $out
|
2013-12-05 22:09:41 +00:00
|
|
|
|
|
|
|
interpreter=$(echo ${stdenv.glibc}/lib/ld-linux*.so.2)
|
|
|
|
|
2014-02-22 22:42:11 +00:00
|
|
|
7z x $out/idea-$build/lib/snappy-java-1.0.5.jar
|
|
|
|
rm $out/idea-$build/lib/snappy-java-1.0.5.jar
|
2013-12-05 22:09:41 +00:00
|
|
|
if [ "${stdenv.system}" == "x86_64-linux" ];then
|
2014-02-22 22:42:11 +00:00
|
|
|
patchelf --set-interpreter $interpreter $out/idea-$build/bin/fsnotifier64
|
2013-12-05 22:09:41 +00:00
|
|
|
patchelf --set-rpath ${stdenv.gcc.gcc}/lib64/ org/xerial/snappy/native/Linux/amd64/libsnappyjava.so
|
|
|
|
else
|
2014-02-22 22:42:11 +00:00
|
|
|
patchelf --set-interpreter $interpreter $out/idea-$build/bin/fsnotifier
|
2013-12-05 22:09:41 +00:00
|
|
|
patchelf --set-rpath ${stdenv.gcc.gcc}/lib/ org/xerial/snappy/native/Linux/i386/libsnappyjava.so
|
|
|
|
fi
|
2014-02-22 22:42:11 +00:00
|
|
|
7z a -tzip $out/idea-$build/lib/snappy-java-1.0.5.jar .
|
2013-12-05 22:09:41 +00:00
|
|
|
|
|
|
|
mkdir -p $out/bin
|
2014-02-05 14:49:45 +00:00
|
|
|
|
2014-09-11 16:51:12 +00:00
|
|
|
[ -d ${jdk}/lib/openjdk ] \
|
|
|
|
&& jdk=${jdk}/lib/openjdk \
|
|
|
|
|| jdk=${jdk}
|
2014-02-05 14:49:45 +00:00
|
|
|
|
2014-02-22 22:42:11 +00:00
|
|
|
makeWrapper $out/idea-$build/bin/idea.sh $out/bin/idea \
|
2013-12-05 22:09:41 +00:00
|
|
|
--prefix PATH : ${jdk}/bin:${coreutils}/bin:${gnugrep}/bin:${which}/bin:${git}/bin \
|
|
|
|
--prefix LD_RUN_PATH : ${stdenv.gcc.gcc}/lib/ \
|
2014-02-05 14:49:45 +00:00
|
|
|
--prefix JDK_HOME : $jdk \
|
|
|
|
--prefix IDEA_JDK : $jdk
|
2013-12-05 22:09:41 +00:00
|
|
|
|
|
|
|
mkdir -p $out/share/applications
|
2014-07-09 09:37:47 +00:00
|
|
|
cp "${ideaItem}/share/applications/"* $out/share/applications
|
2013-12-05 22:09:41 +00:00
|
|
|
patchShebangs $out
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = http://www.jetbrains.com/idea/;
|
|
|
|
inherit description;
|
2014-08-25 08:48:26 +00:00
|
|
|
inherit longDescription;
|
2013-12-05 22:09:41 +00:00
|
|
|
inherit license;
|
|
|
|
maintainers = [ stdenv.lib.maintainers.edwtjo ];
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
in {
|
|
|
|
|
2014-08-25 08:48:26 +00:00
|
|
|
idea-community = buildIdea rec {
|
2014-02-22 22:42:11 +00:00
|
|
|
name = "idea-community-${version}";
|
2014-08-25 08:48:26 +00:00
|
|
|
version = "13.1.4b";
|
|
|
|
build = "IC-135.1230";
|
|
|
|
description = "Integrated Development Environment (IDE) by Jetbrains, community edition";
|
|
|
|
longDescription = ''
|
|
|
|
Lightweight IDE for Java SE, Groovy & Scala development
|
|
|
|
Powerful environment for building Google Android apps
|
|
|
|
Integration with JUnit, TestNG, popular SCMs, Ant & Maven
|
|
|
|
Free, open-source, Apache 2 licensed.
|
|
|
|
'';
|
2014-08-05 05:19:00 +00:00
|
|
|
license = stdenv.lib.licenses.asl20;
|
2013-12-05 22:09:41 +00:00
|
|
|
src = fetchurl {
|
2014-02-22 22:42:11 +00:00
|
|
|
url = "http://download-ln.jetbrains.com/idea/ideaIC-${version}.tar.gz";
|
2014-08-25 08:48:26 +00:00
|
|
|
sha256 = "8b4ee25fd2934e06b87230b50e1474183ed4b331c1626a7fee69b96294d9616d";
|
2013-12-05 22:09:41 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2014-08-25 08:48:26 +00:00
|
|
|
idea-ultimate = buildIdea rec {
|
2014-02-22 22:42:11 +00:00
|
|
|
name = "idea-ultimate-${version}";
|
2014-08-25 08:48:26 +00:00
|
|
|
version = "13.1.4b";
|
|
|
|
build = "IU-135.1230";
|
|
|
|
description = "Integrated Development Environment (IDE) by Jetbrains, requires paid license";
|
|
|
|
longDescription = ''
|
|
|
|
Full-featured IDE for JVM-based and polyglot development
|
|
|
|
Java EE, Spring/Hibernate and other technologies support
|
|
|
|
Deployment and debugging with most application servers
|
|
|
|
Duplicate code search, dependency structure matrix, etc.
|
|
|
|
'';
|
2013-12-05 22:09:41 +00:00
|
|
|
license = stdenv.lib.licenses.unfree;
|
|
|
|
src = fetchurl {
|
2014-02-22 22:42:11 +00:00
|
|
|
url = "http://download-ln.jetbrains.com/idea/ideaIU-${version}.tar.gz";
|
2014-08-25 08:48:26 +00:00
|
|
|
sha256 = "84660d97c9c3e4e7cfd6c2708f4685dc7322157f1e1c2888feac64df119f0606";
|
2013-12-05 22:09:41 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|