build-webrtc is a wrapper around WebRTC's build scripts that aims to make downloading and getting started with WebRTC simple, especially for Node Addons. Since building WebRTC from source is quite cumbersome, build-webrtc includes features to download (and upload) pre-compiled binaries, along with the header files. Ideally anyone using this project can rely on binaries alone.
Alas, if you are reading this far, you probably need to build from source or better understand this tool. If so, read on!
Warning: If you have trouble building WebRTC with build-webrtc, ensure you can build WebRTC normally by following WebRTC's own build instructions before opening an issue.
build-webrtc is structured around Jake. You don't need
jake installed or on your path to call these commands; they are all
accessible via npm run
. There are also dependencies between the commands
(not described here), so calling one command may trigger its pre-requisites if
they have not yet been satisfied.
Many commands can also be configured by setting environment variables and/or configuring a config.json file. Refer to each command and the sample config.default.json for more information.
npm run build-webrtc
jake build-webrtc
This command will build WebRTC.
Need to customize the build? Any environment variables you can set during
a normal build of WebRTC can be set before running this command; for example,
GYP_DEFINES
, GYP_MSVS_VERSION
, etc.
npm run checkout-depot_tools
jake checkout-depot_tools
This command will checkout depot_tools.
Already have depot_tools? Set the environment variable
DEPOT_TOOLS_CHECKOUT
or the config.json variable depot_tools.checkout
to
your depot_tools checkout. This will short-circuit the command.
npm run checkout-webrtc
jake checkout-webrtc
This command will checkout WebRTC.
Already have WebRTC? Set the environment variable WEBRTC_CHECKOUT
or the
config.json variable webrtc.checkout
to your WebRTC checkout. This will
short-circuit the initial gclient sync
.
Want to check out a different git ref? Set the environment variable
WEBRTC_REF
or the config.json variable webrtc.ref
to your desired git
ref.
npm run copy-webrtc
jake copy-webrtc
This command runs both build-webrtc and copy-webrtc-headers.
Want to copy to a different directory? Set the environment variable OUT
to
the desired directory.
npm run copy-webrtc-headers
jake copy-webrtc-headers
This command will copy WebRTC headers from your WebRTC checkout into the include directory.
Want to copy to a different directory? Set the environment variable OUT
to
the desired directory.
npm run lint
jake lint
This command will lint the build scripts (useful if you are developing build-webrtc).
npm run package-webrtc
jake package-webrtc
This command will package libraries and headers into a gzipped tarball.
npm run publish-webrtc
jake publish-webrtc
This command will publish the gzipped tarball. You need to specify environment
variables AWS_ACCESS_KEY_ID
, AWS_SECRET_ACCESS_KEY
, and BUCKET
, or set
the config.json variables aws.accessKeyId
, aws.secretAccessKey
, and
aws.bucket
.
npm run show-webrtc-branch-head
jake show-webrtc-branch-head
This command will show the branch head (if any) of the current WebRTC checkout.
npm run show-webrtc-commit
jake show-webrtc-commit
This command will show the commit of the current WebRTC checkout.
npm run show-webrtc-tar.gz-name
jake show-webrtc-tar.gz-name
This command will show the name of the gzipped tarball that package-webrtc will produce.
npm run write-webrtc-commit
jake write-webrtc-commit
Write the WebRTC commit to a file, WEBRTC_COMMIT.
Want to copy to a different directory? Set the environment variable OUT
to
the desired directory.