Building Appjs

ASHISH NEGI edited this page Sep 5, 2013 · 11 revisions

Appjs is cross platform (Windows / MacOs / Linux).

Windows

The following guide worked on a fresh install of windows 7 on 2013-01-03.

There are two main ways to prepare a machine to be able to compile the appjs source code. One involves using the MozillaBuild environment, check the appjs forums for information on this method. The other method is documented here. We start from a completely new install of windows 7 and then go through all of the necessary steps to get a full working environment. Skip any steps that are already setup on your machine.

NPM / node-gyp

The first step involves creating a working npm environment that is able to compile C++ modules.

  • Go to nodejs.org and click on the install button to get the latest version of node.
  • Click on the "Node.js Command Prompt" link and then type in:

    npm install -g node-gyp

  • Install python (version 2.7.3 since version 3.* versions are not compatible).
  • Create an environment variable PYTHON = <install directory>\python.exe

C++ Compiler setup

This section details using the free visual studio express edition since that is available for all.

To test for a working environment you can open the nodejs command prompt and enter the following:

 npm install sqlite3

It may give some warnings but as long as it does not show any red colours then it should print something like

sqlite3@2.1.5 node_modules\sqlite3

Building Appjs

  • git clone https://github.com/appjs/appjs
  • Download the cef binary from https://github.com/appjs/appjs/downloads
    • extract to appjs/deps/cef
    • you can download the 32 bit and 64 bit version and swap between them when compiling for different architectures.
    • SET npm_config_arch=ia32 to build for 32 bit
    • SET npm_config_arch=x64 to build for 64 bit.
  • In the "Windows SDK 7.1 Command Prompt"

    • cd to appjs directory
    • install node modules:
      • npm install mime
    • to build for 32bit on a 64bit machine:
      • setenv /x86
      • SET npm_config_arch=ia32
    • then in the appjs directory type

      node-gyp rebuild > build.log