Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Richard 祝发兴 - -IT
opencv-python
提交
4a626d86
O
opencv-python
项目概览
Richard 祝发兴 - -IT
/
opencv-python
与 Fork 源项目一致
Fork自
OpenCV / opencv-python
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
opencv-python
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
4a626d86
编写于
11月 25, 2018
作者:
O
Olli-Pekka Heinisuo
提交者:
GitHub
11月 25, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #146 from native-api/use_patched_ffmpeg
Use patched ffmpeg formula in OSX
上级
3d8a1e9b
c416449f
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
45 addition
and
2 deletion
+45
-2
config.sh
config.sh
+45
-2
未找到文件。
config.sh
浏览文件 @
4a626d86
...
@@ -33,13 +33,55 @@ if [ -n "$IS_OSX" ]; then
...
@@ -33,13 +33,55 @@ if [ -n "$IS_OSX" ]; then
BREW_SLOW_BUILIDING_PACKAGES
=
$(
printf
'%s\n'
\
BREW_SLOW_BUILIDING_PACKAGES
=
$(
printf
'%s\n'
\
"x265 20"
\
"x265 20"
\
"cmake 15"
\
"cmake 15"
\
"ffmpeg 10"
\
"ffmpeg
_opencv
10"
\
)
)
#Contrib adds significantly to project's build time
#Contrib adds significantly to project's build time
if
[
"
$ENABLE_CONTRIB
"
-eq
1
]
;
then
if
[
"
$ENABLE_CONTRIB
"
-eq
1
]
;
then
BREW_TIME_LIMIT
=
$((
BREW_TIME_LIMIT
-
10
*
60
))
BREW_TIME_LIMIT
=
$((
BREW_TIME_LIMIT
-
10
*
60
))
fi
fi
function
generate_ffmpeg_formula
{
local
FF
=
"ffmpeg"
local
LFF
=
"ffmpeg_opencv"
local
FF_FORMULA
;
FF_FORMULA
=
$(
brew formula
"
$FF
"
)
local
LFF_FORMULA
;
LFF_FORMULA
=
"
$(
dirname
"
$FF_FORMULA
"
)
/
${
LFF
}
.rb"
local
REGENERATE
if
[
-f
"
$LFF_FORMULA
"
]
;
then
local
UPSTREAM_VERSION VERSION
_brew_parse_package_info
"
$FF
"
" "
UPSTREAM_VERSION _ _
_brew_parse_package_info
"
$LFF
"
" "
VERSION _ _
||
REGENERATE
=
1
#`rebuild` clause is ignored on `brew bottle` and deleted
# from newly-generated formula on `brew bottle --merge` for some reason
# so can't compare rebuild numbers
if
[
"
$UPSTREAM_VERSION
"
!=
"
$VERSION
"
]
;
then
REGENERATE
=
1
fi
else
REGENERATE
=
1
fi
if
[
-n
"
$REGENERATE
"
]
;
then
echo
"Regenerating custom ffmpeg formula"
# Bottle block syntax: https://docs.brew.sh/Bottles#bottle-dsl-domain-specific-language
perl
-wpe
'BEGIN {our ($found_blank, $bottle_block);}
if (/(^class )(Ffmpeg)(\s.*)/) {$_=$1.$2."Opencv".$3."\n"; next;}
if (!$found_blank && /^$/) {$_.="conflicts_with \"ffmpeg\"\n\n"; $found_blank=1; next;}
if (!$bottle_block && /^\s*bottle do$/) { $bottle_block=1; next; }
if ($bottle_block) { if (/^\s*end\s*$/) { $bottle_block=0} elsif (/^\s*sha256\s/) {$_=""} next; }
if (/^\s*depends_on "(x264|x265|xvid)"$/) {$_=""; next;}
if (/^\s*--enable-(gpl|libx264|libx265|libxvid)$/) {$_=""; next;}
'
<
"
$FF_FORMULA
"
>
"
$LFF_FORMULA
"
diff
-u
"
$FF_FORMULA
"
"
$LFF_FORMULA
"
||
test
$?
-le
1
(
cd
"
$(
dirname
"
$LFF_FORMULA
"
)
"
# This is the official way to add a formula
# https://docs.brew.sh/Formula-Cookbook#commit
git add
"
$(
basename
"
$LFF_FORMULA
"
)
"
git commit
-m
"add/update custom ffmpeg
${
VERSION
}
"
)
fi
}
fi
fi
...
@@ -71,7 +113,8 @@ function pre_build {
...
@@ -71,7 +113,8 @@ function pre_build {
echo
'Installing FFmpeg'
echo
'Installing FFmpeg'
brew_install_and_cache_within_time_limit ffmpeg
||
{
[
$?
-gt
1
]
&&
return
2
||
return
0
;
}
generate_ffmpeg_formula
brew_install_and_cache_within_time_limit ffmpeg_opencv
||
{
[
$?
-gt
1
]
&&
return
2
||
return
0
;
}
else
else
echo
"Running for linux"
echo
"Running for linux"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录