diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c8ffd6d..d5aeaac 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -47,8 +47,8 @@ jobs: - name: Build lsfg-vk-ui with appimage.sh run: | pushd ui - chmod +x appimage.sh - ./appimage.sh + chmod +x ../scripts/build/appimage.sh + ../scripts/build/appimage.sh popd - name: Install lsfg-vk-ui run: | diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml index 5dc2c69..274730c 100644 --- a/.github/workflows/flatpak.yml +++ b/.github/workflows/flatpak.yml @@ -20,5 +20,5 @@ jobs: uses: flatpak/flatpak-github-actions/flatpak-builder@v6 with: bundle: "org.freedesktop.Platform.VulkanLayer.lsfg_vk_TEST_${{ matrix.version }}.flatpak" - manifest-path: "flatpak/org.freedesktop.Platform.VulkanLayer.lsfgvk_${{ matrix.version }}.yml" + manifest-path: "scripts/flatpak/org.freedesktop.Platform.VulkanLayer.lsfgvk_${{ matrix.version }}.yml" verbose: true diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml new file mode 100644 index 0000000..48b0c68 --- /dev/null +++ b/.github/workflows/package.yml @@ -0,0 +1,46 @@ +name: (Test) Package lsfg-vk + +on: + workflow_run: + workflows: ["(Test) Build lsfg-vk"] + types: + - completed + branches: ["test/deploying"] + +jobs: + package: + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} + steps: + # prepare system + - name: Checkout repository + uses: actions/checkout@v4 + - name: Download lsfg-vk artifacts + uses: actions/download-artifact@v4 + with: + name: lsfg-vk_TEST + github-token: ${{ secrets.GITHUB_TOKEN }} + run-id: ${{ github.event.workflow_run.id }} + - name: Package lsfg-vk for various distros + run: | + export VERSION=$(grep -oP ' VERSION\s+\K[\d.]+' CMakeLists.txt) + chmod +x scripts/package/package.sh + ./scripts/package/package.sh + - name: Upload lsfg-vk for dpkg + uses: actions/upload-artifact@v4 + with: + name: lsfg-vk.dpkg_TEST + path: | + *.deb + - name: Upload lsfg-vk for rpm + uses: actions/upload-artifact@v4 + with: + name: lsfg-vk.rpm_TEST + path: | + *.rpm + - name: Upload lsfg-vk for alpm + uses: actions/upload-artifact@v4 + with: + name: lsfg-vk.alpm_TEST + path: | + *.zst diff --git a/VkLayer_LS_frame_generation.json b/VkLayer_LS_frame_generation.json index 8ad2906..8e8be3c 100644 --- a/VkLayer_LS_frame_generation.json +++ b/VkLayer_LS_frame_generation.json @@ -4,7 +4,7 @@ "name": "VK_LAYER_LS_frame_generation", "type": "GLOBAL", "api_version": "1.4.313", - "library_path": "../../../lib/liblsfg-vk.so", + "library_path": "liblsfg-vk.so", "implementation_version": "1", "description": "Lossless Scaling frame generation layer", "functions": { diff --git a/ui/appimage.sh b/scripts/build/appimage.sh similarity index 100% rename from ui/appimage.sh rename to scripts/build/appimage.sh diff --git a/flatpak/VkLayer_LS_frame_generation.patch b/scripts/flatpak/VkLayer_LS_frame_generation.patch similarity index 90% rename from flatpak/VkLayer_LS_frame_generation.patch rename to scripts/flatpak/VkLayer_LS_frame_generation.patch index b50ed75..7536718 100644 --- a/flatpak/VkLayer_LS_frame_generation.patch +++ b/scripts/flatpak/VkLayer_LS_frame_generation.patch @@ -6,7 +6,7 @@ index ece2a5f..774a027 100644 "name": "VK_LAYER_LS_frame_generation", "type": "GLOBAL", "api_version": "1.4.313", -- "library_path": "../../../lib/liblsfg-vk.so", +- "library_path": "liblsfg-vk.so", + "library_path": "/usr/lib/extensions/vulkan/lsfgvk/lib/liblsfg-vk.so", "implementation_version": "1", "description": "Lossless Scaling frame generation layer", diff --git a/flatpak/org.freedesktop.Platform.VulkanLayer.lsfgvk_23.08.yml b/scripts/flatpak/org.freedesktop.Platform.VulkanLayer.lsfgvk_23.08.yml similarity index 100% rename from flatpak/org.freedesktop.Platform.VulkanLayer.lsfgvk_23.08.yml rename to scripts/flatpak/org.freedesktop.Platform.VulkanLayer.lsfgvk_23.08.yml diff --git a/flatpak/org.freedesktop.Platform.VulkanLayer.lsfgvk_24.08.yml b/scripts/flatpak/org.freedesktop.Platform.VulkanLayer.lsfgvk_24.08.yml similarity index 100% rename from flatpak/org.freedesktop.Platform.VulkanLayer.lsfgvk_24.08.yml rename to scripts/flatpak/org.freedesktop.Platform.VulkanLayer.lsfgvk_24.08.yml diff --git a/scripts/package/alpm.PKGINFO b/scripts/package/alpm.PKGINFO new file mode 100644 index 0000000..578c549 --- /dev/null +++ b/scripts/package/alpm.PKGINFO @@ -0,0 +1,12 @@ +pkgname = lsfg-vk +pkgbase = lsfg-vk +pkgver = ${VERSION}-1 +pkgdesc = "Lossless Scaling Frame Generation on Linux via DXVK/Vulkan" +url = https://discord.gg/losslessscaling +packager = "PancakeTAS " +arch = x86_64 +license = MIT +depend = vulkan-icd-loader +depend = libadwaita +depend = gtk4 +depend = glibc diff --git a/scripts/package/dpkg.control b/scripts/package/dpkg.control new file mode 100644 index 0000000..4f0a0f6 --- /dev/null +++ b/scripts/package/dpkg.control @@ -0,0 +1,12 @@ +Package: lsfg-vk +Description: Lossless Scaling Frame Generation on Linux via DXVK/Vulkan +Homepage: https://discord.gg/losslessscaling +Maintainer: "PancakeTAS " +Version: ${VERSION}-1 +Architecture: amd64 +Section: utils +Priority: optional +Depends: libc6 (>= 2.38-1), + libvulkan1, + libadwaita-1-0, + libgtk-4-1 diff --git a/scripts/package/package.sh b/scripts/package/package.sh new file mode 100755 index 0000000..ba363ec --- /dev/null +++ b/scripts/package/package.sh @@ -0,0 +1,51 @@ +#!/bin/sh +if [ -z "$VERSION" ]; then + echo "VERSION environment variable is not set." + exit 1 +fi + +set -eux + +# build alpm package +echo "Building ALPM package..." + +mkdir -pv alpm +envsubst < scripts/package/alpm.PKGINFO > alpm/.PKGINFO + +mkdir -pv alpm/usr/{bin,lib,share/vulkan/implicit_layer.d} +cp -v bin/lsfg-vk-ui alpm/usr/bin/lsfg-vk +cp -v lib/liblsfg-vk.so alpm/usr/lib/liblsfg-vk.so +cp -v share/vulkan/implicit_layer.d/VkLayer_LS_frame_generation.json alpm/usr/share/vulkan/implicit_layer.d/VkLayer_LS_frame_generation.json + +tar -cvzf "lsfg-vk-$VERSION.x86_64.tar.zst" -C alpm \ + .PKGINFO usr + +# build dpkg package +echo "Building DEB package..." + +mkdir -pv deb/DEBIAN +envsubst < scripts/package/dpkg.control > deb/DEBIAN/control + +mkdir -pv deb/usr/{bin,lib,share/vulkan/implicit_layer.d} +cp -v bin/lsfg-vk-ui deb/usr/bin/lsfg-vk-ui +cp -v lib/liblsfg-vk.so deb/usr/lib/liblsfg-vk.so +cp -v share/vulkan/implicit_layer.d/VkLayer_LS_frame_generation.json deb/usr/share/vulkan/implicit_layer.d/VkLayer_LS_frame_generation.json + +dpkg-deb --root-owner-group --build deb "lsfg-vk-$VERSION.x86_64.deb" + +# build rpm package +echo "Building RPM package..." + +mkdir -pv rpm +envsubst < scripts/package/rpm.spec > rpm/lsfg-vk.spec + +mkdir -pv rpm/SOURCES +cp -v bin/lsfg-vk-ui rpm/SOURCES +cp lib/liblsfg-vk.so rpm/SOURCES +cp share/vulkan/implicit_layer.d/VkLayer_LS_frame_generation.json rpm/SOURCES + +rpmbuild -bb rpm/lsfg-vk.spec --define "_topdir $(pwd)/rpm" +mv -v "rpm/RPMS/x86_64/lsfg-vk-$VERSION-1.x86_64.rpm" "lsfg-vk-$VERSION.x86_64.rpm" + +# cleanup +rm -rf alpm deb rpm diff --git a/scripts/package/rpm.spec b/scripts/package/rpm.spec new file mode 100644 index 0000000..b1bd1fa --- /dev/null +++ b/scripts/package/rpm.spec @@ -0,0 +1,29 @@ +Name: lsfg-vk +Summary: Lossless Scaling Frame Generation on Linux via DXVK/Vulkan +Version: ${VERSION} +Release: 1%{?dist} +URL: https://discord.gg/losslessscaling +Packager: "PancakeTAS " +License: MIT +Group: Applications/System +BuildArch: x86_64 + +Requires: glibc >= 2.38 +Requires: vulkan-loader +Requires: libadwaita +Requires: gtk4 + +%global __strip /bin/true + +%description +Lossless Scaling Frame Generation on Linux via DXVK/Vulkan. + +%install +install -Dm755 %{_sourcedir}/lsfg-vk-ui %{buildroot}%{_bindir}/lsfg-vk-ui +install -Dm644 %{_sourcedir}/liblsfg-vk.so %{buildroot}%{_libdir}/liblsfg-vk.so +install -Dm644 %{_sourcedir}/VkLayer_LS_frame_generation.json %{buildroot}%{_datadir}/vulkan/implicit_layer.d/VkLayer_LS_frame_generation.json + +%files +%{_bindir}/lsfg-vk-ui +%{_libdir}/liblsfg-vk.so +%{_datadir}/vulkan/implicit_layer.d/VkLayer_LS_frame_generation.json