提交 7cc292c4 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

Improve Python 2 detection and improve installation documentation.

上级 fcb51c39
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
# make tasks for mediasoup-worker. # make tasks for mediasoup-worker.
# #
# Best effort to get Python 2 executable.
PYTHON:=$(type -p python2 || echo python)
.PHONY: default Release Debug test xcode clean clean-all .PHONY: default Release Debug test xcode clean clean-all
default: default:
...@@ -12,19 +15,19 @@ else ...@@ -12,19 +15,19 @@ else
endif endif
Release: Release:
cd worker && ./scripts/configure.py -R mediasoup-worker cd worker && $(PYTHON) ./scripts/configure.py -R mediasoup-worker
$(MAKE) BUILDTYPE=Release -C worker/out $(MAKE) BUILDTYPE=Release -C worker/out
Debug: Debug:
cd worker && ./scripts/configure.py -R mediasoup-worker cd worker && $(PYTHON) ./scripts/configure.py -R mediasoup-worker
$(MAKE) BUILDTYPE=Debug -C worker/out $(MAKE) BUILDTYPE=Debug -C worker/out
test: test:
cd worker && ./scripts/configure.py -R mediasoup-worker-test cd worker && $(PYTHON) ./scripts/configure.py -R mediasoup-worker-test
$(MAKE) BUILDTYPE=Release -C worker/out $(MAKE) BUILDTYPE=Release -C worker/out
xcode: xcode:
cd worker && ./scripts/configure.py --format=xcode cd worker && $(PYTHON) ./scripts/configure.py --format=xcode
clean: clean:
$(RM) -rf worker/out/Release/mediasoup-worker $(RM) -rf worker/out/Release/mediasoup-worker
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
You can support **mediasoup** by making a donation [here][paypal-url]. Thanks! You can support **mediasoup** by making a donation [here][paypal-url]. Thanks!
## Installation ## Installation
Within your Node.js application: Within your Node.js application:
...@@ -26,6 +25,16 @@ Within your Node.js application: ...@@ -26,6 +25,16 @@ Within your Node.js application:
$ npm install mediasoup --save $ npm install mediasoup --save
``` ```
Prior to that, ensure your host satisfies the following **requirements**:
* Node.js >= `v4.0.0`
* POSIX based operating system (Windows not yet supported)
* Python 2 (`python2` or `python` command must point to the Python 2 executable)
* `make`
* `gcc` and `g++`, or `clang`, with C++11 support
*NOTE:* In Debian and Ubuntu install the `build-essential` package. It includes both `make` and `gcc`/`g++`.
## Design goals ## Design goals
...@@ -44,15 +53,6 @@ $ npm install mediasoup --save ...@@ -44,15 +53,6 @@ $ npm install mediasoup --save
* Can handle RTP packets in JavaScript land. * Can handle RTP packets in JavaScript land.
## Requirements
* Node.js >= `v4.0.0`
* POSIX based operating system (Windows not yet supported)
* `Python` 2
* `make`
* `gcc` or `clang` with C++11 support
## Author ## Author
Iñaki Baz Castillo ([@ibc](https://github.com/ibc/) at Github) Iñaki Baz Castillo ([@ibc](https://github.com/ibc/) at Github)
......
...@@ -10,7 +10,7 @@ import sys ...@@ -10,7 +10,7 @@ import sys
version = sys.version_info[0] version = sys.version_info[0]
if version != 2: if version != 2:
raise RuntimeError('gyp requires Python 2, but this is Python ' + str(version)) raise RuntimeError('gyp requires Python 2, but this is Python ' + str(version) + ', ensure your python2 or python command points to the Python 2 executable')
CC = os.environ.get('CC', 'cc') CC = os.environ.get('CC', 'cc')
script_dir = os.path.dirname(__file__) script_dir = os.path.dirname(__file__)
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论