File mingw64-fxc2.spec of Package mingw64-fxc2
#
# spec file for package mingw64-fxc2
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: mingw64-fxc2
Version: 2435931
Release: 0
Summary: Microsofts Shader Compiler fxc
License: MIT
Group: Development/Libraries/C and C++
Url: https://github.com/chubinou/fxc2
#Source0: https://github.com/chubinou/fxc2/archive/master.tar.gz
Source0: chubinou-fxc2-2435931.tar.gz
Patch0: chubinou-fxc2-2435931-fixes.patch
Patch1: 0001-Revert-Fix-narrowing-conversion-from-int-to-BYTE.patch
#!BuildIgnore: post-build-checks
BuildRequires: mingw64-cross-gcc-c++
%_mingw64_package_header_debug
BuildArch: noarch
%description
A wine-runnable version of Microsofts Shader Compiler fxc
%package -n mingw64-cross-fxc
Summary: Wrapper to run MS Shader Compiler
Group: Development/Libraries
Requires: mingw64-fxc2
Requires: wine
Provides: mingw64-cross-fxc2
%description -n mingw64-cross-fxc
This package contains a wrapper for fxc2, the Microsoft shader compiler,
to run it on a linux host.
%_mingw64_debug_package
%prep
%autosetup -p1 -n chubinou-fxc2-2435931
%build
%_mingw64_env; $CXX -static fxc2.cpp -o fxc2.exe
%install
mkdir -p %{buildroot}%{_mingw64_prefix}/bin
cp fxc2.exe %{buildroot}%{_mingw64_prefix}/bin
cp fxc2.exe %{buildroot}%{_mingw64_prefix}/bin/fxc.exe
# 32bit
cp dll/d3dcompiler_47.dll %{buildroot}%{_mingw64_prefix}/bin/d3dcompiler_47.dll
# create and install wrapper
mkdir -p %{buildroot}%{_prefix}/%{_mingw64_target}/bin
cat << EOF > %{buildroot}%{_prefix}/%{_mingw64_target}/bin/fxc
#!/bin/sh
WINEDLLPATH=/usr/lib/wine WINEDEBUG=warn-all,fixme-all wine %{_mingw64_bindir}/fxc.exe \$*
exit $?
EOF
chmod a+x %{buildroot}%{_prefix}/%{_mingw64_target}/bin/fxc
ln -s fxc %{buildroot}%{_prefix}/%{_mingw64_target}/bin/fxc.exe
mkdir -p %{buildroot}%{_bindir}
ln -s %{_prefix}/%{_mingw64_target}/bin/fxc %{buildroot}%{_bindir}/%{_mingw64_target}-fxc
%files
%defattr(-,root,root)
%{_mingw64_bindir}/fxc*.exe
%{_mingw64_bindir}/d3dcompiler_47.dll
%files -n mingw64-cross-fxc
%{_prefix}/%{_mingw64_target}/bin
%{_bindir}/%{_mingw64_target}-fxc
%changelog