mingw-filesystem/macros.mingw64

184 lines
7.6 KiB
Plaintext
Raw Normal View History

Added support for both win32 and win64 targets - Fixed rpmlint issues - Fixed permissions of the scripts (775 -> 755) - Fixed description of the various subpackages - Make the various macros compliant with the new packaging guidelines: https://fedorahosted.org/fpc/ticket/71 - Suppress arch-independent-package-contains-binary-or-object rpmlint errors for static libraries - Improved the mingw_configure, mingw_make, mingw_make_install, mingw_cmake and mingw_cmake_kde4 RPM macros so packagers don't need to use quotes anymore when using arguments. Thanks to Kalev Lember for the initial proof of concept - Dropped the -mms-bitfields argument from the default CFLAGS as it is enabled by default as of gcc 4.7 - Replaced the CMake defines QT_HEADERS_DIR and QT_LIBRARY_DIR with QT_BINARY_DIR which is a more proper method to make CMake aware of the location of Qt. Thx to Dominik Schmidt for the hint - Make sure CMake can detect the qmake-qt4 binary in /usr/$target/bin - Make sure CMake can also detect the (native) Qt tools qdbuscpp2xml and qdbusxml2cpp - Added new RPM macros mingw_cmake_kde4, mingw32_cmake_kde4 and mingw64_cmake_kde4 - Added three new environment variables which can be set to influence the behaviour of the cmake macros: MINGW_CMAKE_ARGS, MINGW32_CMAKE_ARGS and MINGW64_CMAKE_ARGS - Dropped the mingw32-qmake-qt4 and mingw64-qmake-qt4 wrapper scripts as they're now provided by the mingw{32,64}-qt-qmake packages - Added a new RPM macro: %%{?mingw_package_header} Packagers can use this macro instead of the original boilerplate code which is needed for all mingw packages - Made argument passing using the backwards compatibility macro %%{_mingw32_cmake} work - Fixed an issue in the mingw_cmake macro where it could point to a non-existant CMakeLists.txt file - Fixed a bug in the find-requires script which causes all packages to depend on both the mingw32 and the mingw64 toolchains - Split out the RPM macros which require both the mingw{32,64}-filesystem packages in a new file and put it in the mingw-filesystem-base package - Generate seperate debuginfo packages for mingw32 and mingw64 - Set the minimum version of R: mingw{32,64}-filesystem to 70 - Use the correct FSF-address in some scripts - Thanks to all the contributors: Erik van Pienbroek, Kalev Lember, Levente Farkas, Marc-Andre Lureau.
2012-02-25 23:17:24 +00:00
# RPM macros for Fedora MinGW.
%mingw64_pkg_name %(echo %{name} | sed 's/^mingw-/mingw64-/')
%mingw64_target x86_64-w64-mingw32
# Paths.
%mingw64_sysroot %{_prefix}/%{mingw64_target}/sys-root
%mingw64_prefix %{mingw64_sysroot}/mingw
%mingw64_exec_prefix %{mingw64_prefix}
%mingw64_bindir %{mingw64_exec_prefix}/bin
%mingw64_sbindir %{mingw64_exec_prefix}/sbin
%mingw64_libexecdir %{mingw64_exec_prefix}/libexec
%mingw64_libdir %{mingw64_exec_prefix}/lib
%mingw64_datadir %{mingw64_prefix}/share
%mingw64_docdir %{mingw64_prefix}/share/doc
%mingw64_infodir %{mingw64_prefix}/share/info
%mingw64_mandir %{mingw64_prefix}/share/man
%mingw64_sysconfdir %{mingw64_prefix}/etc
%mingw64_sharedstatedir %{mingw64_prefix}/com
%mingw64_localstatedir %{mingw64_prefix}/var
%mingw64_includedir %{mingw64_prefix}/include
# Build macros.
%mingw64_host %{mingw64_target}
%mingw64_cflags %{mingw64_cppflags} -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4
%mingw64_cppflags %{nil}
%mingw64_ldflags %{nil}
%mingw64_cc %{mingw64_target}-gcc
%mingw64_cxx %{mingw64_target}-g++
%mingw64_cpp %{mingw64_target}-gcc -E
%mingw64_addr2line %{mingw64_target}-addr2line
%mingw64_ar %{mingw64_target}-ar
%mingw64_as %{mingw64_target}-as
%mingw64_c++ %{mingw64_target}-c++
%mingw64_c++filt %{mingw64_target}-c++filt
%mingw64_dlltool %{mingw64_target}-dlltool
%mingw64_dllwrap %{mingw64_target}-dllwrap
%mingw64_gcov %{mingw64_target}-gcov
%mingw64_gprof %{mingw64_target}-gprof
%mingw64_ld %{mingw64_target}-ld
%mingw64_nm %{mingw64_target}-nm
%mingw64_objcopy %{mingw64_target}-objcopy
%mingw64_objdump %{mingw64_target}-objdump
%mingw64_ranlib %{mingw64_target}-ranlib
%mingw64_readelf %{mingw64_target}-readelf
%mingw64_size %{mingw64_target}-size
%mingw64_strings %{mingw64_target}-strings
%mingw64_strip %{mingw64_target}-strip
%mingw64_windmc %{mingw64_target}-windmc
%mingw64_windres %{mingw64_target}-windres
%mingw64_env unset $(/usr/bin/env | egrep '^(\w+)=(.*)$' | egrep -vw 'PWD|USER|LANG' | /usr/bin/cut -d= -f1); \
if test -z "$PATH_ORIG" ; then \
PATH_ORIG="$PATH"; export PATH_ORIG; \
fi; \
PATH="%{mingw64_bindir}:$PATH_ORIG"; export PATH; \
HOST_CC=gcc; export HOST_CC; \
PKG_CONFIG_LIBDIR="%{mingw64_libdir}/pkgconfig:%{mingw64_datadir}/pkgconfig"; export PKG_CONFIG_LIBDIR; \
unset PKG_CONFIG_PATH; \
_PREFIX="%{_bindir}/%{mingw64_target}-"; \
for i in `ls -1 ${_PREFIX}* | grep -v 'gcc-'`; do \
x=`echo $i|sed "s,${_PREFIX},,"|tr "a-z+-." "A-ZX__"`; \
declare -x $x="$i" ; export $x; \
done; \
unset _PREFIX; \
CC="${MINGW64_CC:-%mingw64_cc}"; export CC; \
CFLAGS="${MINGW64_CFLAGS:-%mingw64_cflags}"; export CFLAGS; \
CPPFLAGS="${MINGW64_CPPFLAGS:-%mingw64_cppflags}"; export CPPFLAGS \
if [ -x "%{_bindir}/%{mingw64_cxx}" ]; then \
CXX="${MINGW64_CXX:-%mingw64_cxx}"; export CXX; \
CXXFLAGS="${MINGW64_CXXFLAGS:-%mingw64_cflags}"; export CXXFLAGS; \
else \
CXX=; export CXX; \
ac_cv_prog_CXX=no; export ac_cv_prog_CXX; \
CXXFLAGS=; export CXXFLAGS; \
fi; \
LDFLAGS="${MINGW64_LDFLAGS:-%mingw64_ldflags}"; export LDFLAGS; \
for i in `ls %{mingw64_bindir}/*|grep -- "-config\$"` ; do \
x=`basename $i|tr "a-z+-." "A-ZX_"`; \
Added support for both win32 and win64 targets - Fixed rpmlint issues - Fixed permissions of the scripts (775 -> 755) - Fixed description of the various subpackages - Make the various macros compliant with the new packaging guidelines: https://fedorahosted.org/fpc/ticket/71 - Suppress arch-independent-package-contains-binary-or-object rpmlint errors for static libraries - Improved the mingw_configure, mingw_make, mingw_make_install, mingw_cmake and mingw_cmake_kde4 RPM macros so packagers don't need to use quotes anymore when using arguments. Thanks to Kalev Lember for the initial proof of concept - Dropped the -mms-bitfields argument from the default CFLAGS as it is enabled by default as of gcc 4.7 - Replaced the CMake defines QT_HEADERS_DIR and QT_LIBRARY_DIR with QT_BINARY_DIR which is a more proper method to make CMake aware of the location of Qt. Thx to Dominik Schmidt for the hint - Make sure CMake can detect the qmake-qt4 binary in /usr/$target/bin - Make sure CMake can also detect the (native) Qt tools qdbuscpp2xml and qdbusxml2cpp - Added new RPM macros mingw_cmake_kde4, mingw32_cmake_kde4 and mingw64_cmake_kde4 - Added three new environment variables which can be set to influence the behaviour of the cmake macros: MINGW_CMAKE_ARGS, MINGW32_CMAKE_ARGS and MINGW64_CMAKE_ARGS - Dropped the mingw32-qmake-qt4 and mingw64-qmake-qt4 wrapper scripts as they're now provided by the mingw{32,64}-qt-qmake packages - Added a new RPM macro: %%{?mingw_package_header} Packagers can use this macro instead of the original boilerplate code which is needed for all mingw packages - Made argument passing using the backwards compatibility macro %%{_mingw32_cmake} work - Fixed an issue in the mingw_cmake macro where it could point to a non-existant CMakeLists.txt file - Fixed a bug in the find-requires script which causes all packages to depend on both the mingw32 and the mingw64 toolchains - Split out the RPM macros which require both the mingw{32,64}-filesystem packages in a new file and put it in the mingw-filesystem-base package - Generate seperate debuginfo packages for mingw32 and mingw64 - Set the minimum version of R: mingw{32,64}-filesystem to 70 - Use the correct FSF-address in some scripts - Thanks to all the contributors: Erik van Pienbroek, Kalev Lember, Levente Farkas, Marc-Andre Lureau.
2012-02-25 23:17:24 +00:00
declare -x $x="$i" ; export $x; \
done; \
unset x i
%mingw64_pkg_config %{mingw64_target}-pkg-config
%mingw64_configure %{mingw64_env} ; \
__mingw64_topdir=.; if ! test -x configure; then __mingw64_topdir=..; fi; \\\
$__mingw64_topdir/configure \\\
--host=%{mingw64_host} \\\
--build=%_build \\\
--target=%{mingw64_target} \\\
--prefix=%{mingw64_prefix} \\\
--exec-prefix=%{mingw64_exec_prefix} \\\
--bindir=%{mingw64_bindir} \\\
--sbindir=%{mingw64_sbindir} \\\
--sysconfdir=%{mingw64_sysconfdir} \\\
--datadir=%{mingw64_datadir} \\\
--includedir=%{mingw64_includedir} \\\
--libdir=%{mingw64_libdir} \\\
--libexecdir=%{mingw64_libexecdir} \\\
--localstatedir=%{mingw64_localstatedir} \\\
--sharedstatedir=%{mingw64_sharedstatedir} \\\
--mandir=%{mingw64_mandir} \\\
--infodir=%{mingw64_infodir} \\\
${MINGW_CONFIGURE_ARGS} \\\
${MINGW64_CONFIGURE_ARGS}
%mingw64_make %{mingw64_env} ; \
make \\\
prefix=%{mingw64_prefix} \\\
exec_prefix=%{mingw64_exec_prefix} \\\
bindir=%{mingw64_bindir} \\\
sbindir=%{mingw64_sbindir} \\\
sysconfdir=%{mingw64_sysconfdir} \\\
datadir=%{mingw64_datadir} \\\
includedir=%{mingw64_includedir} \\\
libdir=%{mingw64_libdir} \\\
libexecdir=%{mingw64_libexecdir} \\\
localstatedir=%{mingw64_localstatedir} \\\
sharedstatedir=%{mingw64_sharedstatedir} \\\
mandir=%{mingw64_mandir} \\\
infodir=%{mingw64_infodir}
%mingw64_cmake %{mingw64_env} ; \
if test -f CMakeLists.txt; then __mingw64_topdir=.; \\\
elif test -f ../CMakeLists.txt; then __mingw64_topdir=..; \\\
else __mingw64_topdir=""; fi; \\\
PATH=%{_prefix}/%{mingw64_target}/bin:$PATH %__cmake \\\
-DCMAKE_VERBOSE_MAKEFILE=ON \\\
-DCMAKE_INSTALL_PREFIX:PATH=%{mingw64_prefix} \\\
-DCMAKE_INSTALL_LIBDIR:PATH=%{mingw64_libdir} \\\
-DINCLUDE_INSTALL_DIR:PATH=%{mingw64_includedir} \\\
-DLIB_INSTALL_DIR:PATH=%{mingw64_libdir} \\\
-DSYSCONF_INSTALL_DIR:PATH=%{mingw64_sysconfdir} \\\
-DSHARE_INSTALL_PREFIX:PATH=%{mingw64_datadir} \\\
%{?_cmake_skip_rpath} \\\
-DBUILD_SHARED_LIBS:BOOL=ON \\\
-DCMAKE_TOOLCHAIN_FILE=/usr/share/mingw/Toolchain-mingw64.cmake \\\
${MINGW_CMAKE_ARGS} \\\
${MINGW64_CMAKE_ARGS} \\\
$@ $__mingw64_topdir
%mingw64_cmake_kde4 %{mingw64_env} ; \
if test -f CMakeLists.txt; then __mingw64_topdir=.; \\\
elif test -f ../CMakeLists.txt; then __mingw64_topdir=..; \\\
else __mingw64_topdir=""; fi; \\\
%__cmake \\\
-DCMAKE_VERBOSE_MAKEFILE=ON \\\
-DCMAKE_INSTALL_PREFIX:PATH=%{mingw64_prefix} \\\
-DCMAKE_INSTALL_LIBDIR:PATH=%{mingw64_libdir} \\\
-DINCLUDE_INSTALL_DIR:PATH=%{mingw64_includedir}/kde4 \\\
-DLIB_INSTALL_DIR:PATH=%{mingw64_libdir} \\\
-DSYSCONF_INSTALL_DIR:PATH=%{mingw64_sysconfdir} \\\
-DSHARE_INSTALL_PREFIX:PATH=%{mingw64_datadir} \\\
%{?_cmake_skip_rpath} \\\
-DBUILD_SHARED_LIBS:BOOL=ON \\\
-DCMAKE_TOOLCHAIN_FILE=/usr/share/mingw/Toolchain-mingw64.cmake \\\
${MINGW_CMAKE_ARGS} \\\
${MINGW64_CMAKE_ARGS} \\\
$@ $__mingw64_topdir
%mingw64_qmake_qt4 %{mingw64_env} ; \
/usr/bin/mingw64-qmake-qt4
%mingw64_description This is the cross-compiled version of this library / tool.\
You should only install this package if you want to cross-compile programs for \
Win64 (64 bit Windows).
%mingw64_debug_package \
%package -n %{mingw64_pkg_name}-debuginfo \
Summary: Debug information for package %{mingw64_pkg_name} \
Group: Development/Debug \
BuildArch: noarch \
%description -n %{mingw64_pkg_name}-debuginfo \
This package provides debug information for package %{mingw64_pkg_name}. \
Debug information is useful when developing applications that use this \
package or when debugging this package. \
%files -n %{mingw64_pkg_name}-debuginfo -f mingw64-debugfiles.list \
%defattr(-,root,root,-) \
%{nil}