ajout expression pour idea14 ultimate
parent
bc28ec3844
commit
3383216f30
@ -0,0 +1,74 @@
|
|||||||
|
{ stdenv, fetchurl, makeDesktopItem, makeWrapper, patchelf, p7zip
|
||||||
|
, coreutils, gnugrep, which, git, python, unzip }:
|
||||||
|
|
||||||
|
{ name, product, version, src, wmClass, jdk, meta } @ attrs:
|
||||||
|
|
||||||
|
with stdenv.lib;
|
||||||
|
|
||||||
|
let loName = toLower product;
|
||||||
|
hiName = toUpper product;
|
||||||
|
execName = concatStringsSep "-" (init (splitString "-" name));
|
||||||
|
in
|
||||||
|
|
||||||
|
with stdenv; lib.makeOverridable mkDerivation rec {
|
||||||
|
inherit name src meta;
|
||||||
|
desktopItem = makeDesktopItem {
|
||||||
|
name = execName;
|
||||||
|
exec = execName;
|
||||||
|
comment = lib.replaceChars ["\n"] [" "] meta.longDescription;
|
||||||
|
desktopName = product;
|
||||||
|
genericName = meta.description;
|
||||||
|
categories = "Application;Development;";
|
||||||
|
icon = execName;
|
||||||
|
extraEntries = ''
|
||||||
|
StartupWMClass=${wmClass}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
buildInputs = [ makeWrapper patchelf p7zip unzip ];
|
||||||
|
|
||||||
|
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.out}/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
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/{bin,$name,share/pixmaps,libexec/${name}}
|
||||||
|
cp -a . $out/$name
|
||||||
|
ln -s $out/$name/bin/${loName}.png $out/share/pixmaps/${execName}.png
|
||||||
|
mv bin/fsnotifier* $out/libexec/${name}/.
|
||||||
|
|
||||||
|
jdk=${jdk.home}
|
||||||
|
item=${desktopItem}
|
||||||
|
|
||||||
|
makeWrapper "$out/$name/bin/${loName}.sh" "$out/bin/${execName}" \
|
||||||
|
--prefix PATH : "$out/libexec/${name}:${stdenv.lib.makeBinPath [ jdk coreutils gnugrep which git ]}" \
|
||||||
|
--set JDK_HOME "$jdk" \
|
||||||
|
--set ${hiName}_JDK "$jdk" \
|
||||||
|
--set ANDROID_JAVA_HOME "$jdk" \
|
||||||
|
--set JAVA_HOME "$jdk"
|
||||||
|
|
||||||
|
ln -s "$item/share/applications" $out/share
|
||||||
|
'';
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,57 @@
|
|||||||
|
{ nixpkgs ? import <nixpkgs> {}
|
||||||
|
, stdenv ? nixpkgs.stdenv
|
||||||
|
#, callPackage
|
||||||
|
#, fetchurl
|
||||||
|
#, makeDesktopItem
|
||||||
|
#, makeWrapper
|
||||||
|
#, patchelf
|
||||||
|
|
||||||
|
#, coreutils
|
||||||
|
#, gnugrep
|
||||||
|
#, which
|
||||||
|
#, git
|
||||||
|
#, python
|
||||||
|
#, unzip
|
||||||
|
#, p7zip
|
||||||
|
|
||||||
|
#, androidsdk, jdk
|
||||||
|
}:
|
||||||
|
|
||||||
|
with nixpkgs;
|
||||||
|
assert stdenv.isLinux;
|
||||||
|
|
||||||
|
let
|
||||||
|
mkIdeaProduct = callPackage ./common.nix { };
|
||||||
|
|
||||||
|
buildIdea = { name, version, src, license, description, wmClass }:
|
||||||
|
(mkIdeaProduct rec {
|
||||||
|
inherit name version src wmClass jdk;
|
||||||
|
product = "IDEA";
|
||||||
|
meta = with stdenv.lib; {
|
||||||
|
homepage = "https://www.jetbrains.com/idea/";
|
||||||
|
inherit description license;
|
||||||
|
longDescription = ''
|
||||||
|
IDE for Java SE, Groovy & Scala development Powerful
|
||||||
|
environment for building Google Android apps Integration
|
||||||
|
with JUnit, TestNG, popular SCMs, Ant & Maven.
|
||||||
|
'';
|
||||||
|
maintainers = with maintainers; [ edwtjo ];
|
||||||
|
platforms = platforms.linux;
|
||||||
|
};
|
||||||
|
});
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
idea14-ultimate = buildIdea rec {
|
||||||
|
name = "idea-ultimate-${version}";
|
||||||
|
version = "14.1.7";
|
||||||
|
description = "Integrated Development Environment (IDE) by Jetbrains, requires paid license";
|
||||||
|
license = stdenv.lib.licenses.bsd3;
|
||||||
|
#license = stdenv.lib.licenses.unfree;
|
||||||
|
src = fetchurl {
|
||||||
|
url = "https://download.jetbrains.com/idea/ideaIU-${version}.tar.gz";
|
||||||
|
sha256 = "1hhga1i2zbsipgq283gn19kv9n94inhr1bxh2yx19gz7yr4r49d2";
|
||||||
|
};
|
||||||
|
wmClass = "jetbrains-idea";
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue