summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichel Zou2016-03-19 08:35:19 +0100
committerMichel Zou2016-03-19 08:35:19 +0100
commita6d41eca14b67fc68be53891a417a1819cbfa430 (patch)
tree741043aa63b0a645e3e6f75e3e6863e3a44d0222
parent759b27e5d290cb9186c835089f2d84452ee77688 (diff)
downloadaur-a6d41eca14b67fc68be53891a417a1819cbfa430.tar.gz
add wine wrapper
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD11
-rw-r--r--mingw-wine.sh19
-rw-r--r--toolchain-mingw.cmake2
4 files changed, 31 insertions, 7 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 18786a0d83a3..71e4ee3810f0 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,9 +1,9 @@
# Generated by mksrcinfo v8
-# Wed Mar 16 17:36:32 UTC 2016
+# Sat Mar 19 07:35:19 UTC 2016
pkgbase = mingw-w64-cmake
pkgdesc = CMake wrapper for MinGW (mingw-w64)
pkgver = 1
- pkgrel = 11
+ pkgrel = 12
url = http://fedoraproject.org/wiki/MinGW
arch = any
license = GPL
@@ -12,6 +12,8 @@ pkgbase = mingw-w64-cmake
depends = mingw-w64-pkg-config
source = mingw-cmake.sh
source = toolchain-mingw.cmake
+ source = mingw-wine.sh
+ md5sums = SKIP
md5sums = SKIP
md5sums = SKIP
diff --git a/PKGBUILD b/PKGBUILD
index 169956d3e2d1..776e5f6bf93a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,21 +1,23 @@
pkgname=mingw-w64-cmake
pkgver=1
-pkgrel=11
-arch=(any)
+pkgrel=12
+arch=('any')
pkgdesc="CMake wrapper for MinGW (mingw-w64)"
depends=('cmake' 'mingw-w64-gcc' 'mingw-w64-pkg-config')
license=("GPL")
url="http://fedoraproject.org/wiki/MinGW"
source=("mingw-cmake.sh"
- "toolchain-mingw.cmake")
-md5sums=('SKIP' 'SKIP')
+ "toolchain-mingw.cmake"
+ "mingw-wine.sh")
+md5sums=('SKIP' 'SKIP' 'SKIP')
_architectures="i686-w64-mingw32 x86_64-w64-mingw32"
build() {
for _arch in ${_architectures}; do
sed "s|@TRIPLE@|${_arch}|g" toolchain-mingw.cmake > toolchain-${_arch}.cmake
sed "s|@TRIPLE@|${_arch}|g" mingw-cmake.sh > ${_arch}-cmake
+ sed "s|@TRIPLE@|${_arch}|g" mingw-wine.sh > ${_arch}-wine
done
}
@@ -25,6 +27,7 @@ package() {
for _arch in ${_architectures}; do
install -m 644 toolchain-${_arch}.cmake "${pkgdir}"/usr/share/mingw/
install -m 755 ${_arch}-cmake "${pkgdir}"/usr/bin/
+ install -m 755 ${_arch}-wine "${pkgdir}"/usr/bin/
done
}
diff --git a/mingw-wine.sh b/mingw-wine.sh
new file mode 100644
index 000000000000..49f4bf73b47e
--- /dev/null
+++ b/mingw-wine.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+set -e
+
+mingw_prefix=/usr/@TRIPLE@
+
+# wine requires the dlls to lie next to the exe
+if test -f "$1"
+then
+ path=`dirname $1`
+ if ! test -f "${path}/libstdc++-6.dll"
+ then
+ cp ${mingw_prefix}/bin/*.dll ${path}
+ fi
+fi
+
+# run it in a temporary WINEPREFIX in /tmp/arch to not mess with default ~/.wine
+# also ~/.wine might be a user-defined 32 bits prefix, which will fail to run x86_64 exes
+WINEPREFIX=~/.wine-@TRIPLE@ wine "$@"
diff --git a/toolchain-mingw.cmake b/toolchain-mingw.cmake
index 1a6b4a51dc5d..d0448852e0f9 100644
--- a/toolchain-mingw.cmake
+++ b/toolchain-mingw.cmake
@@ -30,4 +30,4 @@ set (CMAKE_Fortran_COMPILER @TRIPLE@-gfortran)
set (CMAKE_AR:FILEPATH @TRIPLE@-ar)
set (CMAKE_RANLIB:FILEPATH @TRIPLE@-ranlib)
-set (CMAKE_CROSSCOMPILING_EMULATOR /usr/bin/wine)
+set (CMAKE_CROSSCOMPILING_EMULATOR /usr/bin/@TRIPLE@-wine)