forked from mirrors/nixpkgs
netbeans: additional patching
- Patches a new awk call in the Netbeans 8 launcher, to fix a warning on startup: /nix/store/...-netbeans-8.0.2/netbeans/platform/lib/nbexec: line 201: /usr/bin/awk: No such file or directory - Patches a bunch of sh/perl/python shebangs.
This commit is contained in:
parent
30cd66910e
commit
eaddd4e5e8
|
@ -1,4 +1,6 @@
|
|||
{stdenv, fetchurl, jdk, unzip, which, makeWrapper, makeDesktopItem}:
|
||||
{ stdenv, fetchurl, makeWrapper, makeDesktopItem
|
||||
, gawk, jdk, perl, python, unzip, which
|
||||
}:
|
||||
|
||||
let
|
||||
desktopItem = makeDesktopItem {
|
||||
|
@ -16,14 +18,19 @@ stdenv.mkDerivation {
|
|||
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";
|
||||
|
|
11
pkgs/applications/editors/netbeans/path.patch
Normal file
11
pkgs/applications/editors/netbeans/path.patch
Normal 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
|
Loading…
Reference in a new issue