ideas: refactoring, remove snappyPatch as all derivative products are based on the 14 series
This commit is contained in:
parent
e24004fea9
commit
17e6dd2da3
|
@ -6,28 +6,29 @@ assert stdenv.isLinux;
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
mkIdeaProduct =
|
mkIdeaProduct = with stdenv.lib;
|
||||||
{ name, product, version, build, src, meta, patchSnappy ? true }:
|
{ name, product, version, build, src, meta }:
|
||||||
|
|
||||||
let loName = stdenv.lib.toLower product;
|
let loName = toLower product;
|
||||||
hiName = stdenv.lib.toUpper product; in
|
hiName = toUpper product;
|
||||||
|
execName = concatStringsSep "-" (init (splitString "-" name));
|
||||||
|
in
|
||||||
|
|
||||||
with stdenv; lib.makeOverridable mkDerivation rec {
|
with stdenv; lib.makeOverridable mkDerivation rec {
|
||||||
inherit name build src meta;
|
inherit name build src meta;
|
||||||
desktopItem = makeDesktopItem {
|
desktopItem = makeDesktopItem {
|
||||||
name = loName;
|
name = execName;
|
||||||
exec = loName;
|
exec = execName;
|
||||||
comment = lib.replaceChars ["\n"] [" "] meta.longDescription;
|
comment = lib.replaceChars ["\n"] [" "] meta.longDescription;
|
||||||
desktopName = product;
|
desktopName = product;
|
||||||
genericName = meta.description;
|
genericName = meta.description;
|
||||||
categories = "Application;Development;";
|
categories = "Application;Development;";
|
||||||
icon = loName;
|
icon = execName;
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ makeWrapper patchelf p7zip unzip ];
|
buildInputs = [ makeWrapper patchelf p7zip unzip ];
|
||||||
|
|
||||||
patchPhase = lib.concatStringsSep "\n" [
|
patchPhase = ''
|
||||||
''
|
|
||||||
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)
|
||||||
|
@ -50,31 +51,18 @@ let
|
||||||
patchelf --set-interpreter "$interpreter" bin/fsnotifier
|
patchelf --set-interpreter "$interpreter" bin/fsnotifier
|
||||||
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.cc.cc}/lib64 "$snappyPath/org/xerial/snappy/native/Linux/amd64/libsnappyjava.so"
|
|
||||||
else
|
|
||||||
patchelf --set-rpath ${stdenv.cc.cc}/lib "$snappyPath/org/xerial/snappy/native/Linux/i386/libsnappyjava.so"
|
|
||||||
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,$name,share/pixmaps,libexec/${name}}
|
||||||
cp -va . "$out/$name"
|
cp -va . $out/$name
|
||||||
ln -s "$out/$name/bin/${loName}.png" "$out/share/pixmaps/"
|
ln -s $out/$name/bin/${loName}.png $out/share/pixmaps/${execName}.png
|
||||||
|
mv bin/fsnotifier* $out/libexec/${name}/.
|
||||||
|
|
||||||
jdk=${jdk.home}
|
jdk=${jdk.home}
|
||||||
|
|
||||||
makeWrapper "$out/$name/bin/${loName}.sh" "$out/bin/${loName}" \
|
makeWrapper "$out/$name/bin/${loName}.sh" "$out/bin/${execName}" \
|
||||||
--prefix PATH : "${jdk}/bin:${coreutils}/bin:${gnugrep}/bin:${which}/bin:${git}/bin" \
|
--prefix PATH : "$out/libexec/${name},${jdk}/bin:${coreutils}/bin:${gnugrep}/bin:${which}/bin:${git}/bin" \
|
||||||
--prefix LD_RUN_PATH : "${stdenv.cc.cc}/lib/" \
|
|
||||||
--prefix JDK_HOME : "$jdk" \
|
--prefix JDK_HOME : "$jdk" \
|
||||||
--prefix ${hiName}_JDK : "$jdk"
|
--prefix ${hiName}_JDK : "$jdk"
|
||||||
|
|
||||||
|
@ -104,7 +92,6 @@ let
|
||||||
buildClion = { name, version, build, src, license, description }:
|
buildClion = { name, version, build, src, license, description }:
|
||||||
(mkIdeaProduct rec {
|
(mkIdeaProduct rec {
|
||||||
inherit name version build src;
|
inherit name version build src;
|
||||||
patchSnappy = false;
|
|
||||||
product = "CLion";
|
product = "CLion";
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
homepage = "https://www.jetbrains.com/clion/";
|
homepage = "https://www.jetbrains.com/clion/";
|
||||||
|
@ -121,7 +108,6 @@ let
|
||||||
buildIdea = { name, version, build, src, license, description }:
|
buildIdea = { name, version, build, src, license, description }:
|
||||||
(mkIdeaProduct rec {
|
(mkIdeaProduct rec {
|
||||||
inherit name version build src;
|
inherit name version build src;
|
||||||
patchSnappy = false;
|
|
||||||
product = "IDEA";
|
product = "IDEA";
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
homepage = "https://www.jetbrains.com/idea/";
|
homepage = "https://www.jetbrains.com/idea/";
|
||||||
|
@ -139,7 +125,6 @@ let
|
||||||
buildRubyMine = { name, version, build, src, license, description }:
|
buildRubyMine = { name, version, build, src, license, description }:
|
||||||
(mkIdeaProduct rec {
|
(mkIdeaProduct rec {
|
||||||
inherit name version build src;
|
inherit name version build src;
|
||||||
patchSnappy = false;
|
|
||||||
product = "RubyMine";
|
product = "RubyMine";
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
homepage = "https://www.jetbrains.com/ruby/";
|
homepage = "https://www.jetbrains.com/ruby/";
|
||||||
|
@ -154,7 +139,6 @@ let
|
||||||
(mkIdeaProduct {
|
(mkIdeaProduct {
|
||||||
inherit name version build src;
|
inherit name version build src;
|
||||||
product = "PhpStorm";
|
product = "PhpStorm";
|
||||||
patchSnappy = false;
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
homepage = "https://www.jetbrains.com/phpstorm/";
|
homepage = "https://www.jetbrains.com/phpstorm/";
|
||||||
inherit description license;
|
inherit description license;
|
||||||
|
@ -171,7 +155,6 @@ let
|
||||||
buildPycharm = { name, version, build, src, license, description }:
|
buildPycharm = { name, version, build, src, license, description }:
|
||||||
(mkIdeaProduct rec {
|
(mkIdeaProduct rec {
|
||||||
inherit name version build src;
|
inherit name version build src;
|
||||||
patchSnappy = false;
|
|
||||||
product = "PyCharm";
|
product = "PyCharm";
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
homepage = "https://www.jetbrains.com/pycharm/";
|
homepage = "https://www.jetbrains.com/pycharm/";
|
||||||
|
@ -214,7 +197,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
clion = buildClion rec {
|
clion = buildClion rec {
|
||||||
name = "clion";
|
name = "clion-${version}";
|
||||||
version = "eap";
|
version = "eap";
|
||||||
build = "140.1740.3";
|
build = "140.1740.3";
|
||||||
description = "C/C++ IDE. New. Intelligent. Cross-platform.";
|
description = "C/C++ IDE. New. Intelligent. Cross-platform.";
|
||||||
|
|
Loading…
Reference in New Issue