Git Product home page Git Product logo

Comments (4)

cscott avatar cscott commented on August 28, 2024

See also TryGhost/node-sqlite3#248

from node-pre-gyp.

springmeyer avatar springmeyer commented on August 28, 2024

@cscott okay, this feature is ready to test as of 1670153. Please see the test apps in test/ for examples. Can you give this a try?

from node-pre-gyp.

springmeyer avatar springmeyer commented on August 28, 2024

Done in v0.5.x. This is now opt-in and as simple as adding versioned variables to module_path like was done for node-sqlite3 in TryGhost/node-sqlite3@5c2593d:

"module_path": "./lib/binding/{node_abi}-{platform}-{arch}",

from node-pre-gyp.

konsumer avatar konsumer commented on August 28, 2024

I am having an issue supporting multiple platforms. I am probably doing something wrong. I am making a grunt task to pre-gyp serialport for packaging in nodewebkit runtimes for several supported platforms. I am building up the argv & using prog.parseArgv(argv); to accomplish this:

var gulp = require('gulp'),
  NodePreGyp = require('node-pre-gyp'),
  path = require('path');

var supported =  ['win32:ia32', 'darwin:x64', 'linux:ia32', 'linux:x64'];
var nw_version = '0.11.2';

function pregyp(module, done){
  process.chdir(path.join(__dirname, 'node_modules',module));
  var prog = new NodePreGyp.Run();
  var argv = ['node', 'node-pre-gyp', '--runtime=node-webkit', '--fallback-to-build', '--target=' + nw_version];
  supported.forEach(function(p){
    var plat = p.split(':');
    [ 'install',
      '--target_platform=' + plat[0],
      '--target_arch=' + plat[1]
    ].forEach(function(c){ argv.push(c); });
  });
  console.log(argv.join(' '))
  prog.parseArgv(argv);
  function run(){
    var command = prog.todo.shift();
    if (!command) {
      return done();
    }
    prog.commands[command.name](command.args, function(err){
      if (err) return done(err);
      process.nextTick(run);
    });
  }
  run();
}

gulp.task('pregyp:serial', function(done){
  pregyp('serialport', done);  
});

This, given my understanding of how this module works, build roughly the same thing as this:

node node-pre-gyp --runtime=node-webkit --fallback-to-build --target=0.11.2 install --target_platform=win32 --target_arch=ia32 install --target_platform=darwin --target_arch=x64 install --target_platform=linux --target_arch=ia32 install --target_platform=linux --target_arch=x64

When I run this, it does it's thing, and downloads some pre-builts and builds some stuff, without errors, but they all get copied to node_modules/serialport/build/serialport/v1.4.9/Release/node-webkit-v0.11.2-win32,darwin,linux,linux-ia32,x64,ia32,x64/serialport.node

What am I doing wrong?

from node-pre-gyp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.