Package Details: duckstation-git 0.1.r6679.g17b9736-1

Git Clone URL: https://aur.archlinux.org/duckstation-git.git (read-only, click to copy)
Package Base: duckstation-git
Description: A Sony PlayStation (PSX) emulator, focusing on playability, speed, and long-term maintainability (git version)
Upstream URL: https://github.com/stenzek/duckstation
Keywords: emulator game gaming psone
Licenses: GPL-3.0-only
Conflicts: duckstation
Provides: duckstation
Submitter: jackdroido
Maintainer: eugene
Last Packager: eugene
Votes: 22
Popularity: 2.14
First Submitted: 2020-04-25 18:24 (UTC)
Last Updated: 2024-04-26 20:40 (UTC)

Required by (1)

Sources (7)

Latest Comments

1 2 3 4 5 6 .. 8 Next › Last »

eugene commented on 2024-04-18 10:25 (UTC)

I adopted most of your changes, @sl1pkn07. Your input is greatly appreciated.

sl1pkn07 commented on 2024-04-17 19:16 (UTC)

take one:. please test (for me build and run bioses, not tested with games)

# Contributor: katt <magunasu.b97@gmail.com>

pkgname=duckstation-git
_pkgname=duckstation
pkgver=0.1.r6674.gd918705
pkgdesc='A Sony PlayStation (PSX) emulator, focusing on playability, speed, and long-term maintainability (git version)'
pkgrel=1
arch=(x86_64 aarch64)
url=https://github.com/stenzek/duckstation
license=(GPL-3.0-only)
depends=(
    sh
    glibc
    gcc-libs
    sdl2
    qt6-base
    libwebp libwebp.so
    libjpeg-turbo libjpeg.so
    libpng libpng16.so
    libxrandr
    libx11
    freetype2 libfreetype.so
    zstd libzstd.so
    zlib libz.so
    dbus libdbus-1.so
    curl libcurl.so
    systemd-libs libudev.so
    hicolor-icon-theme
    libbacktrace-git libbacktrace.so
    )
makedepends=(
    git
    cmake
    clang
    lld
    llvm
    extra-cmake-modules
    qt6-tools
    qt6-wayland
    libdrm
    libpulse
    libwebp
    alsa-lib
    sndio
    ninja
    jack
    python
    )
optdepends=(
    'qt6-wayland: Wayland support'
    'libpulse: Pulseaudio support'
    'sndio: Small audio support'
    'alsa-lib: ALSA support'
    'jack: JACK support'
)
provides=('duckstation')
conflicts=('duckstation')
source=(git+"$url".git
    git+https://github.com/google/shaderc.git#tag=v2024.0
    git+https://github.com/KhronosGroup/glslang.git#commit=d73712b8f6c9047b09e99614e20d456d5ada2390
    git+https://github.com/KhronosGroup/SPIRV-Headers.git#commit=8b246ff75c6615ba4532fe4fde20f1be090c3764
    git+https://github.com/KhronosGroup/SPIRV-Tools.git#commit=04896c462d9f3f504c99a4698605b6524af813c1
    duckstation-qt.desktop
    duckstation-qt.sh)
sha256sums=(
    'SKIP'
    'c1f935c1e0338e274cea4f106fc3b13e02f4150e504a255ddb18221bd80bb416'
    '8c97fbe90abb311903b29d1fec8799e6e8a618ed2b69de6833dfed9252c85dad'
    'bbbdf1f65d11a5e6a1f03da5804e555af9c027e76f9dd22135a092f88b8a9b2b'
    '56bb21ba0a74b6a489398d5a6d429d7e38346ef67c21ee6df00395c990224701'
    'ec2d7358f81598390a8ceca2d1974be3e5f7c45602b550c89a1e9323ab45474b'
    '221a8fc0d1f0cebdf281acc26484e98ebbb59f876e12fdef3f03cf91380e31f5'
)
options=('!lto')

