Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
95390bd8
Unverified
提交
95390bd8
authored
11月 27, 2023
作者:
Iñaki Baz Castillo
提交者:
GitHub
11月 27, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improvements to the build system (#1245)
上级
6821b55c
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
18 行增加
和
29 行删除
+18
-29
npm-scripts.mjs
npm-scripts.mjs
+4
-12
package.json
package.json
+8
-9
Cargo.toml
worker/Cargo.toml
+1
-1
Makefile
worker/Makefile
+1
-2
build.rs
worker/build.rs
+4
-5
没有找到文件。
npm-scripts.mjs
浏览文件 @
95390bd8
...
@@ -11,7 +11,6 @@ const IS_WINDOWS = os.platform() === 'win32';
...
@@ -11,7 +11,6 @@ const IS_WINDOWS = os.platform() === 'win32';
const
MAYOR_VERSION
=
PKG
.
version
.
split
(
'.'
)[
0
];
const
MAYOR_VERSION
=
PKG
.
version
.
split
(
'.'
)[
0
];
const
PYTHON
=
getPython
();
const
PYTHON
=
getPython
();
const
PIP_INVOKE_DIR
=
path
.
resolve
(
'worker/pip_invoke'
);
const
PIP_INVOKE_DIR
=
path
.
resolve
(
'worker/pip_invoke'
);
const
INVOKE_VERSION
=
process
.
env
.
INVOKE_VERSION
??
'2.2.0'
;
const
FLATBUFFERS_VERSION
=
'23.3.3'
;
const
FLATBUFFERS_VERSION
=
'23.3.3'
;
const
WORKER_RELEASE_DIR
=
'worker/out/Release'
;
const
WORKER_RELEASE_DIR
=
'worker/out/Release'
;
const
WORKER_RELEASE_BIN
=
IS_WINDOWS
?
'mediasoup-worker.exe'
:
'mediasoup-worker'
;
const
WORKER_RELEASE_BIN
=
IS_WINDOWS
?
'mediasoup-worker.exe'
:
'mediasoup-worker'
;
...
@@ -318,7 +317,8 @@ function installInvoke()
...
@@ -318,7 +317,8 @@ function installInvoke()
// Install pip invoke into custom location, so we don't depend on system-wide
// Install pip invoke into custom location, so we don't depend on system-wide
// installation.
// installation.
executeCmd
(
executeCmd
(
`"
${
PYTHON
}
" -m pip install --upgrade --target="
${
PIP_INVOKE_DIR
}
" invoke==
${
INVOKE_VERSION
}
`
,
/* exitOnError */
true
`"
${
PYTHON
}
" -m pip install --upgrade --target="
${
PIP_INVOKE_DIR
}
" invoke`
,
/* exitOnError */
true
);
);
}
}
...
@@ -331,15 +331,7 @@ function deleteNodeLib()
...
@@ -331,15 +331,7 @@ function deleteNodeLib()
logInfo
(
'deleteNodeLib()'
);
logInfo
(
'deleteNodeLib()'
);
if
(
!
IS_WINDOWS
)
fs
.
rmSync
(
'node/lib'
,
{
recursive
:
true
,
force
:
true
});
{
executeCmd
(
'rm -rf node/lib'
);
}
else
{
// NOTE: This command fails in Windows if the dir doesn't exist.
executeCmd
(
'rmdir /s /q "node/lib"'
,
/* exitOnError */
false
);
}
}
}
function
buildTypescript
({
force
=
false
}
=
{
force
:
false
})
function
buildTypescript
({
force
=
false
}
=
{
force
:
false
})
...
@@ -584,7 +576,7 @@ async function downloadPrebuiltWorker()
...
@@ -584,7 +576,7 @@ async function downloadPrebuiltWorker()
const
resolvedBinPath
=
path
.
resolve
(
WORKER_RELEASE_BIN_PATH
);
const
resolvedBinPath
=
path
.
resolve
(
WORKER_RELEASE_BIN_PATH
);
execSync
(
execSync
(
resolvedBinPath
,
`"
${
resolvedBinPath
}
"`
,
{
{
stdio
:
[
'ignore'
,
'ignore'
,
'ignore'
],
stdio
:
[
'ignore'
,
'ignore'
,
'ignore'
],
// Ensure no env is passed to avoid accidents.
// Ensure no env is passed to avoid accidents.
...
...
package.json
浏览文件 @
95390bd8
...
@@ -21,23 +21,22 @@
...
@@ -21,23 +21,22 @@
"types"
:
"node/lib/index.d.ts"
,
"types"
:
"node/lib/index.d.ts"
,
"files"
:
[
"files"
:
[
"node/lib"
,
"node/lib"
,
"worker/src"
,
"worker/deps/libwebrtc"
,
"worker/include"
,
"worker/fbs"
,
"worker/fbs"
,
"worker/test/src"
,
"worker/test/include"
,
"worker/fuzzer/src"
,
"worker/fuzzer/include"
,
"worker/fuzzer/include"
,
"worker/scripts/*.mjs"
,
"worker/fuzzer/src"
,
"worker/include"
,
"worker/src"
,
"worker/scripts/*.json"
,
"worker/scripts/*.json"
,
"worker/scripts/*.mjs"
,
"worker/scripts/*.py"
,
"worker/scripts/*.py"
,
"worker/scripts/*.sh"
,
"worker/scripts/*.sh"
,
"worker/subprojects/*.wrap"
,
"worker/subprojects/*.wrap"
,
"worker/deps/libwebrtc"
,
"worker/test/include"
,
"worker/tasks.py"
,
"worker/test/src"
,
"worker/Makefile"
,
"worker/meson.build"
,
"worker/meson.build"
,
"worker/meson_options.txt"
,
"worker/meson_options.txt"
,
"worker/tasks.py"
,
"npm-scripts.mjs"
"npm-scripts.mjs"
],
],
"engines"
:
{
"engines"
:
{
...
...
worker/Cargo.toml
浏览文件 @
95390bd8
...
@@ -21,9 +21,9 @@ include = [
...
@@ -21,9 +21,9 @@ include = [
"/test/src"
,
"/test/src"
,
"/build.rs"
,
"/build.rs"
,
"/Cargo.toml"
,
"/Cargo.toml"
,
"/Makefile"
,
"/meson.build"
,
"/meson.build"
,
"/meson_options.txt"
,
"/meson_options.txt"
,
"/tasks.py"
]
]
[package.metadata.docs.rs]
[package.metadata.docs.rs]
...
...
worker/Makefile
浏览文件 @
95390bd8
...
@@ -6,7 +6,6 @@
...
@@ -6,7 +6,6 @@
PYTHON
?=
$(
shell
command
-v
python3 2> /dev/null
||
echo
python
)
PYTHON
?=
$(
shell
command
-v
python3 2> /dev/null
||
echo
python
)
PIP_INVOKE_DIR
=
$(
shell
pwd
)
/pip_invoke
PIP_INVOKE_DIR
=
$(
shell
pwd
)
/pip_invoke
INVOKE_VERSION
?=
2.2.0
# Instruct Python where to look for invoke module.
# Instruct Python where to look for invoke module.
ifeq
($(OS),Windows_NT)
ifeq
($(OS),Windows_NT)
...
@@ -48,7 +47,7 @@ invoke:
...
@@ -48,7 +47,7 @@ invoke:
ifeq
($(wildcard
$(PIP_INVOKE_DIR)),)
ifeq
($(wildcard
$(PIP_INVOKE_DIR)),)
# Install pip invoke into custom location, so we don't depend on system-wide
# Install pip invoke into custom location, so we don't depend on system-wide
# installation.
# installation.
$(PYTHON)
-m
pip
install
--upgrade
--target
=
"
$(PIP_INVOKE_DIR)
"
invoke
==
$(INVOKE_VERSION)
$(PYTHON)
-m
pip
install
--upgrade
--target
=
"
$(PIP_INVOKE_DIR)
"
invoke
endif
endif
meson-ninja
:
invoke
meson-ninja
:
invoke
...
...
worker/build.rs
浏览文件 @
95390bd8
...
@@ -107,10 +107,8 @@ fn main() {
...
@@ -107,10 +107,8 @@ fn main() {
// Install Python invoke package in custom folder
// Install Python invoke package in custom folder
let
pip_invoke_dir
=
format!
(
"{out_dir}/pip_invoke"
);
let
pip_invoke_dir
=
format!
(
"{out_dir}/pip_invoke"
);
let
invoke_version
=
"2.2.0"
;
let
python
=
env
::
var
(
"PYTHON"
)
.unwrap_or
(
"python3"
.to_string
());
let
python
=
env
::
var
(
"PYTHON"
)
.unwrap_or
(
"python3"
.to_string
());
let
mut
pythonpath
=
if
env
::
var
(
"PYTHONPATH"
)
.is_ok
()
{
let
mut
pythonpath
=
if
let
Ok
(
original_pythonpath
)
=
env
::
var
(
"PYTHONPATH"
)
{
let
original_pythonpath
=
env
::
var
(
"PYTHONPATH"
)
.unwrap
();
format!
(
"{pip_invoke_dir}:{original_pythonpath}"
)
format!
(
"{pip_invoke_dir}:{original_pythonpath}"
)
}
else
{
}
else
{
pip_invoke_dir
.clone
()
pip_invoke_dir
.clone
()
...
@@ -126,8 +124,9 @@ fn main() {
...
@@ -126,8 +124,9 @@ fn main() {
.arg
(
"pip"
)
.arg
(
"pip"
)
.arg
(
"install"
)
.arg
(
"install"
)
.arg
(
"--upgrade"
)
.arg
(
"--upgrade"
)
.arg
(
format!
(
"--target={pip_invoke_dir}"
))
.arg
(
"--target"
)
.arg
(
format!
(
"invoke=={invoke_version}"
))
.arg
(
pip_invoke_dir
)
.arg
(
"invoke"
)
.spawn
()
.spawn
()
.expect
(
"Failed to start"
)
.expect
(
"Failed to start"
)
.wait
()
.wait
()
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论