dxmt: init at 0.80 (#519111)

This commit is contained in:
Randy Eckenrode
2026-06-14 03:37:26 +00:00
committed by GitHub
2 changed files with 165 additions and 0 deletions
+132
View File
@@ -0,0 +1,132 @@
{
lib,
stdenv,
pkgsCross,
fetchFromGitHub,
buildPackages,
cmake,
git,
python3,
meson,
ninja,
tinyxxd,
sqlite,
libz,
ncurses,
libxml2,
wine64,
darwin,
symlinkJoin,
}:
let
dxmt-llvm = stdenv.mkDerivation rec {
pname = "dxmt-llvm";
version = "15.0.7";
src = fetchFromGitHub {
owner = "llvm";
repo = "llvm-project";
tag = version;
hash = "sha256-wjuZQyXQ/jsmvy6y1aksCcEDXGBjuhpgngF3XQJ/T4s=";
};
nativeBuildInputs = [
cmake
git
ninja
python3
];
cmakeFlags = [
"-DLLVM_ENABLE_ZSTD=OFF"
"-DLLVM_BUILD_TOOLS=Off"
"-S ../llvm"
];
};
inherit (darwin) xcode;
dxmt = pkgsCross.mingwW64.stdenv.mkDerivation (finalAttrs: {
pname = "dxmt";
version = "0.80";
src = fetchFromGitHub {
owner = "3shain";
repo = "dxmt";
rev = "v${finalAttrs.version}";
hash = "sha256-HNSKqEYu8se8DyzwRbqfmHRRyBXyW6D5ddPaEdnkuL4=";
fetchSubmodules = true;
};
patches = [
./winecrt0.patch
];
postPatch = ''
substituteInPlace src/airconv/darwin/meson.build --replace-fail -lcurses -lncurses
sed -e "/find_program('xcrun')/d" \
-e "s,metalir_generator = generator(xcrun,metalir_generator = generator(find_program('${xcode}/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/metal')," \
-e "s,metallib_generator = generator(xcrun,metallib_generator = generator(find_program('${xcode}/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/metallib')," \
-e "s/'-sdk', 'macosx', 'metal\(lib\)\{0,1\}', //" \
-i meson.build
'';
nativeBuildInputs = [
meson
ninja
tinyxxd
buildPackages.stdenv.cc
];
buildInputs = [
sqlite
libz
ncurses
libxml2
];
mesonFlags = [
(lib.mesonOption "native_llvm_path" "${dxmt-llvm}")
(lib.mesonOption "wine_install_path" "${wine64}")
];
preBuild = ''
export HOME=$TMPDIR
'';
__structuredAttrs = true;
strictDeps = true;
meta = {
description = "Metal-based translation layer for Direct3D 10/11";
homepage = "https://github.com/3shain/dxmt";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.feyorsh ];
platforms = lib.platforms.windows;
hydraPlatforms = [ ];
};
});
in
symlinkJoin {
name = "dxmt-${dxmt.version}";
paths = [ dxmt ];
passthru = {
inherit dxmt;
};
__structuredAttrs = true;
strictDeps = true;
meta = {
inherit (dxmt.meta)
description
homepage
maintainers
license
;
platforms = [ "x86_64-darwin" ];
hydraPlatforms = [ ];
};
}
+33
View File
@@ -0,0 +1,33 @@
diff --git c/src/winemetal/meson.build i/src/winemetal/meson.build
index 858d4b3..d937e29 100644
--- c/src/winemetal/meson.build
+++ i/src/winemetal/meson.build
@@ -26,8 +26,19 @@ elif wine_install_path != ''
if not wine_install_path.startswith('/')
wine_install_path = join_paths(meson.project_source_root(), wine_install_path)
endif
- lib_winecrt0 = cc.find_library('winecrt0', dirs : [ join_paths(wine_install_path,'lib/wine', windows_builtin_install_dir) ])
- lib_ntdll = cc.find_library('ntdll', dirs : [ join_paths(wine_install_path, 'lib/wine', windows_builtin_install_dir)], static: true)
+ winecrt0_unix_archive = custom_target(
+ 'winecrt0_fixup',
+ output : 'libwinecrt0_fixed.a',
+ command : [
+ 'sh', '-c',
+ 'ar p "$1" unix_lib.o > unix_lib.o && ar crs "$2" unix_lib.o',
+ 'sh',
+ join_paths(wine_install_path, 'lib/wine', windows_builtin_install_dir, 'libwinecrt0.a'),
+ '@OUTPUT@',
+ ],
+ )
+ lib_winecrt0 = declare_dependency(sources : winecrt0_unix_archive)
+ lib_ntdll = cc.find_library('ntdll', dirs : [ join_paths(wine_install_path, 'lib/wine', windows_builtin_install_dir)])
lib_dbghelp = cc.find_library('dbghelp', dirs : [ join_paths(wine_install_path, 'lib/wine', windows_builtin_install_dir) ])
winebuild = join_paths(wine_install_path, 'bin/winebuild')
else
@@ -59,4 +70,4 @@ custom_target('postprocess_lib',
if cpu_family == 'x86_64' or cpu_family == 'aarch64'
subdir('unix')
-endif
\ No newline at end of file
+endif