Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
579eb98
Update binding with curl-config for discovery of libcurl
implausible Sep 9, 2018
382bedb
Bump fs-extra to get rid of most promisify calls in nodegit
implausible Sep 9, 2018
1bf1dde
Bump libssh2
implausible Sep 9, 2018
189a46d
Use isolate version of ToInt32
implausible Sep 9, 2018
a53d000
Package lock changes from node 10
implausible Sep 9, 2018
4876b88
Drop node 9 for 10
implausible Sep 9, 2018
58063a5
Continue using OpenSSL over libgcrypt on windows
implausible Sep 9, 2018
5b8bc61
Do not compile openssl
emmax86 Sep 19, 2018
eda6d15
Include OpenSSL headers if building for Electron on macOS
emmax86 Sep 20, 2018
da3a2e5
Touch up Mac conditions, include OpenSSL on Windows for Electron
emmax86 Sep 20, 2018
fe11aab
Remove OpenSSL source as a vendored library
emmax86 Sep 20, 2018
115fcff
Dynamically link against OpenSSL on Linux/BSD
emmax86 Sep 20, 2018
c2503b0
Unmangle lib includes on Windows
emmax86 Sep 21, 2018
6cdcfd8
Use proper callback for setting thread ID in OpenSSL
emmax86 Sep 21, 2018
fde3782
Fix libssh2 linking errors to node's OpenSSL
emmax86 Sep 21, 2018
8f331f7
Pull down OpenSSL 1.1 on Mac CI
emmax86 Sep 21, 2018
371c67e
Calculate OS dependent directory on libssl configure
emmax86 Sep 21, 2018
49fc43b
Add script for discovering OpenSSL dependencies from Conan
emmax86 Sep 22, 2018
e369688
Touch up OpenSSL discovery script
emmax86 Sep 24, 2018
bc7fd43
Commit the OpenSSL distributions we currently want to pull from
emmax86 Sep 24, 2018
90bb388
Create a script for acquiring OpenSSL distributions based on OS/platform
emmax86 Sep 25, 2018
4d262fe
Fixup misdiscovered OpenSSL distros
emmax86 Sep 25, 2018
d3698fd
Add openssl to gitignore
emmax86 Sep 25, 2018
136dace
WIP on action for acquiring OpenSSL
emmax86 Sep 25, 2018
0f1ad0e
Fixed shipping wrong Mac OpenSSL distros 🙈
emmax86 Sep 26, 2018
1d33631
Specify configureLibssh as a dependency of libssh2
emmax86 Sep 26, 2018
3f7fab0
Only populate CPPFLAGs env variable during configureOpenSSL
emmax86 Sep 26, 2018
aa63038
Do not install Homebrew on Mac Travis
emmax86 Sep 26, 2018
1a09d76
Remove unused OpenSSL headers / binaries from Sigmoid
emmax86 Sep 26, 2018
44ae2b7
Document new files / changes
emmax86 Sep 26, 2018
c98a5be
Explicitly label release distributions of OpenSSL as such
emmax86 Sep 27, 2018
a686328
Update gitignore to ignore libssh2 generated files
emmax86 Sep 27, 2018
a637c19
Move ramda, request-promise-native, and tar-fs to deps from dev-deps
emmax86 Sep 27, 2018
3497732
Touch up README for utils, code formatting, links
emmax86 Sep 27, 2018
e01338f
Use R.find instead of R.reduce to do linear search on distribution pairs
emmax86 Sep 27, 2018
470f34d
Acquire VS14-compiled builds on Windows
emmax86 Sep 27, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,23 @@
/generate/missing-tests.json
/binding.gyp

# Generated vendor files
/vendor/openssl/
/vendor/libssh2/Makefile
/vendor/libssh2/config.status
/vendor/libssh2/docs/Makefile
/vendor/libssh2/example/.deps/
/vendor/libssh2/example/Makefile
/vendor/libssh2/example/libssh2_config.h
/vendor/libssh2/example/stamp-h2
/vendor/libssh2/libssh2.pc
/vendor/libssh2/libtool
/vendor/libssh2/src/.deps/
/vendor/libssh2/src/Makefile
/vendor/libssh2/src/libssh2_config.h
/vendor/libssh2/src/stamp-h1
/vendor/libssh2/tests/.deps/
/vendor/libssh2/tests/Makefile

*.log
.DS_STORE
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ env:
- TARGET_ARCH="ia32"

node_js:
- "9"
- "10"
- "8"
- "6"

Expand Down
6 changes: 3 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
image: Visual Studio 2015

platform:
- x86
- x64
- x86

# build version format
version: "{build}"
Expand All @@ -26,9 +26,9 @@ environment:
GYP_MSVS_VERSION: 2015
matrix:
# Node.js
- nodejs_version: "9"
- nodejs_version: "8"
- nodejs_version: "6"
- nodejs_version: "8"
- nodejs_version: "10"

