From f5c2ca5dfe43820078ec6a0c49b1838b88b222b7 Mon Sep 17 00:00:00 2001 From: EnumDev Date: Thu, 9 Jul 2026 17:13:40 +0300 Subject: [PATCH] Initial commit --- .gitignore | 3 +++ check-version.sh | 12 +++++++++++ info.yml | 52 +++++++++++++++++++++++++++++++++++++++++++++++ recipe.sh | 53 ++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 120 insertions(+) create mode 100644 .gitignore create mode 100644 check-version.sh create mode 100644 info.yml create mode 100644 recipe.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9d96df7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Ignore BPM archives and signatures +*.bpm +*.bpm.sig diff --git a/check-version.sh b/check-version.sh new file mode 100644 index 0000000..1257c9c --- /dev/null +++ b/check-version.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Github repository +REPO="LizardByte/Sunshine" + +# Get tag name using Github Rest API +TAG_NAME=$(curl -s -L -H "X-GitHub-Api-Version: 2022-11-28" -H "Authorization: token ${GITHUB_API_TOKEN}" https://api.github.com/repos/"$REPO"/releases/latest | jq -r '.tag_name') + +# Trim 'v' character in TAG_NAME variable +VERSION=$(echo "$TAG_NAME" | tr -d 'v') + +echo "$VERSION" diff --git a/info.yml b/info.yml new file mode 100644 index 0000000..365ecef --- /dev/null +++ b/info.yml @@ -0,0 +1,52 @@ +name: sunshine +description: Self-hosted game stream host for Moonlight +version: 2026.516.143833 +revision: 1 +url: https://app.lizardbyte.dev/Sunshine +license: GPL-3.0-only +maintainers: + - enumdev@enumerated.dev +architecture: any +type: source +depends: + - avahi + - curl + - libayatana-appindicator + - libcap + - libdrm + - libevdev + - libmfx + - libnotify + - libpipewire + - libpulse + - libva + - libx11 + - libxcb + - libxfixes + - libxrandr + - libxtst + - miniupnpc + - numactl + - openssl + - opus + - udev + - vulkan-loader + - which +make_depends: + - appstream + - appstream-glib + - cmake + - desktop-file-utils + - git + - make + - nodejs + - npm + - python-jinja + - python-setuptools + - shaderc +downloads: + - url: https://github.com/LizardByte/Sunshine.git + type: git + clone_to: ${BPM_SOURCE} + git_branch: v${BPM_PKG_VERSION} + checksum: 14ffa6fdaa53f7b51512be2b3d24f3939695403c diff --git a/recipe.sh b/recipe.sh new file mode 100644 index 0000000..6c88685 --- /dev/null +++ b/recipe.sh @@ -0,0 +1,53 @@ +# This is the recipe.sh script. It is executed by BPM in a temporary directory when compiling a source package +# BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE +# BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT + +# Package recipe based on LizardByte's official arch PKGBUILD +# https://github.com/LizardByte/pacman-repo/blob/master/pkgbuilds/sunshine/PKGBUILD + +# The prepare function is executed in the root of the temp directory +# This function is used for putting downloaded files to the correct location or applying patches +prepare() { + cd "$BPM_SOURCE" + git submodule update --recursive --init +} + +# The build function is executed in the source directory +# This function is used to compile the source code +build() { + export BRANCH="master" + export BUILD_VERSION="${BPM_PKG_VERSION}" + export COMMIT=$(git rev-parse HEAD) + + export CC="gcc" + export CXX="g++" + + export CFLAGS="${CFLAGS/-Werror=format-security/}" + export CXXFLAGS="${CXXFLAGS/-Werror=format-security/}" + + cmake -B build \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DBUILD_DOCS=OFF \ + -DBUILD_WERROR=ON \ + -DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \ + -DSUNSHINE_ASSETS_DIR="share/sunshine" \ + -DSUNSHINE_ENABLE_CUDA=OFF \ + -DCUDA_FAIL_ON_MISSING=OFF \ + -DBUILD_TESTS=OFF + + appstreamcli validate "build/dev.lizardbyte.app.Sunshine.metainfo.xml" + appstream-util validate "build/dev.lizardbyte.app.Sunshine.metainfo.xml" + desktop-file-validate "build/dev.lizardbyte.app.Sunshine.desktop" + desktop-file-validate "build/dev.lizardbyte.app.Sunshine.terminal.desktop" + + cmake --build build +} + +# The package function is executed in the source directory +# This function is used to move the compiled files into the output directory +package() { + DESTDIR="$BPM_OUTPUT" cmake --install build + + # Install package license + install -Dm644 "$BPM_SOURCE"/LICENSE "$BPM_OUTPUT"/usr/share/licenses/sunshine/LICENSE +}