Merge pull request #10150 from khumba/netbeans-8

netbeans: 7.4 -> 8.0.2
This commit is contained in:
Arseniy Seroka 2015-09-30 15:02:14 +03:00
commit df13fd5ae5
2 changed files with 28 additions and 10 deletions

View File

@ -1,4 +1,6 @@
{stdenv, fetchurl, jdk, unzip, which, makeWrapper, makeDesktopItem}:
{ stdenv, fetchurl, makeWrapper, makeDesktopItem
, gawk, jdk, perl, python, unzip, which
}:
let
desktopItem = makeDesktopItem {
@ -11,19 +13,24 @@ let
};
in
stdenv.mkDerivation {
name = "netbeans-7.4";
name = "netbeans-8.0.2";
src = fetchurl {
url = http://download.netbeans.org/netbeans/7.4/final/zip/netbeans-7.4-201310111528.zip;
sha256 = "0nrnghnsdix5cmp86xi1gmvarhjk2k8mlbld3dfa9impm8gpv6mx";
url = http://download.netbeans.org/netbeans/8.0.2/final/zip/netbeans-8.0.2-201411181905.zip;
sha256 = "1h9cqpwsnrhcnn4fqz3rr4s5jln8cfwki8af9zikq9j6aza337xv";
};
buildCommand = ''
# Unpack and copy the stuff
# Unpack and perform some path patching.
unzip $src
mkdir -p $out
cp -a netbeans $out
# Create a wrapper capable of starting it
patch -p1 <${./path.patch}
substituteInPlace netbeans/platform/lib/nbexec \
--subst-var-by AWK ${gawk}/bin/awk
patchShebangs .
# Copy to installation directory and create a wrapper capable of starting
# it.
mkdir -p $out/bin
cp -a netbeans $out
makeWrapper $out/netbeans/bin/netbeans $out/bin/netbeans \
--prefix PATH : ${jdk}/bin:${which}/bin \
--prefix JAVA_HOME : ${jdk.home} \
@ -34,7 +41,7 @@ stdenv.mkDerivation {
cp ${desktopItem}/share/applications/* $out/share/applications
'';
buildInputs = [ unzip makeWrapper ];
buildInputs = [ makeWrapper perl python unzip ];
meta = {
description = "An integrated development environment for Java, C, C++ and PHP";

View File

@ -0,0 +1,11 @@
--- a/netbeans/platform/lib/nbexec 2015-09-29 21:26:39.282600903 -0700
+++ b/netbeans/platform/lib/nbexec 2015-09-29 21:26:58.977697858 -0700
@@ -198,7 +198,7 @@
SunOS*) awk=nawk ;;
*) awk=awk ;;
esac
- jdk_version=$("${jdkhome}/bin/java" -version 2>&1 | "/usr/bin/${awk}" -F '"' '/version/ {print substr($2, 1, 3)}')
+ jdk_version=$("${jdkhome}/bin/java" -version 2>&1 | "@AWK@" -F '"' '/version/ {print substr($2, 1, 3)}')
if [ "$jdk_version" = "1.7" ] ; then
jargs="$jargs $launcher_args"
fi