summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 153db1329301045f12c70765c768bee28d76063c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# Maintainer: rafaelff <rafaelff@gnome.org>, WeirdBeard <obarrtimothy@gmail.com>
# Contributor: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: Themaister <maister@archlinux.us>

pkgname=pcsx2-git
pkgver=v1.7.4268.r0.gad12a3f73
pkgrel=1
pkgdesc='A Sony PlayStation 2 emulator'
arch=(x86_64)
url=https://www.pcsx2.net
license=(
    GPL2
    GPL3
    LGPL2.1
    LGPL3
)

install=post.install

depends=(
    libaio
    libjpeg-turbo
    libpcap
    libzip
    libgl # For Steam Deck
    xorg-xrandr # For Steam Deck
    libxrender # For Steam Deck
    linux-api-headers # For Steam Deck
    libpulse
    ffmpeg
    portaudio
    libsamplerate
    sdl2
    rapidyaml
    qt6-base
    qt6-wayland
    qt6-tools
    qt6-svg
    soundtouch
    wayland
    zstd
)
makedepends=(
    cmake
    clang
    lld
    llvm
    git
    xorgproto
    ninja
    swig
    python
    vulkan-headers
)

provides=(pcsx2-qt)

conflicts=(pcsx2)

source=(
    git+https://github.com/PCSX2/pcsx2.git
    git+https://github.com/google/googletest.git
    git+https://github.com/fmtlib/fmt.git
    git+https://github.com/microsoft/wil.git
    git+https://github.com/rtissera/libchdr.git
    git+https://github.com/biojppm/rapidyaml.git
    git+https://github.com/KhronosGroup/glslang.git
    git+https://github.com/KhronosGroup/Vulkan-Headers.git
    git+https://github.com/libsdl-org/SDL.git
    git+https://github.com/nih-at/libzip.git
    git+https://github.com/facebook/zstd.git
    git+https://github.com/RetroAchievements/rcheevos.git
    0001-Fix-resources-Fix-CMake.patch
)

prepare()
{
    cd pcsx2
    git apply -3 "${srcdir}/0001-Fix-resources-Fix-CMake.patch"
    
    git config --global protocol.file.allow always
    local submodule
    for submodule in 3rdparty/{glslang/glslang,libchdr/libchdr,rapidyaml/rapidyaml,rcheevos/rcheevos}; do
        git submodule init ${submodule}
        git submodule set-url ${submodule} "${srcdir}/${submodule##*/}"
        git submodule update ${submodule}
    done
    cd 3rdparty/rapidyaml/rapidyaml
    for submodule in ext/c4core; do
        git submodule init ${submodule}
        git submodule set-url ${submodule} "${srcdir}/${submodule##*/}"
        git submodule update ${submodule}
    done
    cd ext/c4core
    git submodule init cmake
    git submodule set-url cmake "${srcdir}"/cmake
    git submodule update cmake
    for submodule in src/c4/ext/debugbreak; do
        git submodule init ${submodule}
        git submodule set-url ${submodule} "${srcdir}/${submodule##*/}"
        git submodule update ${submodule}
    done
    for submodule in src/c4/ext/fast_float; do
        git submodule init ${submodule}
        git submodule set-url ${submodule} "${srcdir}/${submodule##*/}"
        git submodule update ${submodule}
    done
}

pkgver()
{
    cd pcsx2
    git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build()
{
    mkdir -p build
    cd build
    
    cmake ../pcsx2 \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \
    -DCMAKE_C_COMPILER=clang \
    -DCMAKE_CXX_COMPILER=clang++ \
    -DCMAKE_MODULE_LINKER_FLAGS_INIT="-fuse-ld=lld" \
    -DCMAKE_SHARED_LINKER_FLAGS_INIT="-fuse-ld=lld" \
    -DWAYLAND_API=ON \
    -DQT_BUILD=ON \
    -DUSE_VULKAN=ON \
    -DDISABLE_ADVANCE_SIMD=ON \
    -GNinja \
    -DPACKAGE_MODE=ON
    ninja -j$(nproc)
    cd ..
    cp -r pcsx2/.github/workflows/scripts/linux/pcsx2-qt.desktop build/bin/PCSX2.desktop
}

package()
{
    DESTDIR="${pkgdir}" cmake --install build
    install -Dm644 pcsx2/pcsx2/Resources/AppIcon64.png "$pkgdir/usr/share/icons/hicolor/64x64/apps/PCSX2.png"
}

# vim: ts=2 sw=2 et:

sha256sums=(
    'SKIP'
    'SKIP'
    'SKIP'
    'SKIP'
    'SKIP'
    'SKIP'
    'SKIP'
    'SKIP'
    'SKIP'
    'SKIP'
    'SKIP'
    'SKIP'
    'b69b3369e62bee6b6063b49621144343bb9ba81fd51f38e5e9bee4efbc731230'
)