-
-
Notifications
You must be signed in to change notification settings - Fork 494
ffmpeg: fix build failure with gbk encoding #8812
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -137,6 +137,7 @@ package("ffmpeg") | |
| local configs = { | ||
| msystem = "MINGW64", | ||
| base_devel = true, | ||
| uchardet = true, | ||
| } | ||
| -- @see https://stackoverflow.com/questions/65438878/ffmpeg-build-on-windows-using-msvc-make-fails | ||
| configs.make = true | ||
|
|
@@ -271,6 +272,13 @@ package("ffmpeg") | |
| if package:is_arch("arm", "arm64") then | ||
| envs.PATH = path.join(os.programdir(), "scripts") .. path.envsep() .. envs.PATH | ||
| end | ||
| -- fix build failure with gbk encoding | ||
| io.replace("configure", "cp_if_changed $TMPH config.h", [[ | ||
| config_encodings=$(uchardet $TMPH) | ||
| case "$config_encodings" in GB18030|GBK|GB2312) | ||
| { printf '\xEF\xBB\xBF'; iconv -f "$config_encodings" -t UTF-8 -c $TMPH; } > config.h;; | ||
| *) cp_if_changed $TMPH config.h;; | ||
| esac]], {plain = true}) | ||
|
Comment on lines
+276
to
+281
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a great fix for the encoding issue. However, this |
||
| autoconf.install(package, configs, {envs = envs}) | ||
| else | ||
| import("core.base.option") | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For robustness, it's a good practice to quote the
$TMPHvariable in shell scripts to handle potential spaces or special characters in the file path.