diff options
author | xantares | 2015-06-08 22:36:33 +0200 |
---|---|---|
committer | xantares | 2015-06-08 22:36:33 +0200 |
commit | 0432fa2ef9f49beb3add8e454bc4273b98f3c2c8 (patch) | |
tree | 3489933030ac68585fc76a70528dafe10709fc6c | |
download | aur-0432fa2ef9f49beb3add8e454bc4273b98f3c2c8.tar.gz |
Initial import
-rw-r--r-- | .SRCINFO | 17 | ||||
-rw-r--r-- | PKGBUILD | 31 | ||||
-rw-r--r-- | mingw-cmake.sh | 20 | ||||
-rw-r--r-- | toolchain-mingw.cmake | 31 |
4 files changed, 99 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..6f0f37d01b29 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,17 @@ +pkgbase = mingw-w64-cmake + pkgdesc = CMake wrapper for MinGW (mingw-w64) + pkgver = 1 + pkgrel = 9 + url = http://fedoraproject.org/wiki/MinGW + arch = any + license = GPL + depends = cmake + depends = mingw-w64-gcc + depends = mingw-w64-pkg-config + source = mingw-cmake.sh + source = toolchain-mingw.cmake + md5sums = SKIP + md5sums = SKIP + +pkgname = mingw-w64-cmake + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..0fef5171350f --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,31 @@ + +pkgname=mingw-w64-cmake +pkgver=1 +pkgrel=9 +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') +_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 + done +} + +package() { + install -d "${pkgdir}"/usr/bin + install -d "${pkgdir}"/usr/share/mingw + for _arch in ${_architectures}; do + install -m 644 toolchain-${_arch}.cmake "${pkgdir}"/usr/share/mingw/ + install -m 755 ${_arch}-cmake "${pkgdir}"/usr/bin/ + done +} + + diff --git a/mingw-cmake.sh b/mingw-cmake.sh new file mode 100644 index 000000000000..eea7866fc25a --- /dev/null +++ b/mingw-cmake.sh @@ -0,0 +1,20 @@ +#!/bin/sh +mingw_prefix=/usr/@TRIPLE@ + +export PKG_CONFIG_LIBDIR="${mingw_prefix}/lib/pkgconfig" + +mingw_c_flags="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4" +export CFLAGS="$mingw_c_flags" +export CXXFLAGS="$mingw_c_flags" + +PATH=${mingw_prefix}/bin:$PATH cmake \ + -DCMAKE_INSTALL_PREFIX:PATH=${mingw_prefix} \ + -DCMAKE_INSTALL_LIBDIR:PATH=${mingw_prefix}/lib \ + -DINCLUDE_INSTALL_DIR:PATH=${mingw_prefix}/include \ + -DLIB_INSTALL_DIR:PATH=${mingw_prefix}/lib \ + -DSYSCONF_INSTALL_DIR:PATH=${mingw_prefix}/etc \ + -DSHARE_INSTALL_DIR:PATH=${mingw_prefix}/share \ + -DBUILD_SHARED_LIBS:BOOL=ON \ + -DCMAKE_TOOLCHAIN_FILE=/usr/share/mingw/toolchain-@TRIPLE@.cmake \ + "$@" + diff --git a/toolchain-mingw.cmake b/toolchain-mingw.cmake new file mode 100644 index 000000000000..c75df0471605 --- /dev/null +++ b/toolchain-mingw.cmake @@ -0,0 +1,31 @@ +set (CMAKE_SYSTEM_NAME Windows) + +# specify the cross compiler +set (CMAKE_C_COMPILER @TRIPLE@-gcc) +set (CMAKE_CXX_COMPILER @TRIPLE@-g++) + +# where is the target environment +set (CMAKE_FIND_ROOT_PATH /usr/@TRIPLE@) + +# search for programs in the build host directories +set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +# for libraries and headers in the target directories +set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) + +# Make sure Qt can be detected by CMake +set (QT_BINARY_DIR /usr/@TRIPLE@/bin /usr/bin) +set (QT_INCLUDE_DIRS_NO_SYSTEM ON) + +# set the resource compiler (RHBZ #652435) +set (CMAKE_RC_COMPILER @TRIPLE@-windres) +set (CMAKE_MC_COMPILER @TRIPLE@-windmc) + +# override boost thread component suffix as mingw-w64-boost is compiled with threadapi=win32 +set (Boost_THREADAPI win32) + +# These are needed for compiling lapack (RHBZ #753906) +set (CMAKE_Fortran_COMPILER @TRIPLE@-gfortran) +set (CMAKE_AR:FILEPATH @TRIPLE@-ar) +set (CMAKE_RANLIB:FILEPATH @TRIPLE@-ranlib) + |