-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from Tarnadas/linux-build
build: linux binary
- Loading branch information
Showing
12 changed files
with
52 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
src/proto/* | ||
src/declarations/* | ||
src/declarations/* | ||
compile/uws* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
|
||
/node_modules/ | ||
/dist/ | ||
/compile/index.js | ||
/compile/*.js | ||
/compile/net64plus-server* | ||
/.idea/ | ||
/coverage/ | ||
*.exe | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,46 @@ | ||
const nexe = require('nexe') | ||
const fs = require('fs') | ||
const path = require('path') | ||
|
||
fs.writeFileSync( | ||
'./compile/index.js', | ||
String(fs.readFileSync('./compile/index.js')).replace('./uws_win32_57.node', 'require("./uws_win32_57.node")') | ||
) | ||
fs.writeFileSync( | ||
'./compile/index.js', | ||
String(fs.readFileSync('./compile/index.js')) | ||
.replace( | ||
'./build/Release/farmhash', | ||
'module.exports = require("./farmhash.node");' | ||
) | ||
) | ||
const supportedPlatforms = [ | ||
[ 'win32', 'windows', 'x64' ], | ||
[ 'linux', 'linux', 'x64' ] | ||
] | ||
|
||
nexe.compile({ | ||
input: './compile/index.js', | ||
output: 'net64plus-server', | ||
target: 'windows-x64-8.9.4', | ||
native: { | ||
uws: { | ||
additionalFiles: [ | ||
'./compile/uws_win32_57.node' | ||
] | ||
}, | ||
farmhash: { | ||
additionalFiles: [ | ||
'./compile/farmhash.node' | ||
] | ||
for (const [ platform, platformName, arch ] of supportedPlatforms) { | ||
build(platform, platformName, arch) | ||
} | ||
|
||
function build (platform, platformName, arch) { | ||
const buildPath = `./compile/index_${platform}-${arch}.js` | ||
|
||
fs.writeFileSync( | ||
buildPath, | ||
String(fs.readFileSync('./compile/index.js')) | ||
.replace(/ \.\/uws_/g, ` require("./uws_`) | ||
.replace(/\.node;/g, `.node");`) | ||
.replace(/\.node /g, `.node") `) | ||
.replace( | ||
`./build/Release/farmhash`, | ||
`module.exports = require("./farmhash.node_${platform}_57");` | ||
) | ||
) | ||
|
||
nexe.compile({ | ||
input: buildPath, | ||
output: path.join('compile', `net64plus-server_${platform}-${arch}`), | ||
target: `${platformName}-${arch}-8.15.0`, | ||
native: { | ||
uws: { | ||
additionalFiles: [ | ||
`./compile/uws_${platform}_57.node` | ||
] | ||
}, | ||
farmhash: { | ||
additionalFiles: [ | ||
'./compile/farmhash.node' | ||
] | ||
} | ||
} | ||
} | ||
}) | ||
}) | ||
} |
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters