-
Notifications
You must be signed in to change notification settings - Fork 12
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
feat: Build with Alpine for static Linux binaries #42
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,10 @@ git clone https://code.videolan.org/videolan/x264.git | |
cd x264 | ||
git checkout "$tag" | ||
|
||
# NOTE: disable OpenCL-based features because it uses dlopen and can interfere | ||
# with static builds. | ||
./configure \ | ||
--disable-opencl \ | ||
Comment on lines
+25
to
+28
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. Q, so builds with these configurations aren't static anymore or the does building fail all together? 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. They aren't really static, since it uses dlopen to find OpenCL at runtime. Also, OpenCL isn't necessary for the H264 software codec. |
||
--enable-static | ||
|
||
# Only build and install the static library. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/sh | ||
|
||
# Copyright 2024 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# Returns 0 if this is Alpine Linux. | ||
|
||
OS_ID=$(cat /etc/os-release | grep ^ID= | cut -f 2 -d =) | ||
if [ "$OS_ID" = "alpine" -o "$OS_ID" = "NotpineForGHA" ]; then | ||
# It is Alpine or the modified version we have to trick GitHub. | ||
exit 0 | ||
fi | ||
|
||
# It is not Alpine. | ||
exit 1 |
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.
how things go when the matrix entry doesn't define a container? couldn't find it in github CI docs, but it seems to play nicely as we have green check marks on other platforms and the binaries are uploaded.
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.
I found that it just doesn't run in a container when
image
is blank. So this works nicely with the build matrix, and allows us to put some builds in containers and others not.