Skip to content

Commit 44ae2b7

Browse files
committed
Document new files / changes
1 parent 1a09d76 commit 44ae2b7

4 files changed

Lines changed: 21 additions & 2 deletions

File tree

generate/templates/templates/binding.gyp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
"action_name": "acquire",
4141
"action": ["node", "utils/acquireOpenSSL.js"],
4242
"inputs": ["vendor/openssl_distributions.json"],
43-
"outputs": ["vendor/openssl"]
43+
"outputs": ["vendor/openssl"],
44+
"message": "Acquiring OpensSL binaries and headers"
4445
}]
4546
}]
4647
]

utils/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,18 @@
44

55
#### buildFlags
66
Determines how NodeGit should build. Use `BUILD_ONLY` environment variable to build from source.
7+
8+
## discoverOpenSSLDistros
9+
Crawls a series of static links on the [Conan package manager](https://conan.io/) for the [latest release of OpenSSL](https://bintray.com/conan-community/conan/OpenSSL%3Aconan#files/conan%2FOpenSSL%2F1.1.0i) (1.1.0i at the time of writing). It acquires statically linked binaries and header files of OpenSSL for Mac and Windows. The provided binaries are compiled on:
10+
11+
* Mac: clang-8.1 or clang-9.
12+
* Windows: vs12, vs14, vs15
13+
14+
The discovered distributions are written into `vendor/openssl_distributions.json`. This script does not need to be run unless you are updating the version of OpenSSL to build against.
15+
16+
### acquireOpenSSL
17+
Download the OpenSSL binaries and headers applicable to the current OS for the latest compiler version (clang-9/vs15).
18+
19+
TODO:
20+
* Make the script pull the debug versions if node-gyp is building in debug mode
21+
* Make the script pull down a version of the binaries that matches the sytem compiler

utils/acquireOpenSSL.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const getCompilerVersion = () => {
3838
}
3939
}
4040

41-
const getIsDebug = () => true // TODO: Determine if we are GYPing in Debug
41+
const getIsDebug = () => false // TODO: Determine if we are GYPing in Debug
4242

4343
const getMatchingDistributionName = () =>
4444
`${getOSName()}-${getCompilerVersion()}-static${getIsDebug() ? '-debug' : ''}`;

utils/configureLibssh2.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ module.exports = function retrieveExternalDependencies() {
1818
var opensslIncludes = isElectron ? path.join(opensslDir, "includes") : opensslDir;
1919

2020
var newEnv = {};
21+
22+
// For some magic reason, MacOS fails to build if we copy over the current environment variables, but Linux
23+
// builds fail if we DON'T copy over the current environment variables
2124
if (process.platform !== "darwin") {
2225
Object.keys(process.env).forEach(function(key) {
2326
newEnv[key] = process.env[key];

0 commit comments

Comments
 (0)