Skip to content

Commit

Permalink
feat: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ReenigneArcher committed Jul 9, 2024
1 parent 26abd9c commit 392178e
Show file tree
Hide file tree
Showing 7 changed files with 255 additions and 2 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/build-repo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
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 \
wget
- 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/[email protected]
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 }}'
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# ignore JetBrains IDE files
.idea/
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,19 @@
# 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. 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.
19 changes: 19 additions & 0 deletions build-pacman-repo.yaml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
allow-failure: false
dereference-database-symlinks: true
members:
- directory: sunshine
read-build-metadata: pkgbuild
46 changes: 46 additions & 0 deletions pkgbuilds/sunshine/.SRCINFO
Original file line number Diff line number Diff line change
@@ -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
89 changes: 89 additions & 0 deletions pkgbuilds/sunshine/PKGBUILD
Original file line number Diff line number Diff line change
@@ -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"
}
20 changes: 20 additions & 0 deletions pkgbuilds/sunshine/sunshine.install
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit 392178e

Please sign in to comment.