matrix:
fast_finish: true
Expand Down
8 changes: 1 addition & 7 deletions examples/add-and-commit.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
var nodegit = require("../");
var path = require("path");
var promisify = require("promisify-node");
var fse = promisify(require("fs-extra"));
var fse = require("fs-extra");
var fileName = "newfile.txt";
var fileContent = "hello world";
var directoryName = "salad/toast/strangerinastrangeland/theresnowaythisexists";
// ensureDir is an alias to mkdirp, which has the callback with a weird name
// and in the 3rd position of 4 (the 4th being used for recursion). We have to
// force promisify it, because promisify-node won't detect it on its
// own and assumes sync
fse.ensureDir = promisify(fse.ensureDir);

/**
* This example creates a certain file `newfile.txt`, adds it to the git
Expand Down
3 changes: 1 addition & 2 deletions examples/clone.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
var nodegit = require("../");
var promisify = require("promisify-node");
var fse = promisify(require("fs-extra"));
var fse = require("fs-extra");
var path = "/tmp/nodegit-clone-demo";

fse.remove(path).then(function() {
Expand Down
3 changes: 1 addition & 2 deletions examples/cloneFromGithubWith2Factor.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
var nodegit = require("../");
var promisify = require("promisify-node");
var fse = promisify(require("fs-extra"));
var fse = require("fs-extra");
var path = "/tmp/nodegit-github-2factor-demo";

var token = "{Your GitHub user token}";
Expand Down
5 changes: 1 addition & 4 deletions examples/create-new-repo.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
var nodegit = require("../");
var path = require("path");
var promisify = require("promisify-node");
var fse = promisify(require("fs-extra"));
var fse = require("fs-extra");
var fileName = "newfile.txt";
var fileContent = "hello world";
var repoDir = "../../newRepo";

fse.ensureDir = promisify(fse.ensureDir);

var repository;
var index;

Expand Down
3 changes: 1 addition & 2 deletions examples/index-add-and-remove.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
var nodegit = require("../");
var path = require("path");
var promisify = require("promisify-node");
var fse = promisify(require("fs-extra"));
var fse = require("fs-extra");

nodegit.Repository.open(path.resolve(__dirname, "../.git"))
.then(function(repo) {
Expand Down
4 changes: 1 addition & 3 deletions examples/merge-cleanly.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
var nodegit = require("../");
var path = require("path");
var promisify = require("promisify-node");
var fse = promisify(require("fs-extra"));
fse.ensureDir = promisify(fse.ensureDir);
var fse = require("fs-extra");

var ourFileName = "ourNewFile.txt";
var ourFileContent = "I like Toll Roads. I have an EZ-Pass!";
Expand Down
4 changes: 1 addition & 3 deletions examples/merge-with-conflicts.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
var nodegit = require("../");
var path = require("path");
var promisify = require("promisify-node");
var fse = promisify(require("fs-extra"));
fse.ensureDir = promisify(fse.ensureDir);
var fse = require("fs-extra");

var repoDir = "../../newRepo";
var fileName = "newFile.txt";
Expand Down
4 changes: 1 addition & 3 deletions examples/push.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
var nodegit = require("../");
var path = require("path");
var promisify = require("promisify-node");
var fse = promisify(require("fs-extra"));
fse.ensureDir = promisify(fse.ensureDir);
var fse = require("fs-extra");

var fileName = "newFile.txt";
var fileContent = "hello world";
Expand Down
3 changes: 1 addition & 2 deletions generate/scripts/generateNativeCode.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const path = require("path");
const promisify = require("promisify-node");
const fse = promisify(require("fs-extra"));
const fse = require("fs-extra");
const os = require('os');
const exec = require('../../utils/execPromise');
const utils = require("./utils");
Expand Down
96 changes: 93 additions & 3 deletions generate/templates/templates/binding.gyp
Original file line number Diff line number Diff line change
@@ -1,8 +1,70 @@
{
"conditions": [
["(OS=='win' and node_root_dir.split('\\\\')[-1].startswith('iojs')) or (OS=='mac' and node_root_dir.split('/')[-1].startswith('iojs'))", {
"conditions": [
["OS=='win'", {
"variables": {
"is_electron%": "1",
"openssl_include_dir%": "<(module_root_dir)\\vendor\\openssl"
}
}, {
"variables": {
"is_electron%": "1",
"openssl_include_dir%": "<(module_root_dir)/vendor/openssl"
}
}]
],
}, {
"conditions": [
["OS=='win'", {
"variables": {
"is_electron%": "0",
"openssl_include_dir%": "<(node_root_dir)\\include\\node"
}
}, {
"variables": {
"is_electron%": "0",
"openssl_include_dir%": "<(node_root_dir)/include/node"
}
}]
]
}]
],

"targets": [
{
"target_name": "acquireOpenSSL",
"conditions": [
["<(is_electron) == 1", {
"actions": [{
"action_name": "acquire",
"action": ["node", "utils/acquireOpenSSL.js"],
"inputs": ["vendor/openssl_distributions.json"],
"outputs": ["vendor/openssl"],
"message": "Acquiring OpensSL binaries and headers"
}]
}]
]
},
{
"target_name": "configureLibssh2",
"actions": [{
"action_name": "configure",
"action": ["node", "utils/configureLibssh2.js", "<(openssl_include_dir)", "<(is_electron)"],
"inputs": [""],
"outputs": [""]
}],
"hard_dependencies": [
"acquireOpenSSL"
]
},
{
"target_name": "nodegit",

"hard_dependencies": [
"configureLibssh2"
],

"dependencies": [
"vendor/libgit2.gyp:libgit2"
],
Expand Down Expand Up @@ -35,7 +97,6 @@
"include_dirs": [
"vendor/libv8-convert",
"vendor/libssh2/include",
"vendor/openssl/openssl/include",
"<!(node -e \"require('nan')\")"
],

Expand All @@ -59,6 +120,17 @@
],
[
"OS=='mac'", {
"conditions": [
["node_root_dir.split('/')[-1].startswith('iojs')", {
"include_dirs": [
"vendor/openssl/include"
],
"libraries": [
"<(module_root_dir)/vendor/openssl/lib/libcrypto.a",
"<(module_root_dir)/vendor/openssl/lib/libssl.a"
]
}]
],
"xcode_settings": {
"GCC_ENABLE_CPP_EXCEPTIONS": "YES",
"MACOSX_DEPLOYMENT_TARGET": "10.7",
Expand All @@ -74,6 +146,15 @@
],
[
"OS=='win'", {
"conditions": [
["node_root_dir.split('\\\\')[-1].startswith('iojs')", {
"include_dirs": ["vendor/openssl/include"],
"libraries": [
"<(module_root_dir)/vendor/openssl/lib/libcrypto.lib",
"<(module_root_dir)/vendor/openssl/lib/libssl.lib"
]
}]
],
"defines": [
"_HAS_EXCEPTIONS=1"
],
Expand All @@ -88,18 +169,27 @@
"/FORCE:MULTIPLE"
]
}
}
},
"libraries": [
"winhttp.lib",
"crypt32.lib",
"rpcrt4.lib"
]
}
],
[
"OS=='linux' or OS=='mac'", {
"libraries": [
"-lcurl"
"<!(curl-config --libs)"
]
}
],
[
"OS=='linux' or OS.endswith('bsd')", {
"libraries": [
"-lcrypto",
"-lssl"
],
"cflags": [
"-std=c++11"
]
Expand Down
8 changes: 4 additions & 4 deletions generate/templates/templates/nodegit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ void LockMasterSetStatus(const FunctionCallbackInfo<Value>& info) {

// convert the first argument to Status
if(info.Length() >= 0 && info[0]->IsNumber()) {
v8::Local<v8::Int32> value = info[0]->ToInt32();
v8::Local<v8::Int32> value = info[0]->ToInt32(v8::Isolate::GetCurrent());
LockMaster::Status status = static_cast<LockMaster::Status>(value->Value());
if(status >= LockMaster::Disabled && status <= LockMaster::Enabled) {
LockMaster::SetStatus(status);
Expand Down Expand Up @@ -105,8 +105,8 @@ void OpenSSL_LockingCallback(int mode, int type, const char *, int) {
}
}

unsigned long OpenSSL_IDCallback() {
return (unsigned long)uv_thread_self();
void OpenSSL_IDCallback(CRYPTO_THREADID *id) {
CRYPTO_THREADID_set_numeric(id, (unsigned long)uv_thread_self());
}

void OpenSSL_ThreadSetup() {
Expand All @@ -117,7 +117,7 @@ void OpenSSL_ThreadSetup() {
}

CRYPTO_set_locking_callback(OpenSSL_LockingCallback);
CRYPTO_set_id_callback(OpenSSL_IDCallback);
CRYPTO_THREADID_set_callback(OpenSSL_IDCallback);
}

ThreadPool libgit2ThreadPool(10, uv_default_loop());
Expand Down
3 changes: 1 addition & 2 deletions lib/repository.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
var promisify = require("promisify-node");
var fse = promisify(require("fs-extra"));
var fse = require("fs-extra");
var fp = require("lodash/fp");
var NodeGit = require("../");
var Blob = NodeGit.Blob;
Expand Down
4 changes: 0 additions & 4 deletions lifecycleScripts/preinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ var path = require("path");
var local = path.join.bind(path, __dirname);

var exec = require(local("../utils/execPromise"));
var configure = require(local("configureLibssh2"));
var buildFlags = require(local("../utils/buildFlags"));

module.exports = function prepareForBuild() {
Expand All @@ -17,9 +16,6 @@ module.exports = function prepareForBuild() {

return Promise.resolve();
})
.then(function() {
return configure();
})
.then(function() {
if (buildFlags.isGitRepo) {
var submodules = require(local("submodules"));
Expand Down
Loading