Skip to content

Commit

Permalink
Merge branch homebrew/master into linuxbrew/master
Browse files Browse the repository at this point in the history
 Conflicts:
	.github/workflows/tests-linux.yml
  • Loading branch information
iMichka committed Dec 23, 2020
2 parents e012f42 + 599086d commit 454885b
Show file tree
Hide file tree
Showing 2 changed files with 116 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/tests-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: GitHub Actions CI
on:
pull_request:
paths:
- "Formula/alsa-lib.rb"
- "Formula/attr.rb"
- "Formula/device-mapper.rb"
- "Formula/libaio.rb"
- "Formula/ladspa-sdk.rb"
- "Formula/libbsd.rb"
- "Formula/libcap.rb"
- "Formula/libcap-ng.rb"
- "Formula/libdrm.rb"
- "Formula/libfuse.rb"
- "Formula/libmnl.rb"
- "Formula/libnetfilter-queue.rb"
- "Formula/libnfnetlink.rb"
- "Formula/libnsl.rb"
- "Formula/libpciaccess.rb"
- "Formula/libseccomp.rb"
- "Formula/libtirpc.rb"
- "Formula/libva.rb"
- "Formula/linux-headers.rb"
- "Formula/strace.rb"
- "Formula/valgrind.rb"
- "Formula/wayland.rb"
- "Formula/wayland-protocols.rb"
jobs:
check_labels_linux:
runs-on: ubuntu-latest
outputs:
run-tests: ${{ steps.check-labels.outputs.result }}
steps:
- name: Check for CI-syntax-only label
id: check-labels
uses: actions/github-script@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { data: { labels: labels } } = await github.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number
})
if (!labels.map(label => label.name).includes('CI-syntax-only')) {
console.log('No CI-syntax-only label found. Running tests.')
return true
}
console.log('CI-syntax-only label found. Skipping tests.')
tests_linux:
needs: check_labels_linux
if: needs.check_labels_linux.outputs.run-tests
runs-on: ubuntu-latest
container:
image: homebrew/ubuntu16.04:master
env:
HOMEBREW_CORE_GIT_REMOTE: ${{github.event.repository.html_url}}
HOMEBREW_FORCE_HOMEBREW_ON_LINUX: 1
steps:
- name: Set up Homebrew
uses: Homebrew/actions/setup-homebrew@master

- run: brew test-bot --only-cleanup-before

- run: brew test-bot --only-formulae --build-from-source
50 changes: 50 additions & 0 deletions Formula/libva.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
class Libva < Formula
desc "Hardware accelerated video processing library"
homepage "https://github.com/intel/libva"
url "https://github.com/intel/libva/releases/download/2.6.1/libva-2.6.1.tar.bz2"
sha256 "6c57eb642d828af2411aa38f55dc10111e8c98976dbab8fd62e48629401eaea5"
license "MIT"

livecheck do
url :stable
strategy :github_latest
end

depends_on "pkg-config" => [:build, :test]
depends_on "libdrm"
depends_on "libx11"
depends_on "libxext"
depends_on "libxfixes"
depends_on :linux
depends_on "wayland"

def install
system "./configure", "--prefix=#{prefix}",
"--sysconfdir=#{etc}",
"--localstatedir=#{var}",
"--disable-dependency-tracking",
"--disable-silent-rules",
"--enable-drm",
"--enable-x11",
"--disable-glx",
"--enable-wayland"
system "make"
system "make", "install"
end

test do
%w[libva libva-drm libva-wayland libva-x11].each do |name|
assert_match "-I#{include}", shell_output("pkg-config --cflags #{name}")
end
(testpath/"test.c").write <<~EOS
#include <va/va.h>
int main(int argc, char *argv[]) {
VADisplay display;
vaDisplayIsValid(display);
return 0;
}
EOS
system ENV.cc, "test.c", "-o", "test", "-I#{include}", "-L#{lib}", "-lva"
system "./test"
end
end

0 comments on commit 454885b

Please sign in to comment.