├── .gitignore ├── PKGBUILD ├── README.md └── customization.cfg /.gitignore: -------------------------------------------------------------------------------- 1 | .* 2 | !.gitignore 3 | *~ 4 | *.orig 5 | *.log 6 | *.run 7 | *.tgz 8 | *.xz 9 | *.pkg 10 | *.bak 11 | *.tar.gz 12 | *.tar.zst 13 | *.old 14 | *.db 15 | *.files 16 | *.myvkd3dpatch 17 | src/ 18 | pkg/ 19 | vkd3d/ 20 | vkd3d-staging/ 21 | HansKristian-Work-vkd3d/ 22 | HansKristian-Work-vkd3d-proton/ 23 | -------------------------------------------------------------------------------- /PKGBUILD: -------------------------------------------------------------------------------- 1 | # Created by: Tk-Glitch 2 | 3 | plain ' .---.` `.---.' 4 | plain ' `/syhhhyso- -osyhhhys/`' 5 | plain ' .syNMdhNNhss/``.---.``/sshNNhdMNys.' 6 | plain ' +sdMh.`+MNsssssssssssssssNM+`.hMds+' 7 | plain ' :syNNdhNNhssssssssssssssshNNhdNNys:' 8 | plain ' /ssyhhhysssssssssssssssssyhhhyss/' 9 | plain ' .ossssssssssssssssssssssssssssso.' 10 | plain ' :sssssssssssssssssssssssssssssssss:' 11 | plain ' /sssssssssssssssssssssssssssssssssss/' 12 | plain ' :sssssssssssssoosssssssoosssssssssssss:' 13 | plain ' osssssssssssssoosssssssoossssssssssssso' 14 | plain ' osssssssssssyyyyhhhhhhhyyyyssssssssssso' 15 | plain ' /yyyyyyhhdmmmmNNNNNNNNNNNmmmmdhhyyyyyy/' 16 | plain ' smmmNNNNNNNNNNNNNNNNNNNNNNNNNNNNNmmms' 17 | plain ' /dNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNd/' 18 | plain ' `:sdNNNNNNNNNNNNNNNNNNNNNNNNNds:`' 19 | plain ' `-+shdNNNNNNNNNNNNNNNdhs+-`' 20 | plain ' `.-:///////:-.`' 21 | _where="$PWD" # track basedir as different Arch based distros are moving srcdir around 22 | source "$_where"/customization.cfg 23 | 24 | # Load external configuration file if present. Available variable values will overwrite customization.cfg ones. 25 | if [ -e "$_EXT_CONFIG_PATH" ]; then 26 | source "$_EXT_CONFIG_PATH" && msg2 "External configuration file $_EXT_CONFIG_PATH will be used to override customization.cfg values.\n" 27 | fi 28 | 29 | if [ -n "$_vkd3d_source" ] && [ "$_vkd3d_source" != 'git://source.winehq.org/git/vkd3d' ]; then 30 | _vkd3dsrcdir=$( sed 's|/|-|g' <<< $(sed 's|.*://.[^/]*/||g' <<< $_vkd3d_source)) 31 | else 32 | _vkd3dsrcdir='vkd3d' 33 | _vkd3d_source='git://source.winehq.org/git/vkd3d' 34 | fi 35 | 36 | if [ "$_vkd3d_source" = "https://github.com/HansKristian-Work/vkd3d-proton" ]; then 37 | _pkgnameprefix="vkd3d-proton-tkg-git" 38 | else 39 | _pkgnameprefix="vkd3d-tkg-git" 40 | fi 41 | 42 | pkgname=("$_pkgnameprefix" "lib32-$_pkgnameprefix") 43 | pkgver=1.2.r48.g5fb9bcd 44 | pkgrel=1 45 | 46 | # custom vkd3d commit to pass to git 47 | if [ -n "$_vkd3d_commit" ]; then 48 | _vkd3d_commit="#commit=${_vkd3d_commit}" 49 | fi 50 | 51 | pkgdesc='Wine d3d12 to vulkan translation lib, git version' 52 | url='https://source.winehq.org/git/vkd3d.git' 53 | arch=('x86_64') 54 | license=('LGPL') 55 | makedepends=('git' 'autoconf' 'ncurses' 'bison' 'perl' 'fontforge' 'flex' 56 | 'gcc>=4.5.0-2' 'spirv-headers' 57 | 'vulkan-headers' 'vulkan-icd-loader' 58 | 'lib32-vulkan-icd-loader' 'wine' 59 | 'glslang' 60 | ) 61 | 62 | if [ "$_vkd3d_source" = "https://github.com/HansKristian-Work/vkd3d-proton" ] && [ "$_fork_disable_meson" = "false" ]; then 63 | makedepends+=('meson' 'ninja' 'xcb-util-keysyms' 'lib32-xcb-util-keysyms') 64 | fi 65 | 66 | optdepends=('schedtool') 67 | 68 | source=("$_vkd3dsrcdir"::"git+${_vkd3d_source}${_vkd3d_commit}" 69 | ) 70 | 71 | makedepends=(${makedepends[@]} ${depends[@]}) 72 | 73 | function exit_cleanup { 74 | # Remove temporarily copied patches 75 | rm -rf "$_where"/src/* 76 | 77 | # Community patches removal 78 | for _p in ${_community_patches[@]}; do 79 | rm -f "$_where"/$_p 80 | done 81 | 82 | remove_deps 83 | 84 | msg2 "Cleanup done" 85 | } 86 | 87 | user_patcher() { 88 | # To patch the user because all your base are belong to us 89 | local _patches=("$_where"/*."${_userpatch_ext}revert") 90 | if [ ${#_patches[@]} -ge 2 ] || [ -e "${_patches}" ]; then 91 | if [ "$_user_patches_no_confirm" != "true" ]; then 92 | msg2 "Found ${#_patches[@]} 'to revert' userpatches for ${_userpatch_target}:" 93 | printf '%s\n' "${_patches[@]}" 94 | read -rp "Do you want to install it/them? - Be careful with that ;)"$'\n> N/y : ' _CONDITION; 95 | fi 96 | if [ "$_CONDITION" == "y" ] || [ "$_user_patches_no_confirm" == "true" ]; then 97 | for _f in "${_patches[@]}"; do 98 | if [ -e "${_f}" ]; then 99 | msg2 "######################################################" 100 | msg2 "" 101 | msg2 "Reverting your own ${_userpatch_target} patch ${_f}" 102 | msg2 "" 103 | msg2 "######################################################" 104 | patch -Np1 -R < "${_f}" 105 | echo "Reverted your own patch ${_f}" >> "$_where"/last_build_config.log 106 | fi 107 | done 108 | fi 109 | fi 110 | 111 | _patches=("$_where"/*."${_userpatch_ext}patch") 112 | if [ ${#_patches[@]} -ge 2 ] || [ -e "${_patches}" ]; then 113 | if [ "$_user_patches_no_confirm" != "true" ]; then 114 | msg2 "Found ${#_patches[@]} userpatches for ${_userpatch_target}:" 115 | printf '%s\n' "${_patches[@]}" 116 | read -rp "Do you want to install it/them? - Be careful with that ;)"$'\n> N/y : ' _CONDITION; 117 | fi 118 | if [ "$_CONDITION" == "y" ] || [ "$_user_patches_no_confirm" == "true" ]; then 119 | for _f in "${_patches[@]}"; do 120 | if [ -e "${_f}" ]; then 121 | msg2 "######################################################" 122 | msg2 "" 123 | msg2 "Applying your own ${_userpatch_target} patch ${_f}" 124 | msg2 "" 125 | msg2 "######################################################" 126 | patch -Np1 < "${_f}" 127 | echo "Applied your own patch ${_f}" >> "$_where"/last_build_config.log 128 | fi 129 | done 130 | fi 131 | fi 132 | } 133 | 134 | pkgver() { 135 | # retrieve current version 136 | cd "${srcdir}/${_vkd3dsrcdir}" 137 | 138 | # version string 139 | echo $(git describe --long 2>/dev/null || printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)") | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/vkd3d.//g' 140 | } 141 | 142 | prepare() { 143 | # Cleanups 144 | rm -fv $_where/last_build_config.log 145 | cd "${srcdir}/${_vkd3dsrcdir}" 146 | 147 | # Community patches 148 | if [ -n "$_community_patches" ]; then 149 | if [ ! -d "$_where/../community-patches" ]; then 150 | cd "$_where/.." && git clone https://github.com/Frogging-Family/community-patches.git && cd "${srcdir}/${_vkd3dsrcdir}" 151 | fi 152 | _community_patches=($_community_patches) 153 | for _p in ${_community_patches[@]}; do 154 | ln -s "$_where"/../community-patches/vkd3d-git/$_p "$_where"/ 155 | done 156 | fi 157 | 158 | # vkd3d user patches 159 | _userpatch_target="vkd3d" 160 | _userpatch_ext="myvkd3d" 161 | user_patcher 162 | 163 | # Community patches removal 164 | for _p in ${_community_patches[@]}; do 165 | rm -f "$_where"/$_p 166 | done 167 | 168 | # create new build dirs 169 | mkdir -p "${srcdir}"/"${_pkgnameprefix}" 170 | mkdir -p "${srcdir}"/lib32-"${_pkgnameprefix}" 171 | cd "$_where" 172 | } 173 | 174 | build() { 175 | # Use custom compiler paths if defined 176 | if [ -n "${CUSTOM_MINGW_PATH}" ]; then 177 | PATH=${CUSTOM_MINGW_PATH}/bin:${CUSTOM_MINGW_PATH}/lib:${CUSTOM_MINGW_PATH}/include:${PATH} 178 | fi 179 | if [ -n "${CUSTOM_GCC_PATH}" ]; then 180 | PATH=${CUSTOM_GCC_PATH}/bin:${CUSTOM_GCC_PATH}/lib:${CUSTOM_GCC_PATH}/include:${PATH} 181 | fi 182 | 183 | if [ "$_vkd3d_source" != "https://github.com/HansKristian-Work/vkd3d-proton" ] || [ "$_fork_disable_meson" = "true" ]; then 184 | cd "${srcdir}/${_vkd3dsrcdir}" 185 | ./autogen.sh 186 | 187 | export CC='gcc -m32 -mstackrealign' 188 | export CXX='g++ -m32 -mstackrealign' 189 | export PKG_CONFIG_PATH='/usr/lib32/pkgconfig' 190 | 191 | cd "${srcdir}"/lib32-"${_pkgnameprefix}" 192 | ../${_vkd3dsrcdir}/configure \ 193 | --prefix=/usr \ 194 | --libdir=/usr/lib32 195 | 196 | # make using all available threads 197 | schedtool -B -n 1 -e ionice -n 1 make -j$(nproc) -C "${srcdir}"/lib32-"${_pkgnameprefix}" || make -j$(nproc) -C "${srcdir}"/lib32-"${_pkgnameprefix}" 198 | 199 | export CC='gcc -m64' 200 | export CXX='g++ -m64' 201 | export PKG_CONFIG_PATH='/usr/lib/pkgconfig' 202 | 203 | cd "${srcdir}"/"${_pkgnameprefix}" 204 | ../${_vkd3dsrcdir}/configure \ 205 | --prefix=/usr \ 206 | --libdir=/usr/lib 207 | 208 | # make using all available threads 209 | schedtool -B -n 1 -e ionice -n 1 make -j$(nproc) -C "${srcdir}"/"${_pkgnameprefix}" || make -j$(nproc) -C "${srcdir}"/"${_pkgnameprefix}" 210 | else 211 | cd "${srcdir}/${_vkd3dsrcdir}" 212 | git submodule update --init --recursive 213 | 214 | cd "${srcdir}" 215 | 216 | # 64 217 | export CC="gcc -m64" 218 | export CXX="g++ -m64" 219 | 220 | arch-meson "${srcdir}/${_vkd3dsrcdir}" "${srcdir}"/"${_pkgnameprefix}" \ 221 | --libdir lib \ 222 | --buildtype release 223 | 224 | ninja $NINJAFLAGS -C "${_pkgnameprefix}" 225 | 226 | # 32 227 | export CC='gcc -m32 -mstackrealign' 228 | export CXX='g++ -m32 -mstackrealign' 229 | export PKG_CONFIG_PATH='/usr/lib32/pkgconfig' 230 | 231 | arch-meson "${srcdir}/${_vkd3dsrcdir}" "${srcdir}"/lib32-"${_pkgnameprefix}" \ 232 | --libdir lib32 \ 233 | --buildtype release 234 | 235 | ninja $NINJAFLAGS -C lib32-"${_pkgnameprefix}" 236 | fi 237 | } 238 | 239 | _package_vkd3d() { 240 | provides=("vkd3d=$pkgver") 241 | conflicts=("vkd3d") 242 | 243 | msg2 'Packaging vkd3d 64...' 244 | 245 | if [ "$_vkd3d_source" != "https://github.com/HansKristian-Work/vkd3d-proton" ] || [ "$_fork_disable_meson" = "true" ]; then 246 | cd "${srcdir}"/"${pkgname}" 247 | make -C "${srcdir}"/"${pkgname}" DESTDIR="${pkgdir}" install 248 | else 249 | DESTDIR="$pkgdir" ninja $NINJAFLAGS -C "${_pkgnameprefix}" install 250 | fi 251 | } 252 | 253 | _package_lib32-vkd3d() { 254 | provides=("lib32-vkd3d=$pkgver") 255 | conflicts=("lib32-vkd3d") 256 | 257 | msg2 'Packaging vkd3d 32...' 258 | 259 | if [ "$_vkd3d_source" != "https://github.com/HansKristian-Work/vkd3d-proton" ] || [ "$_fork_disable_meson" = "true" ]; then 260 | cd "${srcdir}"/"${pkgname}" 261 | make -C "${srcdir}"/"${pkgname}" DESTDIR="${pkgdir}" install 262 | else 263 | DESTDIR="$pkgdir" ninja $NINJAFLAGS -C lib32-"${_pkgnameprefix}" install 264 | fi 265 | 266 | rm -rf ${pkgdir}/usr/include 267 | rm -f ${pkgdir}/usr/bin/vkd3d-compiler 268 | } 269 | 270 | source /dev/stdin <