pkgver() {
    cd "$srcdir/$_pkgname"
    git describe --long --abbrev=7 | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
    echo "Building shaderc..."
    cd "$srcdir/shaderc"
    pushd third_party
        ln -sf ../../glslang ./
        ln -sf ../../SPIRV-Headers ./spirv-headers
        ln -sf ../../SPIRV-Tools ./spirv-tools
    popd
    git apply "$srcdir/$_pkgname/scripts/shaderc-changes.patch" \
      --exclude=CMakeLists.txt \
      --exclude=libshaderc/CMakeLists.txt \
      --exclude third_party/CMakeLists.txt

    cmake -B build \
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_PREFIX_PATH="$srcdir/deps" \
        -DCMAKE_INSTALL_PREFIX="$srcdir/deps" \
        -DSHADERC_SKIP_TESTS=ON \
        -DSHADERC_SKIP_EXAMPLES=ON \
        -DSHADERC_SKIP_COPYRIGHT_CHECK=ON \
        -G Ninja
    cmake --build build --parallel
    cmake --install build

    echo "Building duckstation..."
    cd "$srcdir"

    # preparation for find shaderc as static
    sed -e 's|shaderc_shared|shaderc_combined|g' \
        -e 's|PUBLIC Shaderc|PRIVATE Shaderc|g' \
        -i duckstation/CMakeModules/FindShaderc.cmake \
        -i duckstation/src/util/CMakeLists.txt
    sed '/INTERFACE_COMPILE/d' -i duckstation/CMakeModules/FindShaderc.cmake

    cmake -B build -S duckstation \
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_C_COMPILER=clang \
        -DCMAKE_CXX_COMPILER=clang++ \
        -DCMAKE_C_FLAGS="$CFLAGS -Wno-error=format-security" \
        -DCMAKE_CXX_FLAGS="$CXXFLAGS -Wno-error=format-security" \
        -DCMAKE_EXE_LINKER_FLAGS_INIT="-fuse-ld=lld" \
        -DCMAKE_MODULE_LINKER_FLAGS_INIT="-fuse-ld=lld" \
        -DCMAKE_SHARED_LINKER_FLAGS_INIT="-fuse-ld=lld" \
        -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \
        -DCMAKE_PREFIX_PATH="$srcdir/deps" \
        -DCMAKE_SKIP_RPATH=ON \
        -DBUILD_NOGUI_FRONTEND=OFF \
        -DBUILD_QT_FRONTEND=ON \
        -G Ninja \
        -Wno-dev
    cmake --build build --parallel
}

package() {
    # Initially install everything into /usr/lib/duckstation
    install -m 755 -d "${pkgdir}/usr/lib"
    cp -drv --no-preserve='ownership' build/bin "${pkgdir}/usr/lib/${_pkgname}"

    # Move shared data to /usr/share/duckstation
    cd "${pkgdir}/usr/lib/${_pkgname}"
    install -m 755 -d "${pkgdir}/usr/share/${_pkgname}"
    for _dir in resources translations
    do
        mv "${_dir}" "${pkgdir}/usr/share/${_pkgname}"
        ln -s "/usr/share/${_pkgname}/${_dir}" .
    done

    # Install additional license
    install -m 755 -d "${pkgdir}/usr/share/licenses/${pkgname}/"
    mv "${pkgdir}/usr/share/${_pkgname}/resources/thirdparty.html" "${pkgdir}/usr/share/licenses/${pkgname}/"
    ln -s "/usr/share/licenses/${pkgname}/thirdparty.html" "${pkgdir}/usr/share/${_pkgname}/resources/"

    install -Dvm755 "${srcdir}/duckstation-qt.sh" "${pkgdir}/usr/bin/duckstation-qt"
    install -Dvm644 "${srcdir}/duckstation-qt.desktop" "${pkgdir}/usr/share/applications/duckstation-qt.desktop"
    install -Dvm644 "${pkgdir}/usr/share/${_pkgname}/resources/images/duck.png" "${pkgdir}/usr/share/icons/hicolor/64x64/apps/duckstation-qt.png"
}

i take the liberty to add some dependencies described in the build process. can remove it if not need at all

greetings

sl1pkn07 commented on 2024-04-17 15:52 (UTC)

oh. i missread how build dusckstation their dependencies (normally this type of projects use gitmodules, but is not the case). let me check again your new pkgbuild posted below

greetings

sl1pkn07 commented on 2024-04-16 13:26 (UTC)

you not need build separately shaderrc in the pkgbuild, let duckstation build it when use their build environment.

let me time and i craft the pkgbuild for you

greetings

eugene commented on 2024-04-16 12:06 (UTC) (edited on 2024-04-16 12:41 (UTC) by eugene)

@sl1pkn07 I'm not sure it is possible.
Locally I modified PKBUILD to build shaderc as part of the package and to place it alongside duckstation binary. But implementation is rather ugly, and uses patchelf to mess with embedded paths.
To those who are curious: https://pastebin.com/hcy7FraF

sl1pkn07 commented on 2024-04-15 23:57 (UTC)

better make shaderrc with that custom patch as static library and build duskstation against it

greetings

eugene commented on 2024-04-15 16:12 (UTC) (edited on 2024-04-15 16:12 (UTC) by eugene)

@Niinu Reason for addition is this commit: https://github.com/stenzek/duckstation/commit/59eeb892432c587f3bff0400b93c26291c61ba05
Without shaderc-non-semantic-debug package build fails.

Niinu commented on 2024-04-15 14:39 (UTC)

The added shaderc-non-semantic-debug conflicts with shaderc that's a dependency of libplacebo which is a dependency of ffmpeg. Why is a patched shaderc package that only additionally outputs debug information needed?

vikbar54.9 commented on 2024-03-13 10:42 (UTC)

Since commit https://github.com/stenzek/duckstation/commit/12a24b9faec1d472b37b86efa2ea46842deed26d build fails on linking.