diff --git a/COPYING b/COPYING index e77696a..d159169 100644 --- a/COPYING +++ b/COPYING @@ -1,12 +1,12 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - Preamble + Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public @@ -15,7 +15,7 @@ software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to +the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not @@ -55,8 +55,8 @@ patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. - - GNU GENERAL PUBLIC LICENSE + + GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains @@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions: License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) - + These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in @@ -168,7 +168,7 @@ access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. - + 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is @@ -225,7 +225,7 @@ impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. - + 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License @@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. - NO WARRANTY + NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN @@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it @@ -291,7 +291,7 @@ convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. - Copyright (C) 19yy + Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -303,16 +303,16 @@ the "copyright" line and a pointer to where the full notice is found. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: - Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. @@ -335,5 +335,5 @@ necessary. Here is a sample; alter the names: This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General +library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. diff --git a/Toolchain-mingw32.cmake b/Toolchain-mingw32.cmake index 25f70d0..da8846b 100644 --- a/Toolchain-mingw32.cmake +++ b/Toolchain-mingw32.cmake @@ -1,11 +1,11 @@ SET(CMAKE_SYSTEM_NAME Windows) # specify the cross compiler -SET(CMAKE_C_COMPILER /usr/bin/i686-pc-mingw32-gcc) -SET(CMAKE_CXX_COMPILER /usr/bin/i686-pc-mingw32-g++) +SET(CMAKE_C_COMPILER /usr/bin/i686-w64-mingw32-gcc) +SET(CMAKE_CXX_COMPILER /usr/bin/i686-w64-mingw32-g++) # where is the target environment -SET(CMAKE_FIND_ROOT_PATH /usr/i686-pc-mingw32/sys-root/mingw) +SET(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32/sys-root/mingw) # search for programs in the build host directories SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) @@ -13,19 +13,17 @@ SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -# FindQt4.cmake queries qmake to get information, -# which doesn't work when crosscompiling -SET(QT_HEADERS_DIR ${CMAKE_FIND_ROOT_PATH}/include) -SET(QT_LIBRARY_DIR ${CMAKE_FIND_ROOT_PATH}/lib) +# Make sure Qt can be detected by CMake +SET(QT_BINARY_DIR /usr/i686-w64-mingw32/bin /usr/bin) # set the resource compiler (RHBZ #652435) -SET(CMAKE_RC_COMPILER /usr/bin/i686-pc-mingw32-windres) +SET(CMAKE_RC_COMPILER /usr/bin/i686-w64-mingw32-windres) # override boost library suffix which defaults to -mgw SET(Boost_COMPILER -gcc47) # These are needed for compiling lapack (RHBZ #753906) -SET(CMAKE_Fortran_COMPILER /usr/bin/i686-pc-mingw32-gfortran) -SET(CMAKE_AR:FILEPATH /usr/bin/i686-pc-mingw32-ar) -SET(CMAKE_RANLIB:FILEPATH /usr/bin/i686-pc-mingw32-ranlib) +SET(CMAKE_Fortran_COMPILER /usr/bin/i686-w64-mingw32-gfortran) +SET(CMAKE_AR:FILEPATH /usr/bin/i686-w64-mingw32-ar) +SET(CMAKE_RANLIB:FILEPATH /usr/bin/i686-w64-mingw32-ranlib) diff --git a/Toolchain-mingw64.cmake b/Toolchain-mingw64.cmake new file mode 100644 index 0000000..5f70ced --- /dev/null +++ b/Toolchain-mingw64.cmake @@ -0,0 +1,29 @@ +SET(CMAKE_SYSTEM_NAME Windows) + +# specify the cross compiler +SET(CMAKE_C_COMPILER /usr/bin/x86_64-w64-mingw32-gcc) +SET(CMAKE_CXX_COMPILER /usr/bin/x86_64-w64-mingw32-g++) + +# where is the target environment +SET(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32/sys-root/mingw) + +# 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/x86_64-w64-mingw32/bin /usr/bin) + +# set the resource compiler (RHBZ #652435) +SET(CMAKE_RC_COMPILER /usr/bin/x86_64-w64-mingw32-windres) + +# override boost library suffix which defaults to -mgw +SET(Boost_COMPILER -gcc47) + +# These are needed for compiling lapack (RHBZ #753906) +SET(CMAKE_Fortran_COMPILER /usr/bin/x86_64-w64-mingw32-gfortran) +SET(CMAKE_AR:FILEPATH /usr/bin/x86_64-w64-mingw32-ar) +SET(CMAKE_RANLIB:FILEPATH /usr/bin/x86_64-w64-mingw32-ranlib) + diff --git a/macros.mingw b/macros.mingw new file mode 100644 index 0000000..dce6978 --- /dev/null +++ b/macros.mingw @@ -0,0 +1,95 @@ +# RPM macros for the Fedora MinGW Cross Compiler collection + +%mingw_build_targets mingw32 mingw64 + +%mingw_strip mingw-strip +%mingw_objdump mingw-objdump +%mingw_objcopy mingw-objcopy + +%mingw_findprovides %{_rpmconfigdir}/mingw-find-provides.sh %{mingw_build_targets} +%mingw_findrequires %{_rpmconfigdir}/mingw-find-requires.sh %{mingw_build_targets} +%mingw_finddebuginfo %{_rpmconfigdir}/mingw-find-debuginfo.sh + +%mingw_find_lang %{_rpmconfigdir}/mingw-find-lang.sh %{buildroot} + +%mingw_debug_install_post %{mingw_finddebuginfo} %{_builddir}/%{?buildsubdir} %{mingw_build_targets} + +%mingw_debug_package \ +%{?mingw_build_win32: %{?mingw32_debug_package}} \ +%{?mingw_build_win64: %{?mingw64_debug_package}} \ +%{nil} + +%mingw_package_header \ +%global __strip %{mingw_strip} \ +%global __objdump %{mingw_objdump} \ +%global __debug_install_post %%{mingw_debug_install_post} \ +%{nil} + +%mingw_configure \ +run_mingw_configure() \ +{ \ +%{?mingw_build_win32: \ +mkdir build_win32$MINGW_BUILDDIR_SUFFIX \ +pushd build_win32$MINGW_BUILDDIR_SUFFIX \ + %{?mingw32_configure} $@ \ +popd } \ +%{?mingw_build_win64: \ +mkdir build_win64$MINGW_BUILDDIR_SUFFIX \ +pushd build_win64$MINGW_BUILDDIR_SUFFIX \ + %{?mingw64_configure} $@ \ +popd } \ +} \ +run_mingw_configure + +%mingw_make \ +run_mingw_make() \ +{ \ +%{?mingw_build_win32: \ +make -C build_win32$MINGW_BUILDDIR_SUFFIX $@} \ +%{?mingw_build_win64: \ +make -C build_win64$MINGW_BUILDDIR_SUFFIX $@} \ +} \ +run_mingw_make + +%mingw_make_install \ +run_mingw_make_install() \ +{ \ +%{?mingw_build_win32: \ +make -C build_win32$MINGW_BUILDDIR_SUFFIX install $@} \ +%{?mingw_build_win64: \ +make -C build_win64$MINGW_BUILDDIR_SUFFIX install $@} \ +} \ +run_mingw_make_install + +%mingw_cmake \ +run_mingw_cmake() \ +{ \ +%{?mingw_build_win32: \ +mkdir build_win32$suffix \ +pushd build_win32$suffix \ + %{?mingw32_cmake $@} \ +popd } \ +%{?mingw_build_win64: \ +mkdir build_win64$suffix \ +pushd build_win64$suffix \ + %{?mingw64_cmake $@} \ +popd } \ +} \ +run_mingw_cmake + +%mingw_cmake_kde4 \ +run_mingw_cmake_kde4() \ +{ \ +%{?mingw_build_win32: \ +mkdir build_win32$suffix \ +pushd build_win32$suffix \ + %{?mingw32_cmake_kde4 $@} \ +popd } \ +%{?mingw_build_win64: \ +mkdir build_win64$suffix \ +pushd build_win64$suffix \ + %{?mingw64_cmake_kde4 $@} \ +popd } \ +} \ +run_mingw_cmake_kde4 + diff --git a/macros.mingw32 b/macros.mingw32 index d80d38e..1af0cb8 100644 --- a/macros.mingw32 +++ b/macros.mingw32 @@ -1,66 +1,249 @@ # RPM macros for Fedora MinGW. -%_mingw32_pkg_name %(echo %{name} | sed 's/^mingw-/mingw32-/') - -%_mingw32_target i686-pc-mingw32 +%mingw32_pkg_name %(echo %{name} | sed 's/^mingw-/mingw32-/') +%mingw32_target i686-w64-mingw32 # Paths. -%_mingw32_sysroot %{_prefix}/%{_mingw32_target}/sys-root -%_mingw32_prefix %{_mingw32_sysroot}/mingw -%_mingw32_exec_prefix %{_mingw32_prefix} -%_mingw32_bindir %{_mingw32_exec_prefix}/bin -%_mingw32_sbindir %{_mingw32_exec_prefix}/sbin -%_mingw32_libexecdir %{_mingw32_exec_prefix}/libexec -%_mingw32_libdir %{_mingw32_exec_prefix}/lib -%_mingw32_datadir %{_mingw32_prefix}/share -%_mingw32_docdir %{_mingw32_prefix}/share/doc -%_mingw32_infodir %{_mingw32_prefix}/share/info -%_mingw32_mandir %{_mingw32_prefix}/share/man -%_mingw32_sysconfdir %{_mingw32_prefix}/etc -%_mingw32_sharedstatedir %{_mingw32_prefix}/com -%_mingw32_localstatedir %{_mingw32_prefix}/var -%_mingw32_includedir %{_mingw32_prefix}/include +%mingw32_sysroot %{_prefix}/%{mingw32_target}/sys-root +%mingw32_prefix %{mingw32_sysroot}/mingw +%mingw32_exec_prefix %{mingw32_prefix} +%mingw32_bindir %{mingw32_exec_prefix}/bin +%mingw32_sbindir %{mingw32_exec_prefix}/sbin +%mingw32_libexecdir %{mingw32_exec_prefix}/libexec +%mingw32_libdir %{mingw32_exec_prefix}/lib +%mingw32_datadir %{mingw32_prefix}/share +%mingw32_docdir %{mingw32_prefix}/share/doc +%mingw32_infodir %{mingw32_prefix}/share/info +%mingw32_mandir %{mingw32_prefix}/share/man +%mingw32_sysconfdir %{mingw32_prefix}/etc +%mingw32_sharedstatedir %{mingw32_prefix}/com +%mingw32_localstatedir %{mingw32_prefix}/var +%mingw32_includedir %{mingw32_prefix}/include # Build macros. -%_mingw32_host %{_mingw32_target} +%mingw32_host %{mingw32_target} -%_mingw32_cflags -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -mms-bitfields +%mingw32_cflags %{mingw32_cppflags} -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 +%mingw32_cppflags %{nil} +%mingw32_ldflags %{nil} -%_mingw32_cc %{_mingw32_target}-gcc -%_mingw32_cxx %{_mingw32_target}-g++ -%_mingw32_cpp %{_mingw32_target}-gcc -E -%_mingw32_addr2line %{_mingw32_target}-addr2line -%_mingw32_ar %{_mingw32_target}-ar -%_mingw32_as %{_mingw32_target}-as -%_mingw32_c++ %{_mingw32_target}-c++ -%_mingw32_c++filt %{_mingw32_target}-c++filt -%_mingw32_dlltool %{_mingw32_target}-dlltool -%_mingw32_dllwrap %{_mingw32_target}-dllwrap -%_mingw32_gcov %{_mingw32_target}-gcov -%_mingw32_gprof %{_mingw32_target}-gprof -%_mingw32_ld %{_mingw32_target}-ld -%_mingw32_nm %{_mingw32_target}-nm -%_mingw32_objcopy %{_mingw32_target}-objcopy -%_mingw32_objdump %{_mingw32_target}-objdump -%_mingw32_ranlib %{_mingw32_target}-ranlib -%_mingw32_readelf %{_mingw32_target}-readelf -%_mingw32_size %{_mingw32_target}-size -%_mingw32_strings %{_mingw32_target}-strings -%_mingw32_strip %{_mingw32_target}-strip -%_mingw32_windmc %{_mingw32_target}-windmc -%_mingw32_windres %{_mingw32_target}-windres +%mingw32_cc %{mingw32_target}-gcc +%mingw32_cxx %{mingw32_target}-g++ +%mingw32_cpp %{mingw32_target}-gcc -E +%mingw32_addr2line %{mingw32_target}-addr2line +%mingw32_ar %{mingw32_target}-ar +%mingw32_as %{mingw32_target}-as +%mingw32_c++ %{mingw32_target}-c++ +%mingw32_c++filt %{mingw32_target}-c++filt +%mingw32_dlltool %{mingw32_target}-dlltool +%mingw32_dllwrap %{mingw32_target}-dllwrap +%mingw32_gcov %{mingw32_target}-gcov +%mingw32_gprof %{mingw32_target}-gprof +%mingw32_ld %{mingw32_target}-ld +%mingw32_nm %{mingw32_target}-nm +%mingw32_objcopy %{mingw32_target}-objcopy +%mingw32_objdump %{mingw32_target}-objdump +%mingw32_ranlib %{mingw32_target}-ranlib +%mingw32_readelf %{mingw32_target}-readelf +%mingw32_size %{mingw32_target}-size +%mingw32_strings %{mingw32_target}-strings +%mingw32_strip %{mingw32_target}-strip +%mingw32_windmc %{mingw32_target}-windmc +%mingw32_windres %{mingw32_target}-windres -%_mingw32_cache mingw32-config.cache +%mingw32_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="%{mingw32_bindir}:$PATH_ORIG"; export PATH; \ + HOST_CC=gcc; export HOST_CC; \ + PKG_CONFIG_LIBDIR="%{mingw32_libdir}/pkgconfig:%{_mingw32_datadir}/pkgconfig"; export PKG_CONFIG_LIBDIR; \ + unset PKG_CONFIG_PATH; \ + _PREFIX="%{_bindir}/%{mingw32_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="${MINGW32_CC:-%mingw32_cc}"; export CC; \ + CFLAGS="${MINGW32_CFLAGS:-%mingw32_cflags}"; export CFLAGS; \ + CPPFLAGS="${MINGW32_CPPFLAGS:-%mingw32_cppflags}"; export CPPFLAGS; \ + if [ -x "%{_bindir}/%{mingw32_cxx}" ]; then \ + CXX="${MINGW32_CXX:-%mingw32_cxx}"; export CXX; \ + CXXFLAGS="${MINGW32_CXXFLAGS:-%mingw32_cflags}"; export CXXFLAGS; \ + else \ + CXX=; export CXX; \ + ac_cv_prog_CXX=no; export ac_cv_prog_CXX; \ + CXXFLAGS=; export CXXFLAGS; \ + fi; \ + LDFLAGS="${MINGW32_LDFLAGS:-%mingw32_ldflags}"; export LDFLAGS; \ + for i in `ls %{mingw32_bindir}/*|grep -- "-config\$"` ; do \ + x=`basename $i|tr "a-z+-" "A-ZX_"`; \ + declare -x $x="$i" ; export $x; \ + done; \ + unset x i -%_mingw32_findprovides /usr/lib/rpm/mingw32-find-provides.sh -%_mingw32_findrequires /usr/lib/rpm/mingw32-find-requires.sh -%_mingw32_finddebuginfo /usr/lib/rpm/mingw32-find-debuginfo.sh +%mingw32_pkg_config %{mingw32_target}-pkg-config -%_mingw32_debug_install_post \ - /usr/lib/rpm/mingw32-find-debuginfo.sh %{_builddir}/%{?buildsubdir}\ +%mingw32_configure %{mingw32_env} ; \ + __mingw32_topdir=.; if ! test -x configure; then __mingw32_topdir=..; fi; \\\ + $__mingw32_topdir/configure \\\ + --host=%{mingw32_host} \\\ + --build=%_build \\\ + --target=%{mingw32_target} \\\ + --prefix=%{mingw32_prefix} \\\ + --exec-prefix=%{mingw32_exec_prefix} \\\ + --bindir=%{mingw32_bindir} \\\ + --sbindir=%{mingw32_sbindir} \\\ + --sysconfdir=%{mingw32_sysconfdir} \\\ + --datadir=%{mingw32_datadir} \\\ + --includedir=%{mingw32_includedir} \\\ + --libdir=%{mingw32_libdir} \\\ + --libexecdir=%{mingw32_libexecdir} \\\ + --localstatedir=%{mingw32_localstatedir} \\\ + --sharedstatedir=%{mingw32_sharedstatedir} \\\ + --mandir=%{mingw32_mandir} \\\ + --infodir=%{mingw32_infodir} \\\ + ${MINGW_CONFIGURE_ARGS} \\\ + ${MINGW32_CONFIGURE_ARGS} + +%mingw32_make %{mingw32_env} ; \ + make \\\ + prefix=%{mingw32_prefix} \\\ + exec_prefix=%{mingw32_exec_prefix} \\\ + bindir=%{mingw32_bindir} \\\ + sbindir=%{mingw32_sbindir} \\\ + sysconfdir=%{mingw32_sysconfdir} \\\ + datadir=%{mingw32_datadir} \\\ + includedir=%{mingw32_includedir} \\\ + libdir=%{mingw32_libdir} \\\ + libexecdir=%{mingw32_libexecdir} \\\ + localstatedir=%{mingw32_localstatedir} \\\ + sharedstatedir=%{mingw32_sharedstatedir} \\\ + mandir=%{mingw32_mandir} \\\ + infodir=%{mingw32_infodir} + +%mingw32_cmake %{mingw32_env} ; \ + if test -f CMakeLists.txt; then __mingw32_topdir=.; \\\ + elif test -f ../CMakeLists.txt; then __mingw32_topdir=..; \\\ + else __mingw32_topdir=""; fi; \\\ + PATH=%{_prefix}/%{mingw32_target}/bin:$PATH %__cmake \\\ + -DCMAKE_VERBOSE_MAKEFILE=ON \\\ + -DCMAKE_INSTALL_PREFIX:PATH=%{mingw32_prefix} \\\ + -DCMAKE_INSTALL_LIBDIR:PATH=%{mingw32_libdir} \\\ + -DINCLUDE_INSTALL_DIR:PATH=%{mingw32_includedir} \\\ + -DLIB_INSTALL_DIR:PATH=%{mingw32_libdir} \\\ + -DSYSCONF_INSTALL_DIR:PATH=%{mingw32_sysconfdir} \\\ + -DSHARE_INSTALL_PREFIX:PATH=%{mingw32_datadir} \\\ + %{?_cmake_skip_rpath} \\\ + -DBUILD_SHARED_LIBS:BOOL=ON \\\ + -DCMAKE_TOOLCHAIN_FILE=/usr/share/mingw/Toolchain-mingw32.cmake \\\ + ${MINGW_CMAKE_ARGS} \\\ + ${MINGW32_CMAKE_ARGS} \\\ + $@ $__mingw32_topdir + +%mingw32_cmake_kde4 %{mingw32_env} ; \ + if test -f CMakeLists.txt; then __mingw32_topdir=.; \\\ + elif test -f ../CMakeLists.txt; then __mingw32_topdir=..; \\\ + else __mingw32_topdir=""; fi; \\\ + %__cmake \\\ + -DCMAKE_VERBOSE_MAKEFILE=ON \\\ + -DCMAKE_INSTALL_PREFIX:PATH=%{mingw32_prefix} \\\ + -DCMAKE_INSTALL_LIBDIR:PATH=%{mingw32_libdir} \\\ + -DINCLUDE_INSTALL_DIR:PATH=%{mingw32_includedir}/kde4 \\\ + -DLIB_INSTALL_DIR:PATH=%{mingw32_libdir} \\\ + -DSYSCONF_INSTALL_DIR:PATH=%{mingw32_sysconfdir} \\\ + -DSHARE_INSTALL_PREFIX:PATH=%{mingw32_datadir} \\\ + %{?_cmake_skip_rpath} \\\ + -DBUILD_SHARED_LIBS:BOOL=ON \\\ + -DCMAKE_TOOLCHAIN_FILE=/usr/share/mingw/Toolchain-mingw32.cmake \\\ + ${MINGW_CMAKE_ARGS} \\\ + ${MINGW32_CMAKE_ARGS} \\\ + $@ $__mingw32_topdir + +%mingw32_qmake_qt4 %{mingw32_env} ; \ + /usr/bin/mingw32-qmake-qt4 + +%mingw32_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 \ +Win32 (32 bit Windows). + +%mingw32_debug_package \ +%package -n %{mingw32_pkg_name}-debuginfo \ +Summary: Debug information for package %{mingw32_pkg_name} \ +Group: Development/Debug \ +BuildArch: noarch \ +%description -n %{mingw32_pkg_name}-debuginfo \ +This package provides debug information for package %{mingw32_pkg_name}. \ +Debug information is useful when developing applications that use this \ +package or when debugging this package. \ +%files -n %{mingw32_pkg_name}-debuginfo -f mingw32-debugfiles.list \ +%defattr(-,root,root,-) \ +%{nil} + + +# Maintain backwards compatibility with the original MinGW packaging guidelines +# These can be dropped as soon as all packages are ported to the new packaging guidelines +%_mingw32_pkg_name %{mingw32_pkg_name} +%_mingw32_target %{mingw32_target} +%_mingw32_sysroot %{mingw32_sysroot} +%_mingw32_prefix %{mingw32_prefix} +%_mingw32_exec_prefix %{mingw32_exec_prefix} +%_mingw32_bindir %{mingw32_bindir} +%_mingw32_sbindir %{mingw32_sbindir} +%_mingw32_libexecdir %{mingw32_libexecdir} +%_mingw32_libdir %{mingw32_libdir} +%_mingw32_datadir %{mingw32_datadir} +%_mingw32_docdir %{mingw32_docdir} +%_mingw32_infodir %{mingw32_infodir} +%_mingw32_mandir %{mingw32_mandir} +%_mingw32_sysconfdir %{mingw32_sysconfdir} +%_mingw32_sharedstatedir %{mingw32_sharedstatedir} +%_mingw32_localstatedir %{mingw32_localstatedir} +%_mingw32_includedir %{mingw32_includedir} +%_mingw32_host %{mingw32_host} +%_mingw32_cflags %{mingw32_cflags} +%_mingw32_cppflags %{mingw32_cppflags} +%_mingw32_ldflags %{mingw32_ldflags} +%_mingw32_findprovides %{mingw_findprovides} +%_mingw32_findrequires %{mingw_findrequires} +%_mingw32_cc %{mingw32_cc} +%_mingw32_cxx %{mingw32_cxx} +%_mingw32_cpp %{mingw32_cpp} +%_mingw32_addr2line %{mingw32_addr2line} +%_mingw32_ar %{mingw32_ar} +%_mingw32_as %{mingw32_as} +%_mingw32_c++ %{mingw32_c++} +%_mingw32_c++filt %{mingw32_c++filt} +%_mingw32_dlltool %{mingw32_dlltool} +%_mingw32_dllwrap %{mingw32_dllwrap} +%_mingw32_gcov %{mingw32_gcov} +%_mingw32_gprof %{mingw32_gprof} +%_mingw32_ld %{mingw32_ld} +%_mingw32_nm %{mingw32_nm} +%_mingw32_objcopy %{mingw32_objcopy} +%_mingw32_objdump %{mingw32_objdump} +%_mingw32_ranlib %{mingw32_ranlib} +%_mingw32_readelf %{mingw32_readelf} +%_mingw32_size %{mingw32_size} +%_mingw32_strings %{mingw32_strings} +%_mingw32_strip %{mingw32_strip} +%_mingw32_windmc %{mingw32_windmc} +%_mingw32_windres %{mingw32_windres} +%_mingw32_env %{mingw32_env} +%_mingw32_pkg_config %{mingw32_pkg_config} +%_mingw32_configure %{mingw32_configure} +%_mingw32_make %{mingw32_make} +%_mingw32_cmake %{mingw32_cmake} +%_mingw32_description %{mingw32_description} + +# The old implementation of the _mingw32_debug_package macro isn't +# forward-compatible with the new implementation using mingw_debug_package +# so keep the old implementation here for backwards compatibility +%_mingw32_debug_install_post \ + %{mingw_finddebuginfo} %{_builddir}/%{?buildsubdir} old\ %{nil} -# Template for debug sub-package. %_mingw32_debug_package(n:) \ %define __mingw32_debug_pkg_name %{-n*}%{!-n:%{_mingw32_pkg_name}}-debuginfo \ %package -n %{__mingw32_debug_pkg_name} \ @@ -74,100 +257,21 @@ package or when debugging this package.\ %defattr(-,root,root,-)\ %{nil} -%_mingw32_env HOST_CC=gcc; export HOST_CC; \ - PKG_CONFIG_LIBDIR="%{_mingw32_libdir}/pkgconfig:%{_mingw32_datadir}/pkgconfig"; export PKG_CONFIG_LIBDIR; \ - unset PKG_CONFIG_PATH; \ - _PREFIX="%{_bindir}/%{_mingw32_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="${MINGW32_CC:-%_mingw32_cc}"; export CC; \ - CFLAGS="${MINGW32_CFLAGS:-%_mingw32_cflags}"; export CFLAGS; \ - if [ -x "%{_bindir}/%{_mingw32_cxx}" ]; then \ - CXX="${MINGW32_CXX:-%_mingw32_cxx}"; export CXX; \ - CXXFLAGS="${MINGW32_CXXFLAGS:-%_mingw32_cflags}"; export CXXFLAGS; \ - else \ - CXX=; export CXX; \ - ac_cv_prog_CXX=no; export ac_cv_prog_CXX; \ - CXXFLAGS=; export CXXFLAGS; \ - fi; \ - for i in `ls %{_mingw32_bindir}/*|grep -- "-config\$"` ; do \ - x=`basename $i|tr "a-z+-" "A-ZX_"`; \ - declare -x $x="$i" ; export $x; \ - done; \ - unset x i - -%_mingw32_configure %{_mingw32_env} ; \ - __mingw32_topdir=.; if ! test -x configure; then __mingw32_topdir=..; fi; \\\ - $__mingw32_topdir/configure --cache-file=%{_mingw32_cache} \\\ - --host=%{_mingw32_host} \\\ - --build=%_build \\\ - --target=%{_mingw32_target} \\\ - --prefix=%{_mingw32_prefix} \\\ - --exec-prefix=%{_mingw32_exec_prefix} \\\ - --bindir=%{_mingw32_bindir} \\\ - --sbindir=%{_mingw32_sbindir} \\\ - --sysconfdir=%{_mingw32_sysconfdir} \\\ - --datadir=%{_mingw32_datadir} \\\ - --includedir=%{_mingw32_includedir} \\\ - --libdir=%{_mingw32_libdir} \\\ - --libexecdir=%{_mingw32_libexecdir} \\\ - --localstatedir=%{_mingw32_localstatedir} \\\ - --sharedstatedir=%{_mingw32_sharedstatedir} \\\ - --mandir=%{_mingw32_mandir} \\\ - --infodir=%{_mingw32_infodir} - -%_mingw32_make %{_mingw32_env} ; \ +# This macro has been dropped from the new guidelines, keep +# it here around for backwards compatibility +%_mingw32_makeinstall %{mingw32_env} ; \ make \\\ - prefix=%{_mingw32_prefix} \\\ - exec_prefix=%{_mingw32_exec_prefix} \\\ - bindir=%{_mingw32_bindir} \\\ - sbindir=%{_mingw32_sbindir} \\\ - sysconfdir=%{_mingw32_sysconfdir} \\\ - datadir=%{_mingw32_datadir} \\\ - includedir=%{_mingw32_includedir} \\\ - libdir=%{_mingw32_libdir} \\\ - libexecdir=%{_mingw32_libexecdir} \\\ - localstatedir=%{_mingw32_localstatedir} \\\ - sharedstatedir=%{_mingw32_sharedstatedir} \\\ - mandir=%{_mingw32_mandir} \\\ - infodir=%{_mingw32_infodir} - -%_mingw32_makeinstall %{_mingw32_env} ; \ - make \\\ - prefix=%{?buildroot:%{buildroot}}%{_mingw32_prefix} \\\ - exec_prefix=%{?buildroot:%{buildroot}}%{_mingw32_exec_prefix} \\\ - bindir=%{?buildroot:%{buildroot}}%{_mingw32_bindir} \\\ - sbindir=%{?buildroot:%{buildroot}}%{_mingw32_sbindir} \\\ - sysconfdir=%{?buildroot:%{buildroot}}%{_mingw32_sysconfdir} \\\ - datadir=%{?buildroot:%{buildroot}}%{_mingw32_datadir} \\\ - includedir=%{?buildroot:%{buildroot}}%{_mingw32_includedir} \\\ - libdir=%{?buildroot:%{buildroot}}%{_mingw32_libdir} \\\ - libexecdir=%{?buildroot:%{buildroot}}%{_mingw32_libexecdir} \\\ - localstatedir=%{?buildroot:%{buildroot}}%{_mingw32_localstatedir} \\\ - sharedstatedir=%{?buildroot:%{buildroot}}%{_mingw32_sharedstatedir} \\\ - mandir=%{?buildroot:%{buildroot}}%{_mingw32_mandir} \\\ - infodir=%{?buildroot:%{buildroot}}%{_mingw32_infodir} \\\ + prefix=%{?buildroot:%{buildroot}}%{mingw32_prefix} \\\ + exec_prefix=%{?buildroot:%{buildroot}}%{mingw32_exec_prefix} \\\ + bindir=%{?buildroot:%{buildroot}}%{mingw32_bindir} \\\ + sbindir=%{?buildroot:%{buildroot}}%{mingw32_sbindir} \\\ + sysconfdir=%{?buildroot:%{buildroot}}%{mingw32_sysconfdir} \\\ + datadir=%{?buildroot:%{buildroot}}%{mingw32_datadir} \\\ + includedir=%{?buildroot:%{buildroot}}%{mingw32_includedir} \\\ + libdir=%{?buildroot:%{buildroot}}%{mingw32_libdir} \\\ + libexecdir=%{?buildroot:%{buildroot}}%{mingw32_libexecdir} \\\ + localstatedir=%{?buildroot:%{buildroot}}%{mingw32_localstatedir} \\\ + sharedstatedir=%{?buildroot:%{buildroot}}%{mingw32_sharedstatedir} \\\ + mandir=%{?buildroot:%{buildroot}}%{mingw32_mandir} \\\ + infodir=%{?buildroot:%{buildroot}}%{mingw32_infodir} \\\ install - -%_mingw32_cmake %{_mingw32_env} ; \ - %__cmake \\\ - -DCMAKE_VERBOSE_MAKEFILE=ON \\\ - -DCMAKE_INSTALL_PREFIX:PATH=%{_mingw32_prefix} \\\ - -DCMAKE_INSTALL_LIBDIR:PATH=%{_mingw32_libdir} \\\ - -DINCLUDE_INSTALL_DIR:PATH=%{_mingw32_includedir} \\\ - -DLIB_INSTALL_DIR:PATH=%{_mingw32_libdir} \\\ - -DSYSCONF_INSTALL_DIR:PATH=%{_mingw32_sysconfdir} \\\ - -DSHARE_INSTALL_PREFIX:PATH=%{_mingw32_datadir} \\\ - %{?_cmake_skip_rpath} \\\ - -DBUILD_SHARED_LIBS:BOOL=ON \\\ - -DCMAKE_TOOLCHAIN_FILE=/usr/share/mingw32/Toolchain-mingw32.cmake - -%_mingw32_qmake_qt4 %{_mingw32_env} ; \ - %_qt4_qmake -spec win32-g++-cross - -%_mingw32_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 \ -Win32 (32 bit Windows). diff --git a/macros.mingw64 b/macros.mingw64 new file mode 100644 index 0000000..31fbb43 --- /dev/null +++ b/macros.mingw64 @@ -0,0 +1,183 @@ +# 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_"`; \ + 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} + diff --git a/mingw-filesystem.spec b/mingw-filesystem.spec index ff4113d..9ab9976 100644 --- a/mingw-filesystem.spec +++ b/mingw-filesystem.spec @@ -1,29 +1,34 @@ -%define debug_package %{nil} +%global debug_package %{nil} Name: mingw-filesystem -Version: 69 -Release: 15%{?dist} -Summary: MinGW base filesystem and environment +Version: 95 +Release: 1%{?dist} +Summary: MinGW cross compiler base filesystem and environment Group: Development/Libraries License: GPLv2+ -URL: http://hg.et.redhat.com/misc/fedora-mingw--devel/ +URL: http://fedoraproject.org/wiki/MinGW BuildArch: noarch Source0: COPYING -Source1: macros.mingw32 -Source2: mingw32.sh -#Source3: mingw32.csh -Source4: mingw32-find-requires.sh -Source5: mingw32-find-provides.sh -Source6: mingw32-scripts.sh -Source7: mingw32-rpmlint.config -Source8: Toolchain-mingw32.cmake -Source9: mingw32-find-debuginfo.sh -Source10: mingw32.attr +Source1: macros.mingw +Source2: macros.mingw32 +Source3: macros.mingw64 +Source4: mingw32.sh +Source5: mingw64.sh +Source6: mingw-find-debuginfo.sh +Source7: mingw-find-requires.sh +Source8: mingw-find-provides.sh +Source9: mingw-scripts.sh +Source10: mingw-rpmlint.config +Source11: Toolchain-mingw32.cmake +Source12: Toolchain-mingw64.cmake +Source13: mingw-find-lang.sh +Source14: mingw32.attr +Source15: mingw64.attr # generated with: # ls -1 /usr/lib64/wine/fakedlls | grep "\.dll$" >standard-dlls -Source11: standard-dlls +Source16: standard-dlls %description @@ -35,9 +40,27 @@ This environment is maintained by the Fedora MinGW SIG at: http://fedoraproject.org/wiki/SIGs/MinGW +%package base +Summary: %{summary} + +# Obsolete the packages from the test repo +Obsoletes: cross-filesystem < 67-2 +Obsoletes: cross-filesystem-scripts < 67-2 +Obsoletes: mingw-filesystem < 75-2 +Obsoletes: mingw-filesystem-scripts < 75-2 + +%description base +This package contains the base filesystem layout, RPM macros and +environment for all Fedora MinGW packages. + +This environment is maintained by the Fedora MinGW SIG at: + + http://fedoraproject.org/wiki/SIGs/MinGW + + %package -n mingw32-filesystem -Summary: MinGW base filesystem and environment -Requires: pkgconfig +Summary: %{summary} +Requires: %{name}-base = %{version}-%{release} # Note about 'Provides: mingw32(foo.dll)' # ------------------------------------------------------------ @@ -53,7 +76,7 @@ Requires: pkgconfig # proprietary DLLs in our find-requires checking script - essentially # it comes out the same either way. # -Provides: %(sed "s/\(.*\)/mingw32(\1) /g" %{SOURCE11} | tr "\n" " ") +Provides: %(sed "s/\(.*\)/mingw32(\1) /g" %{SOURCE16} | tr "\n" " ") %description -n mingw32-filesystem This package contains the base filesystem layout, RPM macros and @@ -64,6 +87,21 @@ This environment is maintained by the Fedora MinGW SIG at: http://fedoraproject.org/wiki/SIGs/MinGW +%package -n mingw64-filesystem +Summary: %{summary} +Requires: %{name}-base = %{version}-%{release} + +Provides: %(sed "s/\(.*\)/mingw64(\1) /g" %{SOURCE16} | tr "\n" " ") + +%description -n mingw64-filesystem +This package contains the base filesystem layout, RPM macros and +environment for all Fedora MinGW packages. + +This environment is maintained by the Fedora MinGW SIG at: + + http://fedoraproject.org/wiki/SIGs/MinGW + + %prep %setup -q -c -T cp %{SOURCE0} COPYING @@ -77,96 +115,178 @@ cp %{SOURCE0} COPYING mkdir -p $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT%{_libexecdir} -install -m 755 %{SOURCE6} $RPM_BUILD_ROOT%{_libexecdir}/mingw32-scripts +install -m 755 %{SOURCE9} $RPM_BUILD_ROOT%{_libexecdir}/mingw-scripts mkdir -p $RPM_BUILD_ROOT%{_bindir} pushd $RPM_BUILD_ROOT%{_bindir} -for i in mingw32-configure mingw32-make mingw32-cmake mingw32-qmake-qt4; do - ln -s %{_libexecdir}/mingw32-scripts $i +for i in mingw32-configure mingw32-cmake mingw32-make mingw32-pkg-config \ + mingw64-configure mingw64-cmake mingw64-make mingw64-pkg-config ; do + ln -s %{_libexecdir}/mingw-scripts $i done popd mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/profile.d -install -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/ -#install -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/ +install -m 644 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/ +install -m 644 %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/ mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rpm -install -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/rpm/macros.mingw32 +install -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/rpm/macros.mingw +install -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/rpm/macros.mingw32 +install -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/rpm/macros.mingw64 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rpmlint -install -m 644 %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/rpmlint/ +install -m 644 %{SOURCE10} $RPM_BUILD_ROOT%{_sysconfdir}/rpmlint/ -mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-pc-mingw32 - -# GCC requires these directories, even though they contain links -# to binaries which are also installed in /usr/bin etc. These -# contain Fedora native binaries. -mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-pc-mingw32/bin -mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-pc-mingw32/lib +# Create the folders required for gcc and binutils +mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-w64-mingw32 +mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-w64-mingw32/bin +mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-w64-mingw32/lib +mkdir -p $RPM_BUILD_ROOT%{_prefix}/x86_64-w64-mingw32 +mkdir -p $RPM_BUILD_ROOT%{_prefix}/x86_64-w64-mingw32/bin +mkdir -p $RPM_BUILD_ROOT%{_prefix}/x86_64-w64-mingw32/lib # The MinGW system root which will contain Windows native binaries # and Windows-specific header files, pkgconfig, etc. -mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-pc-mingw32/sys-root/mingw -mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-pc-mingw32/sys-root/mingw/bin -mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-pc-mingw32/sys-root/mingw/etc -mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-pc-mingw32/sys-root/mingw/include -mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-pc-mingw32/sys-root/mingw/include/sys -mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-pc-mingw32/sys-root/mingw/lib -mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-pc-mingw32/sys-root/mingw/lib/pkgconfig -mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-pc-mingw32/sys-root/mingw/sbin +mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-w64-mingw32/sys-root/mingw +mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-w64-mingw32/sys-root/mingw/bin +mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-w64-mingw32/sys-root/mingw/etc +mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-w64-mingw32/sys-root/mingw/include +mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-w64-mingw32/sys-root/mingw/include/sys +mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-w64-mingw32/sys-root/mingw/lib +mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-w64-mingw32/sys-root/mingw/lib/pkgconfig +mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-w64-mingw32/sys-root/mingw/sbin -mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-pc-mingw32/sys-root/mingw/share/aclocal -mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-pc-mingw32/sys-root/mingw/share/cmake -mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-pc-mingw32/sys-root/mingw/share/pkgconfig -mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-pc-mingw32/sys-root/mingw/share/xml +mkdir -p $RPM_BUILD_ROOT%{_prefix}/x86_64-w64-mingw32/sys-root/mingw +mkdir -p $RPM_BUILD_ROOT%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/bin +mkdir -p $RPM_BUILD_ROOT%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/etc +mkdir -p $RPM_BUILD_ROOT%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/include +mkdir -p $RPM_BUILD_ROOT%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/include +mkdir -p $RPM_BUILD_ROOT%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/lib +mkdir -p $RPM_BUILD_ROOT%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig +mkdir -p $RPM_BUILD_ROOT%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/sbin # We don't normally package manual pages and info files, except # where those are not supplied by a Fedora native package. So we # need to create the directories. # # Note that some packages try to install stuff in -# /usr/i686-pc-mingw32/sys-root/mingw/man and -# /usr/i686-pc-mingw32/sys-root/mingw/doc +# /usr/x86_64-pc-mingw32/sys-root/man and +# /usr/x86_64-pc-mingw32/sys-root/doc # but those are both packaging bugs. -mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-pc-mingw32/sys-root/mingw/share -mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-pc-mingw32/sys-root/mingw/share/doc -mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-pc-mingw32/sys-root/mingw/share/info -mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-pc-mingw32/sys-root/mingw/share/man -mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-pc-mingw32/sys-root/mingw/share/man/man{1,2,3,4,5,6,7,8,l,n} -mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-pc-mingw32/sys-root/mingw/share/themes +mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-w64-mingw32/sys-root/mingw/share +mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-w64-mingw32/sys-root/mingw/share/doc +mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-w64-mingw32/sys-root/mingw/share/info +mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-w64-mingw32/sys-root/mingw/share/man +mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-w64-mingw32/sys-root/mingw/share/man/man{1,2,3,4,5,6,7,8,l,n} +mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-w64-mingw32/sys-root/mingw/share/aclocal +mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-w64-mingw32/sys-root/mingw/share/themes +mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-w64-mingw32/sys-root/mingw/share/cmake +mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-w64-mingw32/sys-root/mingw/share/pkgconfig +mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-w64-mingw32/sys-root/mingw/share/xml + +mkdir -p $RPM_BUILD_ROOT%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/share +mkdir -p $RPM_BUILD_ROOT%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/share/doc +mkdir -p $RPM_BUILD_ROOT%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/share/info +mkdir -p $RPM_BUILD_ROOT%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/share/man +mkdir -p $RPM_BUILD_ROOT%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/share/man/man{1,2,3,4,5,6,7,8,l,n} +mkdir -p $RPM_BUILD_ROOT%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/share/aclocal +mkdir -p $RPM_BUILD_ROOT%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/share/themes +mkdir -p $RPM_BUILD_ROOT%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/share/cmake +mkdir -p $RPM_BUILD_ROOT%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/share/pkgconfig +mkdir -p $RPM_BUILD_ROOT%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/share/xml # NB. NOT _libdir mkdir -p $RPM_BUILD_ROOT/usr/lib/rpm -install -m 0755 %{SOURCE4} $RPM_BUILD_ROOT/usr/lib/rpm -install -m 0755 %{SOURCE5} $RPM_BUILD_ROOT/usr/lib/rpm -install -m 0755 %{SOURCE9} $RPM_BUILD_ROOT/usr/lib/rpm +install -m 0755 %{SOURCE6} $RPM_BUILD_ROOT%{_rpmconfigdir} +install -m 0755 %{SOURCE7} $RPM_BUILD_ROOT%{_rpmconfigdir} +install -m 0755 %{SOURCE8} $RPM_BUILD_ROOT%{_rpmconfigdir} +install -m 0755 %{SOURCE13} $RPM_BUILD_ROOT%{_rpmconfigdir} mkdir -p $RPM_BUILD_ROOT/usr/lib/rpm/fileattrs -install -m 0644 %{SOURCE10} $RPM_BUILD_ROOT/usr/lib/rpm/fileattrs/ +install -m 0644 %{SOURCE14} $RPM_BUILD_ROOT%{_rpmconfigdir}/fileattrs/ +install -m 0644 %{SOURCE15} $RPM_BUILD_ROOT%{_rpmconfigdir}/fileattrs/ -mkdir -p $RPM_BUILD_ROOT%{_datadir}/mingw32 -install -m 644 %{SOURCE8} $RPM_BUILD_ROOT%{_datadir}/mingw32 +mkdir -p $RPM_BUILD_ROOT%{_datadir}/mingw +install -m 0644 %{SOURCE11} $RPM_BUILD_ROOT%{_datadir}/mingw/ +install -m 0644 %{SOURCE12} $RPM_BUILD_ROOT%{_datadir}/mingw/ +%files base +%doc COPYING +%dir %{_sysconfdir}/rpmlint/ +%config(noreplace) %{_sysconfdir}/rpmlint/mingw-rpmlint.config +%config(noreplace) %{_sysconfdir}/rpm/macros.mingw +%{_libexecdir}/mingw-scripts +%{_rpmconfigdir}/mingw* +%dir %{_datadir}/mingw/ + %files -n mingw32-filesystem -%doc COPYING %config(noreplace) %{_sysconfdir}/rpm/macros.mingw32 %config(noreplace) %{_sysconfdir}/profile.d/mingw32.sh -#%config(noreplace) %{_sysconfdir}/profile.d/mingw32.csh -%dir %{_sysconfdir}/rpmlint -%config(noreplace) %{_sysconfdir}/rpmlint/mingw32-rpmlint.config %{_bindir}/mingw32-configure -%{_bindir}/mingw32-make %{_bindir}/mingw32-cmake -%{_bindir}/mingw32-qmake-qt4 -%{_libexecdir}/mingw32-scripts -%{_prefix}/i686-pc-mingw32/ -%{_datadir}/mingw32 -/usr/lib/rpm/mingw32-* -/usr/lib/rpm/fileattrs/mingw32.attr +%{_bindir}/mingw32-make +%{_bindir}/mingw32-pkg-config +%{_prefix}/i686-w64-mingw32 +%{_rpmconfigdir}/fileattrs/mingw32.attr +%{_datadir}/mingw/Toolchain-mingw32.cmake + +%files -n mingw64-filesystem +%config(noreplace) %{_sysconfdir}/rpm/macros.mingw64 +%config(noreplace) %{_sysconfdir}/profile.d/mingw64.sh +%{_bindir}/mingw64-configure +%{_bindir}/mingw64-cmake +%{_bindir}/mingw64-make +%{_bindir}/mingw64-pkg-config +%{_prefix}/x86_64-w64-mingw32 +%{_rpmconfigdir}/fileattrs/mingw64.attr +%{_datadir}/mingw/Toolchain-mingw64.cmake %changelog +* Sat Feb 25 2012 Erik van Pienbroek - 95-1 +- 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. + * Thu Feb 23 2012 Kalev Lember - 69-15 - Rename the source package to mingw-filesystem (#673784) diff --git a/mingw-find-debuginfo.sh b/mingw-find-debuginfo.sh new file mode 100755 index 0000000..4a5e4ff --- /dev/null +++ b/mingw-find-debuginfo.sh @@ -0,0 +1,40 @@ +#!/bin/sh +# mingw-find-debuginfo.sh - automagically generate debug info and file list +# for inclusion in an rpm spec file for mingw-* packages. + +if [ -z "$1" ] ; then BUILDDIR="." +else BUILDDIR=$1 +fi + +if [ "$2" = "old" ] ; then USE_OLD_METHOD=true; else USE_OLD_METHOD=false; fi + +for f in `find $RPM_BUILD_ROOT -type f -name "*.exe" -or -name "*.dll"` +do + case $(mingw-objdump -h $f 2>/dev/null | egrep -o '(debug[\.a-z_]*|gnu.version)') in + *debuglink*) continue ;; + *debug*) ;; + *gnu.version*) + echo "WARNING: "`echo $f | sed -e "s,^$RPM_BUILD_ROOT/*,/,"`" is already stripped!" + continue + ;; + *) continue ;; + esac + + echo extracting debug info from $f + mingw-objcopy --only-keep-debug $f $f.debug || : + pushd `dirname $f` + mingw-objcopy --add-gnu-debuglink=`basename $f.debug` --strip-unneeded `basename $f` || : + popd +done + +if [ "$USE_OLD_METHOD" = "true" ] ; then + find $RPM_BUILD_ROOT -type f -name "*.exe.debug" -or -name "*.dll.debug" | + sed -n -e "s#^$RPM_BUILD_ROOT##p" > $BUILDDIR/debugfiles.list +else + shift + for target in $@; do + prefix=`rpm --eval "%{${target}_prefix}"` + find $RPM_BUILD_ROOT$prefix -type f -name "*.exe.debug" -or -name "*.dll.debug" | + sed -n -e "s#^$RPM_BUILD_ROOT##p" > $BUILDDIR/${target}-debugfiles.list + done +fi diff --git a/mingw-find-lang.sh b/mingw-find-lang.sh new file mode 100755 index 0000000..097fc21 --- /dev/null +++ b/mingw-find-lang.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# Wrapper for the %find_lang macro which splits out the various translations in per-target lists + +/usr/lib/rpm/find-lang.sh $* +if test $? != 0 ; then + exit 1 +fi + +PACKAGE_NAME=$2 +targets=`rpm --eval '%{mingw_build_targets}'` +for target in $targets; do + prefix=`rpm --eval "%{${target}_prefix}"` + cat $2.lang | grep "$prefix" > ${target}-$PACKAGE_NAME.lang +done + +exit 0 diff --git a/mingw32-find-provides.sh b/mingw-find-provides.sh similarity index 54% rename from mingw32-find-provides.sh rename to mingw-find-provides.sh index 966360b..30c6150 100755 --- a/mingw32-find-provides.sh +++ b/mingw-find-provides.sh @@ -3,18 +3,22 @@ # This script reads filenames from STDIN and outputs any relevant provides # information that needs to be included in the package. -if [ "$1" ] -then - package_name="$1" +targets=$@ +if [ -z "$targets" ] ; then + echo "Usage: $0 [ mingw32 ] [ mingw64 ]" + exit 1 fi -[ -z "$OBJDUMP" ] && OBJDUMP=i686-pc-mingw32-objdump - filelist=`sed "s/['\"]/\\\&/g"` dlls=$(echo $filelist | tr [:blank:] '\n' | grep '\.dll$') for f in $dlls; do basename=`basename $f | tr [:upper:] [:lower:]` - echo "mingw32($basename)" + for target in $targets; do + host_triplet=`rpm --eval "%{${target}_target}"` + [[ $f =~ .*$host_triplet.* ]] && echo "$target($basename)" + done done + +exit 0 diff --git a/mingw-find-requires.sh b/mingw-find-requires.sh new file mode 100755 index 0000000..1e38cfb --- /dev/null +++ b/mingw-find-requires.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +# This script reads filenames from STDIN and outputs any relevant provides +# information that needs to be included in the package. + +[ -z "$OBJDUMP" ] && OBJDUMP=mingw-objdump + +targets=$@ +if [ -z "$targets" ] ; then + echo "Usage: $0 [ mingw32 ] [ mingw64 ]" + exit 1 +fi + +# Get the list of files. + +filelist=`sed "s/['\"]/\\\&/g"` + +dlls=$(echo $filelist | tr [:blank:] '\n' | grep -Ei '\.(dll|exe)$') + +for target in $targets; do + dll_found=false + host_triplet=`rpm --eval "%{${target}_target}"` + for f in $dlls; do + if [[ $f =~ .*$host_triplet.* ]]; then + $OBJDUMP -p $f | grep 'DLL Name' | grep -Eio '[-._\+[:alnum:]]+\.dll' | + tr [:upper:] [:lower:] | + sed "s/\(.*\)/$target(\1)/" + dll_found=true + fi + done + # Add a dependency on filesystem and crt if necessary + if [ $dll_found = true ]; then + echo "${target}-filesystem >= 83" + echo "${target}-crt" + fi +done | sort -u diff --git a/mingw32-rpmlint.config b/mingw-rpmlint.config similarity index 52% rename from mingw32-rpmlint.config rename to mingw-rpmlint.config index b591c28..1c43c92 100644 --- a/mingw32-rpmlint.config +++ b/mingw-rpmlint.config @@ -4,16 +4,21 @@ # Unconditionally remove devel-file-in-non-devel rpmlint warning. addFilter ("^mingw32-.*devel-file-in-non-devel") +addFilter ("^mingw64-.*devel-file-in-non-devel") -# /usr/i686-pc-mingw32 is permitted by MinGW packaging guidelines. -addFilter ("^mingw32-.*non-standard-dir-in-usr i686-pc-mingw32") +# /usr/x86_64-pc-mingw32 is permitted by MinGW packaging guidelines. +addFilter ("^mingw32-.*non-standard-dir-in-usr i686-w64-mingw32") +addFilter ("^mingw64-.*non-standard-dir-in-usr x86_64-w64-mingw32") # Permit *.la files (error is a bit odd, but it's what rpmlint prints). addFilter ("^mingw32-.*script-without-shebang.*\.la$") +addFilter ("^mingw64-.*script-without-shebang.*\.la$") # GCC and libtool create executable archive files. It's not clear # why, but we permit this for now. addFilter ("^mingw32-.*spurious-executable-perm.*\.dll\.a$") +addFilter ("^mingw64-.*spurious-executable-perm.*\.dll\.a$") -# *.dll.a files are permitted arch-independent objects. -addFilter ("^mingw32-.*arch-independent-package-contains-binary-or-object.*\.dll\.a$") +# *.a and *.dll.a files are permitted arch-independent objects. +addFilter ("^mingw32-.*arch-independent-package-contains-binary-or-object.*\.a$") +addFilter ("^mingw64-.*arch-independent-package-contains-binary-or-object.*\.a$") diff --git a/mingw32-scripts.sh b/mingw-scripts.sh similarity index 65% rename from mingw32-scripts.sh rename to mingw-scripts.sh index 8f36dd2..53bd44d 100755 --- a/mingw32-scripts.sh +++ b/mingw-scripts.sh @@ -1,13 +1,13 @@ #!/bin/sh - -# mingw32-scripts +# mingw-scripts # Copyright (C) 2008 Red Hat Inc., Richard W.M. Jones. # Copyright (C) 2008 Levente Farkas # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. +# the Free Software Foundation; either version 2, or (at your option) +# any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -16,12 +16,19 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. # This is a useful command-line script through which one can use the -# macros from mingw32-macros.mingw32 cross-compilation. +# macros from /etc/rpm/macros.cross, macros.mingw32 and macros.mingw64 -NAME="_`basename $0|tr -- - _`" +if [ "`basename $0`" = "i686-w64-mingw32-pkg-config" ] ; then + NAME="mingw32_pkg_config" +elif [ "`basename $0`" = "x86_64-w64-mingw32-pkg-config" ] ; then + NAME="mingw64_pkg_config" +else + NAME="`basename $0|tr -- - _`" +fi # NOTE: The use of 'eval' in combination with '$@' is a potential security risk # We should find a more safe replacement for this command diff --git a/mingw32-find-debuginfo.sh b/mingw32-find-debuginfo.sh deleted file mode 100755 index 7758058..0000000 --- a/mingw32-find-debuginfo.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -#mingw32_find-debuginfo.sh - automagically generate debug info and file list -#for inclusion in an rpm spec file for mingw32-* packages. - -if [ -z "$1" ] ; then BUILDDIR="." -else BUILDDIR=$1 -fi - -for f in `find $RPM_BUILD_ROOT -type f -name "*.exe" -or -name "*.dll"` -do - case $(i686-pc-mingw32-objdump -h $f 2>/dev/null | egrep -o '(debug[\.a-z_]*|gnu.version)') in - *debuglink*) continue ;; - *debug*) ;; - *gnu.version*) - echo "WARNING: "`echo $f | sed -e "s,^$RPM_BUILD_ROOT/*,/,"`" is already stripped!" - continue - ;; - *) continue ;; - esac - - echo extracting debug info from $f - i686-pc-mingw32-objcopy --only-keep-debug $f $f.debug || : - pushd `dirname $f` - i686-pc-mingw32-objcopy --add-gnu-debuglink=`basename $f.debug` --strip-unneeded `basename $f` || : - popd -done - -find $RPM_BUILD_ROOT -type f -name "*.exe.debug" -or -name "*.dll.debug" | - sed -n -e "s#^$RPM_BUILD_ROOT##p" > $BUILDDIR/debugfiles.list - - diff --git a/mingw32-find-requires.sh b/mingw32-find-requires.sh deleted file mode 100755 index da6bb2c..0000000 --- a/mingw32-find-requires.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -# This script reads filenames from STDIN and outputs any relevant provides -# information that needs to be included in the package. - -if [ "$1" ] -then - package_name="$1" -fi - -[ -z "$OBJDUMP" ] && OBJDUMP=i686-pc-mingw32-objdump - -# Get the list of files. - -filelist=`sed "s/['\"]/\\\&/g"` - -# Everything requires mingw32-filesystem and mingw32-runtime. -echo 'mingw32-filesystem' -echo 'mingw32-runtime' - -dlls=$(echo $filelist | tr [:blank:] '\n' | grep -Ei '\.(dll|exe)$') - -for f in $dlls; do - $OBJDUMP -p $f | grep 'DLL Name' | grep -Eio '[-._\+[:alnum:]]+\.dll' | - tr [:upper:] [:lower:] | - sed 's/\(.*\)/mingw32(\1)/' -done | sort -u diff --git a/mingw32.attr b/mingw32.attr index fa9251a..498385b 100644 --- a/mingw32.attr +++ b/mingw32.attr @@ -1,3 +1,3 @@ -%__mingw32_provides %{_rpmconfigdir}/mingw32-find-provides.sh -%__mingw32_requires %{_rpmconfigdir}/mingw32-find-requires.sh -%__mingw32_path ^%{_mingw32_prefix}/.*\.([Dd][Ll][Ll]|[Ee][Xx][Ee])$ +%__mingw32_provides %{_rpmconfigdir}/mingw-find-provides.sh mingw32 +%__mingw32_requires %{_rpmconfigdir}/mingw-find-requires.sh mingw32 +%__mingw32_path ^%{mingw32_prefix}/.*\.([Dd][Ll][Ll]|[Ee][Xx][Ee])$ diff --git a/mingw32.csh b/mingw32.csh deleted file mode 100644 index 89d8b66..0000000 --- a/mingw32.csh +++ /dev/null @@ -1 +0,0 @@ -# Environment variables for MinGW. diff --git a/mingw32.sh b/mingw32.sh index 94e4dec..921ad73 100644 --- a/mingw32.sh +++ b/mingw32.sh @@ -1,3 +1,3 @@ -# Environment variables for MinGW. +# Environment variables for cross compilers. -alias mingw32-env='eval `rpm --eval %{_mingw32_env}`' +alias mingw32-env='eval `rpm --eval %{mingw32_env}`' diff --git a/mingw64.attr b/mingw64.attr new file mode 100644 index 0000000..9e7ab01 --- /dev/null +++ b/mingw64.attr @@ -0,0 +1,3 @@ +%__mingw64_provides %{_rpmconfigdir}/mingw-find-provides.sh mingw64 +%__mingw64_requires %{_rpmconfigdir}/mingw-find-requires.sh mingw64 +%__mingw64_path ^%{mingw64_prefix}/.*\.([Dd][Ll][Ll]|[Ee][Xx][Ee])$ diff --git a/mingw64.sh b/mingw64.sh new file mode 100644 index 0000000..2913bf0 --- /dev/null +++ b/mingw64.sh @@ -0,0 +1,3 @@ +# Environment variables for cross compilers. + +alias mingw64-env='eval `rpm --eval %{mingw64_env}`'