diff options
author | Christian Segundo | 2024-09-01 20:34:09 +0200 |
---|---|---|
committer | Christian Segundo | 2024-09-01 20:34:09 +0200 |
commit | fae17644b9ef2382994bf3ce7d288e08211c42ef (patch) | |
tree | 66305cadf6371bb777f8c2e7fa62db4930621e4c /content/posts/2018-08-01-dxvk-gentoo.es.md | |
parent | 82c70566e88d9260d68f69ab59e6761197d828ec (diff) | |
download | check-caps-lock-fae17644b9ef2382994bf3ce7d288e08211c42ef.tar.gz |
migrate more stuff
Diffstat (limited to 'content/posts/2018-08-01-dxvk-gentoo.es.md')
-rw-r--r-- | content/posts/2018-08-01-dxvk-gentoo.es.md | 131 |
1 files changed, 131 insertions, 0 deletions
diff --git a/content/posts/2018-08-01-dxvk-gentoo.es.md b/content/posts/2018-08-01-dxvk-gentoo.es.md new file mode 100644 index 0000000..0a899a3 --- /dev/null +++ b/content/posts/2018-08-01-dxvk-gentoo.es.md @@ -0,0 +1,131 @@ +--- +layout: post +title: Compilando las DLLs de DXVK en Gentoo +tags: +- wine +- dxvk +- gentoo + +TocOpen: true +ShowToc: true +--- + +La forma mas sencilla de compilar DXVK en Gentoo es con una chroot de Debian, pero... Donde está la diversión en eso? La primera vez que lo intenté me topé con varios problemas y no encontré documentado el proceso en ningún sitio. Esta entrada es un intento de resolver ese problema. + +<hr> + +# Dependencias + +Según la documentación oficial necesitamos: + + - wine 3.10 or newer + - Meson build system (at least version 0.43) + - MinGW64 compiler and headers (requires threading support) + - glslang front end and validator + +Todas menos MinGW las puedes instalar directamente: + +``` +emerge virtual/wine dev-util/meson dev-util/glslang +``` + +## MinGW64 + +Se necesita MinGW con threads de POSIX. Por suerte existe `crossdev`, el +problema es que por defecto compila GCC con threads de Win32. + +Se crea primero la toolchain, la tupla para x86 es `i686-w64-mingw32` y para +x64 `x86_64-w64-mingw32`. + +``` +crossdev -t i686-w64-mingw32 +crossdev -t x86_64-w64-mingw32 +``` + +Para arreglar GCC se necesitan dos cosas, indicar que lo queremos con POSIX +threads y las librerías que hacen falta para compilarlo. + +1. Habilita los POSIX threads: + + ``` + mkdir /etc/portage/{env,package.env} + echo 'EXTRA_ECONF="--enable-threads=posix"' > /etc/portage/env/mingw32_posix_threads + echo -e 'cross-i686-w64-mingw32/gcc mingw32_posix_threads\ncross-x86_64-w64-mingw32/gcc mingw32_posix_threads' > /etc/portage/package.env/mingw32_posix_threads + ``` + +1. Añade la `USE` `libraries`: + + ``` + cross-i686-w64-mingw32/mingw64-runtime libraries + cross-x86_64-w64-mingw32/mingw64-runtime libraries + ``` + +Por último recompila `mingw64-runtime` y `gcc` por separado, en ese orden: + +``` +emerge -1 cross-i686-w64-mingw32/mingw64-runtime cross-x86_64-w64-mingw32/mingw64-runtime +emerge -1 cross-i686-w64-mingw32/gcc cross-x86_64-w64-mingw32/gcc +``` + +Dependiendo de la versión del runtime, puede que se instalen algunas librerias +en el lugar equivocado y esto impide compilar GCC, si es el caso basta con +hacer enlaces (Bug #653246): + +``` +ln -s /usr/x86_64-w64-mingw32/usr/lib64/{libmangle.a,libpthread.a,libpthread.dll.a,libwinpthread.a,libwinpthread.dll.a,libwinpthread.la} /usr/x86_64-w64-mingw32/usr/lib/ +``` + +El resultado final debe ser este: + +``` +i686-w64-mingw32-gcc -v +x86_64-w64-mingw32-gcc -v +... +Thread model: posix +... +``` + +# Compilar las DLLs + +``` +# su user +$ cd +$ git clone https://github.com/doitsujin/dxvk.git +$ cd dxvk + +### 32-bit build. For 64-bit builds, replace +### build-win32.txt with build-win64.txt +### build.w32 with build.w64 + +$ meson --cross-file build-win32.txt --prefix /some/install/prefix build.w32 +$ cd build.w32/ +$ meson configure -Dbuildtype=release +$ ninja +$ ninja install +``` +``` +$ ls /some/install/prefix/bin +d3d11.dll dxgi.dll setup_dxvk.sh +``` + +Estas son las toolchains que usé y que producen binarios que funcionan: + +``` +cross-i686-w64-mingw32/binutils-2.30-r3 +cross-i686-w64-mingw32/gcc-7.3.0-r3 +cross-i686-w64-mingw32/mingw64-runtime-5.0.4 + +cross-x86_64-w64-mingw32/binutils-2.30-r3 +cross-x86_64-w64-mingw32/gcc-7.3.0-r3 + +### Requiere symlinkear de ...lib64/ -> ...lib/ +cross-x86_64-w64-mingw32/mingw64-runtime-5.0.4 +``` + +---- + +**Fuentes**: + +- [DXVK Github](https://github.com/doitsujin/dxvk) +- [Bug #631460](https://bugs.gentoo.org/631460) +- [Bug #653246](https://bugs.gentoo.org/653246) |