Skip to content

Instantly share code, notes, and snippets.

@dasantonym
Last active October 23, 2017 06:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dasantonym/74a15caa27a93ab20903badba94783b5 to your computer and use it in GitHub Desktop.
Save dasantonym/74a15caa27a93ab20903badba94783b5 to your computer and use it in GitHub Desktop.
Downloads all required libs and installers for node-metakit on Windows
// Collecting some dependencies necessary for 'npm install' on Windows.
//
// Reference:
// https://github.com/Venemo/node-lmdb#building-node-lmdb-on-windows
// https://github.com/mateogianolio/vectorious#usage
//
// Put this file into the project root of https://github.com/piecemeta/node-metakit.git
// Then run "node ./mtk-dl-dependencies" and the files should be popping up
// in "./lib/x64", "./install/x64", "./install/x86", "./install/x86".
const
Promise = require('bluebird'),
path = require('path'),
wget = require('node-wget-promise'),
fs = require('fs-extra')
const libWin32 = {
src: [
// vectorious
'http://icl.cs.utk.edu/lapack-for-windows/libraries/VisualStudio/3.7.0/Dynamic-MINGW/Win32/libblas.dll',
'http://icl.cs.utk.edu/lapack-for-windows/libraries/VisualStudio/3.7.0/Dynamic-MINGW/Win32/libblas.lib',
'http://icl.cs.utk.edu/lapack-for-windows/libraries/VisualStudio/3.7.0/Dynamic-MINGW/Win32/liblapack.dll',
'http://icl.cs.utk.edu/lapack-for-windows/libraries/VisualStudio/3.7.0/Dynamic-MINGW/Win32/liblapack.lib',
'http://icl.cs.utk.edu/lapack-for-windows/libraries/VisualStudio/3.7.0/Dynamic-MINGW/Win32/liblapacke.dll',
'http://icl.cs.utk.edu/lapack-for-windows/libraries/VisualStudio/3.7.0/Dynamic-MINGW/Win32/liblapacke.lib',
'http://icl.cs.utk.edu/lapack-for-windows/libraries/VisualStudio/3.5.0/Static-INTEL/Win32/BLAS.lib',
'http://icl.cs.utk.edu/lapack-for-windows/libraries/VisualStudio/3.5.0/Static-INTEL/Win32/LAPACK.lib',
'http://icl.cs.utk.edu/lapack-for-windows/libraries/VisualStudio/3.5.0/Static-INTEL/Win32/LAPACKE.lib'
],
dest: path.join('lib', 'x86')
}
const installWin32 = {
src: [
'https://github.com/git-for-windows/git/releases/download/v2.14.2.windows.3/Git-2.14.2.3-32-bit.exe',
'https://nodejs.org/dist/v8.7.0/node-v8.7.0-x86.msi',
'https://download.microsoft.com/download/A/E/A/AEAE0F3F-96E9-4711-AADA-5E35EF902306/NDP47-KB3186500-Web.exe',
'https://downloads.sourceforge.net/project/mingw/Installer/mingw-get-setup.exe'
],
dest: path.join('install', 'x86')
}
const libWin64 = {
src: [
// vectorious
'http://icl.cs.utk.edu/lapack-for-windows/libraries/VisualStudio/3.7.0/Dynamic-MINGW/Win64/libblas.dll',
'http://icl.cs.utk.edu/lapack-for-windows/libraries/VisualStudio/3.7.0/Dynamic-MINGW/Win64/libblas.lib',
'http://icl.cs.utk.edu/lapack-for-windows/libraries/VisualStudio/3.7.0/Dynamic-MINGW/Win64/liblapack.dll',
'http://icl.cs.utk.edu/lapack-for-windows/libraries/VisualStudio/3.7.0/Dynamic-MINGW/Win64/liblapack.lib',
'http://icl.cs.utk.edu/lapack-for-windows/libraries/VisualStudio/3.7.0/Dynamic-MINGW/Win64/liblapacke.dll',
'http://icl.cs.utk.edu/lapack-for-windows/libraries/VisualStudio/3.7.0/Dynamic-MINGW/Win64/liblapacke.lib',
'http://icl.cs.utk.edu/lapack-for-windows/libraries/VisualStudio/3.5.0/Static-INTEL/Win64/BLAS.lib',
'http://icl.cs.utk.edu/lapack-for-windows/libraries/VisualStudio/3.5.0/Static-INTEL/Win64/LAPACK.lib',
'http://icl.cs.utk.edu/lapack-for-windows/libraries/VisualStudio/3.5.0/Static-INTEL/Win64/LAPACKE.lib'
],
dest: path.join('lib', 'x64')
}
const installWin64 = {
src: [
'https://github.com/git-for-windows/git/releases/download/v2.14.2.windows.3/Git-2.14.2.3-64-bit.exe',
'https://nodejs.org/dist/v8.7.0/node-v8.7.0-x64.msi',
'https://download.microsoft.com/download/A/E/A/AEAE0F3F-96E9-4711-AADA-5E35EF902306/NDP47-KB3186500-Web.exe',
'https://downloads.sourceforge.net/project/mingw/Installer/mingw-get-setup.exe'
],
dest: path.join('install', 'x64')
}
Promise.map([libWin32, installWin32, libWin64, installWin64], item => {
const dest = path.join(__dirname, item.dest)
return fs.ensureDir(path.resolve(dest))
.then(() => Promise.map(item.src, url => {
console.log('Loading', url, '...')
return wget(url, {output: path.join(dest, path.basename(url))})
.catch(err => console.log(`WARN: Error loading file at ${url}`, err.message, err.code))
}))
}).catch(err => console.log('FATAL:', err.message, err.code))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment