sync with OpenBSD -current

This commit is contained in:
purplerain 2024-07-20 20:41:33 +00:00
parent b5b25afdb8
commit 2c72e27ed2
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
147 changed files with 41128 additions and 10 deletions

6
lib/libva/.github/dependabot.yml vendored Normal file
View file

@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

View file

@ -0,0 +1,38 @@
param(
[Parameter()]
[String]$architecture
)
function EnterDevShellEnv {
param(
[Parameter()]
[String]$arch
)
$vsw = Get-Command 'vswhere'
$VSFfavors = 'Community','Professional','Enterprise','BuildTools' | %{ "Microsoft.VisualStudio.Product.$_" }
$vs = & $vsw.Path -products $VSFfavors -latest -format json | ConvertFrom-Json
$tools_dir = Join-Path $vs.installationPath 'Common7' 'Tools'
# Try the root tools dir
$devshell = Join-Path $tools_dir 'Microsoft.VisualStudio.DevShell.dll'
# Try finding it under vsdevshell
if (!(Test-Path $devshell -Type Leaf)) {
$devshell = Join-Path $tools_dir 'vsdevshell' 'Microsoft.VisualStudio.DevShell.dll'
}
# Fail if didn't find the DevShell library
if (!(Test-Path $devshell -Type Leaf)) {
throw "error: cannot find Microsoft.VisualStudio.DevShell.dll"
}
Import-Module $devshell
Enter-VsDevShell -VsInstanceId $vs.instanceId -SkipAutomaticLocation -DevCmdArguments "-arch=$arch -no_logo"
}
# Enter VsDevShell, capture the environment difference and export it to github env
$env_before = @{}
Get-ChildItem env: | %{ $env_before.Add($_.Name, $_.Value) }
EnterDevShellEnv -arch "$architecture"
$env_after = @{}
Get-ChildItem env: | %{ $env_after.Add($_.Name, $_.Value) }
$env_diff = $env_after.GetEnumerator() | where { -not $env_before.ContainsKey($_.Name) -or $env_before[$_.Name] -ne $_.Value }
$env_diff | %{ echo "$($_.Name)=$($_.Value)" >> $env:GITHUB_ENV }

30
lib/libva/.github/workflows/docs.yml vendored Normal file
View file

@ -0,0 +1,30 @@
name: docs
permissions:
contents: read
on:
push:
paths-ignore:
- '.github/workflows/**'
- '!.github/workflows/docs.yml'
pull_request:
paths-ignore:
- '.github/workflows/**'
- '!.github/workflows/docs.yml'
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: install prerequisites
run: |
sudo apt-get update
sudo apt-get install -y \
doxygen \
libdrm-dev \
meson
- name: build the docs
run: meson setup _build -D enable_docs=true && meson compile -C _build

23
lib/libva/.github/workflows/freebsd.yml vendored Normal file
View file

@ -0,0 +1,23 @@
name: freebsd
permissions:
contents: read
on: [push, pull_request]
jobs:
freebsd:
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Install prerequisites and build'
uses: vmactions/freebsd-vm@v1
with:
prepare: |
pkg install -y meson pkgconf libdrm libXext libXfixes wayland
pkg install -y -x '^mesa($|-libs)'
run: |
meson setup _build -D werror=true
meson compile -C _build
meson install -C _build

57
lib/libva/.github/workflows/ghpages.yml vendored Normal file
View file

@ -0,0 +1,57 @@
name: Deploy Docs to GitHub
on:
release:
types: [published]
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-22.04
steps:
- name: 'Checkout'
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 'Get latest tag'
run: echo "GIT_LATEST_TAG=$(git tag | grep '^[0-9]\+\.[0-9]\+\?\.[0-9]\+\?$' | sort -V -r | head -n1)" >> $GITHUB_ENV
- name: 'Variables'
run: |
echo $GITHUB_REF_NAME
echo $GIT_LATEST_TAG
- name: 'Install prerequisites'
if: github.ref_name == env.GIT_LATEST_TAG
run: |
sudo apt-get update
sudo apt-get install -y \
libdrm-dev \
doxygen \
meson \
- name: 'Build the Docs'
if: github.ref_name == env.GIT_LATEST_TAG
run: meson setup _build -D enable_docs=true && meson compile -C _build
- name: 'Upload the artifacts'
if: github.ref_name == env.GIT_LATEST_TAG
uses: actions/upload-pages-artifact@v3
with:
path: "_build/doc/html-out"
- name: 'Deploy to GitHub Pages'
if: github.ref_name == env.GIT_LATEST_TAG
id: deployment
uses: actions/deploy-pages@v4

View file

