From cb4da49a7c9628e44d90f4fbe014d5d2449cb382 Mon Sep 17 00:00:00 2001 From: Matthias Goetzke Date: Sat, 6 Sep 2014 12:42:06 +0200 Subject: [PATCH 01/10] gs --- binding.gyp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/binding.gyp b/binding.gyp index 4ee80ce2..fd84dd32 100644 --- a/binding.gyp +++ b/binding.gyp @@ -18,7 +18,7 @@ ['OS=="win"', { 'javahome%': ' Date: Sat, 6 Sep 2014 12:42:16 +0200 Subject: [PATCH 02/10] added solaris support --- binding.gyp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/binding.gyp b/binding.gyp index fd84dd32..f5a568e3 100644 --- a/binding.gyp +++ b/binding.gyp @@ -18,7 +18,7 @@ ['OS=="win"', { 'javahome%': ' Date: Sat, 6 Sep 2014 12:51:52 +0200 Subject: [PATCH 03/10] updated include dirs for solaris --- binding.gyp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/binding.gyp b/binding.gyp index f5a568e3..9a1cf2b3 100644 --- a/binding.gyp +++ b/binding.gyp @@ -83,6 +83,18 @@ ] } ], + ['OS=="solaris"', + { + 'include_dirs': [ + '<(javahome)/include/solaris', + ], + 'libraries': [ + '-L<(javalibdir)', + '-Wl,-rpath,<(javalibdir)', + '-ljvm' + ] + } + ], ['OS=="freebsd"', { 'include_dirs': [ From 5b5bfb7076dae25538ba04cfec90d4f1ba313bd9 Mon Sep 17 00:00:00 2001 From: Matthias Goetzke Date: Sat, 6 Sep 2014 13:41:58 +0200 Subject: [PATCH 04/10] some more changes for solaris --- binding.gyp | 6 +++--- postInstall.js | 30 ++++++++++++++++++++++++++++-- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/binding.gyp b/binding.gyp index 9a1cf2b3..95706a5a 100644 --- a/binding.gyp +++ b/binding.gyp @@ -41,7 +41,7 @@ }], ['OS=="solaris" and target_arch=="x64"', { 'javalibdir%': " Date: Sat, 6 Sep 2014 13:54:21 +0200 Subject: [PATCH 05/10] some temporary debugging to postInstall --- postInstall.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/postInstall.js b/postInstall.js index 466f5b70..f617b9ca 100644 --- a/postInstall.js +++ b/postInstall.js @@ -43,11 +43,13 @@ function getCorrectSoForPlatform(soFiles){ for (var i = 0; i < soFiles.length; i++) { var so = soFiles[i]; + + console.log('so',so,requiredFolderName); if(so.indexOf('server')) if(so.indexOf(requiredFolderName)) return so; } - return so[0]; + return soFiles[0]; } From a19605a61b6d78ec184fb8129f56968020a024a5 Mon Sep 17 00:00:00 2001 From: Matthias Goetzke Date: Sat, 6 Sep 2014 13:59:47 +0200 Subject: [PATCH 06/10] added more temp debugging --- postInstall.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/postInstall.js b/postInstall.js index f617b9ca..6365fcf0 100644 --- a/postInstall.js +++ b/postInstall.js @@ -47,8 +47,10 @@ function getCorrectSoForPlatform(soFiles){ console.log('so',so,requiredFolderName); if(so.indexOf('server')) - if(so.indexOf(requiredFolderName)) + if(so.indexOf(requiredFolderName)) { + console.log('match',so) return so; + } } return soFiles[0]; From 87958e7eee7d2c77f8885431c866f95e447c7617 Mon Sep 17 00:00:00 2001 From: Matthias Goetzke Date: Sat, 6 Sep 2014 14:04:49 +0200 Subject: [PATCH 07/10] removed debugging output. added removal of repeated jre/jre etc in so path --- postInstall.js | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/postInstall.js b/postInstall.js index 6365fcf0..96791d8a 100644 --- a/postInstall.js +++ b/postInstall.js @@ -30,6 +30,18 @@ require('find-java-home')(function(err, home){ }); function getCorrectSoForPlatform(soFiles){ + var so = getCorrectSoForPlatform(soFiles); + return removeDuplicateJre(so); +} + +function removeDuplicateJre(filePath){ + while(filePath.indexOf('jre/jre')>0){ + filePath = filePath.replace('jre',''); + } + return filePath; +} + +function _getCorrectSoForPlatform(soFiles){ var architectureFolderNames = { 'ia32': 'i386', @@ -43,14 +55,10 @@ function getCorrectSoForPlatform(soFiles){ for (var i = 0; i < soFiles.length; i++) { var so = soFiles[i]; - - console.log('so',so,requiredFolderName); - if(so.indexOf('server')) - if(so.indexOf(requiredFolderName)) { - console.log('match',so) + if(so.indexOf('server')>0) + if(so.indexOf(requiredFolderName)>0) return so; - } } return soFiles[0]; From 5c5ea3006dd3e45470af198104600c501f6943b5 Mon Sep 17 00:00:00 2001 From: Matthias Goetzke Date: Sat, 6 Sep 2014 14:07:40 +0200 Subject: [PATCH 08/10] minor fix --- postInstall.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/postInstall.js b/postInstall.js index 96791d8a..7ba25d52 100644 --- a/postInstall.js +++ b/postInstall.js @@ -36,7 +36,7 @@ function getCorrectSoForPlatform(soFiles){ function removeDuplicateJre(filePath){ while(filePath.indexOf('jre/jre')>0){ - filePath = filePath.replace('jre',''); + filePath = filePath.replace('jre/jre','jre'); } return filePath; } From e46d560be762ef2fc477245d35a4ee24483eb429 Mon Sep 17 00:00:00 2001 From: Matthias Goetzke Date: Sat, 6 Sep 2014 14:22:55 +0200 Subject: [PATCH 09/10] minor change --- postInstall.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/postInstall.js b/postInstall.js index 7ba25d52..f48a5262 100644 --- a/postInstall.js +++ b/postInstall.js @@ -30,12 +30,12 @@ require('find-java-home')(function(err, home){ }); function getCorrectSoForPlatform(soFiles){ - var so = getCorrectSoForPlatform(soFiles); + var so = _getCorrectSoForPlatform(soFiles); return removeDuplicateJre(so); } function removeDuplicateJre(filePath){ - while(filePath.indexOf('jre/jre')>0){ + while(filePath.indexOf('jre/jre')>=0){ filePath = filePath.replace('jre/jre','jre'); } return filePath; From e05fe0cdf77132f28af217ef02b128b92ba500c1 Mon Sep 17 00:00:00 2001 From: Matthias Goetzke Date: Sat, 6 Sep 2014 14:29:23 +0200 Subject: [PATCH 10/10] fixed solaris 'so' files search --- postInstall.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/postInstall.js b/postInstall.js index f48a5262..f4701799 100644 --- a/postInstall.js +++ b/postInstall.js @@ -11,12 +11,12 @@ require('find-java-home')(function(err, home){ if(home){ dll = glob.sync('**/jvm.dll', {cwd: home})[0]; - soFiles = glob.sync('**/libjvm.so', {cwd: home}); dylib = glob.sync('**/libjvm.dylib', {cwd: home})[0]; - binary = dll || dylib || so; - + soFiles = glob.sync('**/libjvm.so', {cwd: home}); so = getCorrectSoForPlatform(soFiles); + binary = dll || dylib || so; + fs.writeFileSync( path.resolve(__dirname, './build/jvm_dll_path.json'), binary