From 5c598a89fa6773aa588f48a473d1e3f9a3a596b8 Mon Sep 17 00:00:00 2001 From: birme Date: Sat, 20 Jun 2020 22:33:28 +0200 Subject: [PATCH] Build SRT SDK on install --- .gitignore | 1 + binding.gyp | 5 +++-- package-lock.json | 5 +++++ package.json | 4 +++- scripts/build-srt-sdk.js | 43 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 scripts/build-srt-sdk.js diff --git a/.gitignore b/.gitignore index dd87e2d..838b758 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules build +deps diff --git a/binding.gyp b/binding.gyp index b6a8daf..ba02250 100644 --- a/binding.gyp +++ b/binding.gyp @@ -8,9 +8,10 @@ "src/node-srt.cc" ], "include_dirs": [ - " { + console.log("Running ./configure"); + const configure = spawnSync('./configure', [ '--prefix', buildDir ], { cwd: srtSourcePath, shell: true } ); + console.log(configure.stdout.toString()); + if (configure.status) { + console.log(configure.stderr.toString()); + process.exit(configure.status); + } + + console.log("Running make"); + const make = spawnSync('make', [], { cwd: srtSourcePath, shell: true }); + console.log(make.stdout.toString()); + if (make.status) { + console.log(make.stderr.toString()); + process.exit(make.status); + } + + console.log("Running make install"); + const install = spawnSync('make', [ 'install' ], { cwd: srtSourcePath, shell: true }); + console.log(install.stdout.toString()); + if (install.status) { + console.log(install.stderr.toString()); + process.exit(install.status); + } + }); +} \ No newline at end of file