@ -0,0 +1,32 @@
#!/bin/bash
set -euo pipefail
if (( $# != 1 )); then
echo Script requires one argument - the clang version to be installed
exit 1
fi
if ! which $CC >/dev/null 2>&1; then
case $DISTRO in
"ubuntu-22.04") distro_name=jammy;;
"ubuntu-20.04") distro_name=focal;;
*)
echo "Unknown distribution $DISTRO"
exit 1
esac
case $1 in
"14" | "15") llvm_version=$1;;
*)
echo "Unknown llvm version $1"
exit 1
esac
sources="deb [trusted=yes] http://apt.llvm.org/$distro_name/ llvm-toolchain-$distro_name-$llvm_version main"
echo "clang-$llvm_version missed in the image, installing from llvm"
echo "$sources" | sudo tee -a /etc/apt/sources.list
sudo apt-get update
sudo apt-get install -y --no-install-recommends clang-$llvm_version
fi

18
lib/libva/.github/workflows/style.sh vendored Normal file
View file

@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -euo pipefail
modified_lines=$(git status --short -uno | wc -l)
(( modified_lines == 0 )) && exit 0
echo >&2
echo >&2 "ERROR: Style changes detected"
echo >&2
git diff
echo >&2
echo >&2 "ERROR: Squash the above changes as needed"
echo >&2
exit 1

21
lib/libva/.github/workflows/style.yml vendored Normal file
View file

@ -0,0 +1,21 @@
name: style
permissions:
contents: read
on: [push, pull_request]
jobs:
style-check:
runs-on: ubuntu-22.04
steps:
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Install prerequisites'
run: |
sudo apt-get update
sudo apt-get install -y \
astyle
- name: 'Check for style changes'
run: ./style_unify && .github/workflows/style.sh

62
lib/libva/.github/workflows/ubuntu.yml vendored Normal file
View file

@ -0,0 +1,62 @@
name: ubuntu
permissions:
contents: read
on: [push, pull_request]
env:
CFLAGS: -Wall -Werror
jobs:
test:
strategy:
matrix:
compiler: [clang-15, gcc]
os: [ubuntu-22.04, ubuntu-20.04]
build: [meson, autotools]
runs-on: ${{ matrix.os }}
env:
CC: ${{ matrix.compiler }}
DISTRO: ${{ matrix.os }}
steps:
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Install toolchain'
if: ${{ (matrix.compiler == 'clang-15') }}
run: .github/workflows/install-clang.sh 15
- name: 'Install prerequisites'
run: |
sudo apt-get update
sudo apt-get install -y \
libdrm-dev \
libegl1-mesa-dev \
libgl1-mesa-dev \
libx11-dev \
libx11-xcb-dev \
libxcb-dri3-dev \
libxext-dev \
libxfixes-dev \
libwayland-dev \
meson
- name: 'Print compiler version'
run: ${{ matrix.compiler }} --version
- name: 'Configure (meson)'
if: ${{ (matrix.build == 'meson') }}
run: meson setup ./builddir --prefix=/usr
- name: 'Build (meson)'
if: ${{ (matrix.build == 'meson') }}
run: meson compile -C ./builddir || ninja -C ./builddir
- name: 'Install (meson)'
if: ${{ (matrix.build == 'meson') }}
run: sudo meson install -C ./builddir
- name: 'Configure (autotools)'
if: ${{ (matrix.build == 'autotools') }}
run: ./autogen.sh --prefix=/usr
- name: 'Build (autotools)'
if: ${{ (matrix.build == 'autotools') }}
run: make
- name: 'Build and Install (autotools)'
if: ${{ (matrix.build == 'autotools') }}
run: sudo make install

77
lib/libva/.github/workflows/windows.yml vendored Normal file
View file

@ -0,0 +1,77 @@
name: windows
permissions:
contents: read
on: [push, pull_request]
jobs:
windows-msvc:
runs-on: windows-2022
steps:
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Setup Python'
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: 'Install Meson'
run: pip install meson
- name: 'Enter DevShell'
run: '.github\workflows\EnterDevShell.ps1 ${{ inputs.architecture }}'
shell: pwsh
- name: 'Configure with meson'
run: meson setup _build -D werror=true
- name: 'Build'
run: meson compile -C _build
- name: 'Install'
run: meson install -C _build
windows-msvc-debug:
runs-on: windows-2022
steps:
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Setup Python'
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: 'Install Meson'
run: pip install meson
- name: 'Enter DevShell'
run: '.github\workflows\EnterDevShell.ps1 ${{ inputs.architecture }}'
shell: pwsh
- name: 'Configure with meson'
run: meson setup _build -D werror=true -D buildtype=debug
- name: 'Build'
run: meson compile -C _build
- name: 'Install'
run: meson install -C _build
windows-mingw:
runs-on: windows-2022
env:
CC: gcc
defaults:
run:
shell: msys2 {0}
steps:
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Setup MSYS2'
uses: msys2/setup-msys2@v2
with:
msystem: mingw64
update: false
pacboy: >-
toolchain:p
meson:p
- name: 'Enter DevShell'
run: '.github\workflows\EnterDevShell.ps1 ${{ inputs.architecture }}'
shell: pwsh
- name: 'Configure'
run: meson setup _build -D werror=true
- name: 'Build'
run: meson compile -C _build
- name: 'Install'
run: meson install -C _build