Skip to content

Commit

Permalink
first step for NDI 5 usage (macOS already working, Linux and Windows …
Browse files Browse the repository at this point in the history
…blindly prepared)
  • Loading branch information
rse committed Jul 19, 2021
1 parent 25ca33f commit ef02786
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"copies": [ {
"destination": "build/Release",
"files": [ "<(ndi_dir)/lib/lnx-x86/libndi.so",
"<(ndi_dir)/lib/lnx-x86/libndi.so.4",
"<(ndi_dir)/lib/lnx-x86/libndi.so.4.6.2" ]
"<(ndi_dir)/lib/lnx-x86/libndi.so.5",
"<(ndi_dir)/lib/lnx-x86/libndi.so.5.0.0" ]
} ],
"link_settings": {
"libraries": [ "-Wl,-rpath,'$$ORIGIN'", "-lndi" ],
Expand All @@ -49,8 +49,8 @@
"copies": [ {
"destination": "build/Release",
"files": [ "<(ndi_dir)/lib/lnx-x64/libndi.so",
"<(ndi_dir)/lib/lnx-x64/libndi.so.4",
"<(ndi_dir)/lib/lnx-x64/libndi.so.4.6.2" ]
"<(ndi_dir)/lib/lnx-x64/libndi.so.5",
"<(ndi_dir)/lib/lnx-x64/libndi.so.5.0.0" ]
} ],
"link_settings": {
"libraries": [ "-Wl,-rpath,'$$ORIGIN'", "-lndi" ],
Expand All @@ -60,10 +60,10 @@
[ "OS == 'mac' and target_arch == 'x64'", {
"copies": [ {
"destination": "build/Release",
"files": [ "<(ndi_dir)/lib/mac-x64/libndi.4.dylib" ]
"files": [ "<(ndi_dir)/lib/mac-x64/libndi.dylib" ]
} ],
"link_settings": {
"libraries": [ "-Wl,-rpath,@loader_path", "-lndi.4" ],
"libraries": [ "-Wl,-rpath,@loader_path", "-lndi" ],
"library_dirs": [ "<(ndi_dir)/lib/mac-x64" ]
}
} ]
Expand Down
12 changes: 6 additions & 6 deletions ndi.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const tmp = require("tmp")
zip.unzipSync(file1, dir1)

/* download NDI SDK distribution */
const url2 = "https://downloads.ndi.tv/SDK/NDI_SDK/NDI 4 SDK.exe"
const url2 = "https://downloads.ndi.tv/SDK/NDI_SDK/NDI 5 SDK.exe"
console.log("-- dowloading NDI SDK distribution")
const data2 = await got(url2, { responseType: "buffer" })
const file2 = tmp.tmpNameSync()
Expand Down Expand Up @@ -76,7 +76,7 @@ const tmp = require("tmp")
}
else if (os.platform() === "darwin") {
/* download NDI SDK distribution */
const url1 = "https://downloads.ndi.tv/SDK/NDI_SDK_Mac/InstallNDISDK_v4_Apple.pkg"
const url1 = "https://downloads.ndi.tv/SDK/NDI_SDK_Mac/Install_NDI_SDK_v5_macOS.pkg"
console.log("-- dowloading NDI SDK distribution")
const data1 = await got(url1, { responseType: "buffer" })
const file1 = tmp.tmpNameSync()
Expand All @@ -96,8 +96,8 @@ const tmp = require("tmp")
shell.rm("-rf", "ndi")
shell.mkdir("-p", "ndi/include")
shell.mkdir("-p", "ndi/lib/mac-x64")
shell.mv(path.join(dir1, "NDI SDK for Apple/include/*.h"), "ndi/include/")
shell.mv(path.join(dir1, "NDI SDK for Apple/lib/x64/*.dylib"), "ndi/lib/mac-x64/")
shell.mv(path.join(dir1, "NDI SDK for macOS/include/*.h"), "ndi/include/")
shell.mv(path.join(dir1, "NDI SDK for macOS/lib/macOS/*.dylib"), "ndi/lib/mac-x64/")

/* remove temporary files */
console.log("-- removing temporary files")
Expand All @@ -106,7 +106,7 @@ const tmp = require("tmp")
}
else if (os.platform() === "linux") {
/* download NDI SDK distribution */
const url1 = "https://downloads.ndi.tv/SDK/NDI_SDK_Linux/InstallNDISDK_v4_Linux.tar.gz"
const url1 = "https://downloads.ndi.tv/SDK/NDI_SDK_Linux/Install_NDI_SDK_v5_Linux.tar.gz"
console.log("-- dowloading NDI SDK distribution")
const data1 = await got(url1, { responseType: "buffer" })
const file1 = tmp.tmpNameSync()
Expand All @@ -118,7 +118,7 @@ const tmp = require("tmp")
shell.mkdir("-p", dir1)
execa.sync("tar", [ "-z", "-x", "-C", dir1, "-f", file1 ],
{ stdin: "inherit", stdout: "inherit", stderr: "inherit" })
execa.sync("sh", [ "-c", `echo "y" | PAGER=cat sh InstallNDISDK_v4_Linux.sh` ],
execa.sync("sh", [ "-c", `echo "y" | PAGER=cat sh Install_NDI_SDK_v5_Linux.sh` ],
{ cwd: dir1, stdin: "inherit", stdout: "ignore", stderr: "inherit" })

/* assemble NDI SDK subset */
Expand Down

0 comments on commit ef02786

Please sign in to comment.