diff --git a/.github/workflows/build-repo.yml b/.github/workflows/build-repo.yml new file mode 100644 index 0000000..7a86d29 --- /dev/null +++ b/.github/workflows/build-repo.yml @@ -0,0 +1,66 @@ +--- +name: Build Pacman Repo + +on: + push: + branches: ["master"] + pull_request: + branches: ["master"] + schedule: + - cron: "0 0 * * *" + +concurrency: + group: "${{ github.workflow }}-${{ github.ref }}" + cancel-in-progress: true + +jobs: + build-pacman-repo: + runs-on: ubuntu-latest + container: + image: archlinux/archlinux:base-devel + steps: + - name: Container Setup + run: | + pacman -Syu --disable-download-timeout --needed --noconfirm \ + archlinux-keyring \ + git \ + reflector \ + wget + + - name: Update mirrors + run: | + reflector --latest 10 --protocol http,https --sort rate --save /etc/pacman.d/mirrorlist + + - name: Download Pacman Repo Builder + run: | + wget \ + https://github.com/pacman-repo-builder/pacman-repo-builder/releases/download/0.0.0-rc.65/build-pacman-repo-x86_64-unknown-linux-gnu \ + -O /usr/bin/build-pacman-repo + chmod +x /usr/bin/build-pacman-repo + + - name: Checkout + uses: actions/checkout@v4 + + - name: Checkout + uses: actions/checkout@v4 + with: + ref: repo + path: repo + persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token + fetch-depth: 0 # otherwise, will fail to push refs to dest repo + + - name: Build Pacman Repo + run: | + build-pacman-repo patch-makepkg --replace + build-pacman-repo build + + - name: GitHub Commit & Push + if: github.event_name == 'schedule' || github.event_name == 'push' + uses: actions-js/push@v1.5 + with: + author_email: ${{ secrets.GH_BOT_EMAIL }} + author_name: ${{ secrets.GH_BOT_NAME }} + branch: repo # commit to repo branch + directory: repo # use the repo directory + github_token: ${{ secrets.GH_BOT_TOKEN }} + message: 'Update per ${{ github.event_name }}: ${{ github.sha }}' diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4e15c52 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# ignore JetBrains IDE files +.idea/ diff --git a/README.md b/README.md index fd3e658..a8fab33 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,25 @@ -# template-base -Base repository template for LizardByte. +# LizardByte's Pacman Repository + +Repository of Arch Linux packages for LizardByte packages. + +> [!CAUTION] +> LizardByte does not support packages hosted on the AUR. The platform is not secure, since anyone is able to +> become the packager of an AUR repo. If you use the AUR, please carefully inspect any PKGBUILDS for packages that you +> are using, before any installation. This repository is the only official source of LizardByte packages. + +## Installation + +Add the following code snippet to your `/etc/pacman.conf`: + +```conf +[lizardbyte] +SigLevel = Optional +Server = https://raw.github.com/LizardByte/pacman-repo/repo +``` + +Then, run `sudo pacman -Sy` to update repository. + +## Considerations + +- To account for changes to any dependencies, packages in this repo are rebuilt once per day. +- Packages may have optional run time dependencies, you can review the PKGBUILD files for more information. diff --git a/build-pacman-repo.yaml b/build-pacman-repo.yaml new file mode 100644 index 0000000..1d4f900 --- /dev/null +++ b/build-pacman-repo.yaml @@ -0,0 +1,19 @@ +--- +global-settings: + repository: repo/repo.db.tar.gz + container: pkgbuilds + read-build-metadata: either + record-failed-builds: failed-builds.yaml + install-missing-dependencies: true + clean-before-build: false + clean-after-build: false + force-rebuild: true + pacman: pacman + arch-filter: [x86_64] + check: inherit + packager: LizardByte <108553330+LizardByte-bot@users.noreply.github.com> + allow-failure: false + dereference-database-symlinks: true +members: + - directory: sunshine + read-build-metadata: pkgbuild diff --git a/pkgbuilds/sunshine/.SRCINFO b/pkgbuilds/sunshine/.SRCINFO new file mode 100644 index 0000000..be9796b --- /dev/null +++ b/pkgbuilds/sunshine/.SRCINFO @@ -0,0 +1,46 @@ +pkgbase = sunshine + pkgdesc = A self-hosted GameStream host for Moonlight. + pkgver = 0.23.1 + pkgrel = 1 + url = https://app.lizardbyte.dev/Sunshine + install = sunshine.install + arch = x86_64 + arch = aarch64 + license = GPL-3.0-only + makedepends = boost + makedepends = cmake + makedepends = git + makedepends = make + makedepends = nodejs + makedepends = npm + depends = avahi + depends = boost-libs + depends = curl + depends = libayatana-appindicator + depends = libcap + depends = libdrm + depends = libevdev + depends = libmfx + depends = libnotify + depends = libpulse + depends = libva + depends = libvdpau + depends = libx11 + depends = libxcb + depends = libxfixes + depends = libxrandr + depends = libxtst + depends = miniupnpc + depends = numactl + depends = openssl + depends = opus + depends = python + depends = udev + optdepends = cuda: Nvidia GPU encoding support + optdepends = libva-mesa-driver: AMD GPU encoding support + optdepends = intel-media-driver: Intel GPU encoding support + optdepends = xorg-server-xvfb: Virtual X server for headless testing + source = sunshine::git+https://github.com/LizardByte/Sunshine.git#tag=v0.23.1 + sha256sums = SKIP + +pkgname = sunshine diff --git a/pkgbuilds/sunshine/PKGBUILD b/pkgbuilds/sunshine/PKGBUILD new file mode 100644 index 0000000..7bc3853 --- /dev/null +++ b/pkgbuilds/sunshine/PKGBUILD @@ -0,0 +1,89 @@ +# Edit on github: https://github.com/LizardByte/Sunshine/blob/master/packaging/linux/Arch/PKGBUILD +# Reference: https://wiki.archlinux.org/title/PKGBUILD + +pkgname=sunshine +pkgver=0.23.1 +pkgrel=1 +pkgdesc="A self-hosted GameStream host for Moonlight." +arch=('x86_64' 'aarch64') +url=https://app.lizardbyte.dev/Sunshine +license=('GPL-3.0-only') +install=sunshine.install + +_gcc_version=13 + +depends=('avahi' + 'boost-libs' + 'curl' + 'libayatana-appindicator' + 'libcap' + 'libdrm' + 'libevdev' + 'libmfx' + 'libnotify' + 'libpulse' + 'libva' + 'libvdpau' + 'libx11' + 'libxcb' + 'libxfixes' + 'libxrandr' + 'libxtst' + 'miniupnpc' + 'numactl' + 'openssl' + 'opus' + 'python' + 'udev') +makedepends=('boost' + 'cmake' + 'cuda' + "gcc${_gcc_version}" + 'git' + 'make' + 'nodejs' + 'npm') +optdepends=('cuda: Nvidia GPU encoding support' + 'libva-mesa-driver: AMD GPU encoding support' + 'xorg-server-xvfb: Virtual X server for headless testing') + +provides=() +conflicts=() + +source=("$pkgname::git+https://github.com/LizardByte/Sunshine.git#tag=v${pkgver}") +sha256sums=('SKIP') + +prepare() { + cd "$pkgname" + git submodule update --recursive --init + + # Allow use of miniupnpc > v0.17 + git cherry-pick -n a940cdb394055139ca6a964289f414da562452e3 +} + +build() { + export BRANCH="master" + export BUILD_VERSION="${pkgver}" + export COMMIT="$(git rev-parse HEAD)" + + export CC="gcc-${_gcc_version}" + export CXX="g++-${_gcc_version}" + + export CFLAGS="${CFLAGS/-Werror=format-security/}" + export CXXFLAGS="${CXXFLAGS/-Werror=format-security/}" + + cmake \ + -S "$pkgname" \ + -B build \ + -Wno-dev \ + -D BUILD_WERROR=ON \ + -D CMAKE_INSTALL_PREFIX=/usr \ + -D SUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \ + -D SUNSHINE_ASSETS_DIR="share/sunshine" + + make -C build +} + +package() { + make -C build install DESTDIR="$pkgdir" +} diff --git a/pkgbuilds/sunshine/sunshine.install b/pkgbuilds/sunshine/sunshine.install new file mode 100644 index 0000000..a8a700f --- /dev/null +++ b/pkgbuilds/sunshine/sunshine.install @@ -0,0 +1,20 @@ +do_setcap() { + setcap cap_sys_admin+p $(readlink -f $(which sunshine)) +} + +do_udev_reload() { + udevadm control --reload-rules + udevadm trigger --property-match=DEVNAME=/dev/uinput + modprobe uinput || true +} + +post_install() { + do_setcap + do_udev_reload +} + +post_upgrade() { + do_setcap + do_udev_reload +} +