diff --git a/.github/workflows/tests-linux.yml b/.github/workflows/tests-linux.yml new file mode 100644 index 000000000000..d4f77a2a7ba1 --- /dev/null +++ b/.github/workflows/tests-linux.yml @@ -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 diff --git a/Formula/libva.rb b/Formula/libva.rb new file mode 100644 index 000000000000..e2660bfbf971 --- /dev/null +++ b/Formula/libva.rb @@ -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 + 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