Accepting request 1077070 from home:rhabacker:branches:windows:mingw:win64:cmake-fixes

- Update to version 20230401
  * Drop cmake support files as they are now located in the mingw64-cross-cmake (boo#1209611)

OBS-URL: https://build.opensuse.org/request/show/1077070
OBS-URL: https://build.opensuse.org/package/show/windows:mingw:win64/mingw64-filesystem?expand=0&rev=158
This commit is contained in:
Ralf Habacker 2023-04-03 20:28:50 +00:00 committed by Git OBS Bridge
parent fc22cac181
commit 00606653e3
6 changed files with 10 additions and 148 deletions

View File

@ -1,46 +0,0 @@
#
# Macros for cmake for mingw64
#
# depends on macros.cmake
#
%__cmake_generator %{lua: if rpm.expand("%__builder") == rpm.expand("%__make") then print("-G'Unix Makefiles'") else print("-GNinja") end}
%_mingw64_cmake %{_mingw64_env} ; \
mkdir -p %__builddir \
%__cmake \\\
%__cmake_generator \\\
-S %__sourcedir \\\
-B %__builddir \\\
-DCMAKE_SYSTEM_NAME="Windows" \\\
-DCMAKE_VERBOSE_MAKEFILE=ON \\\
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \\\
-DCMAKE_INSTALL_PREFIX:PATH=%{_mingw64_prefix} \\\
-DCMAKE_INSTALL_LIBDIR:PATH=%{_mingw64_libdir} \\\
-DBIN_INSTALL_DIR=%{_mingw64_bindir} \\\
-DINCLUDE_INSTALL_DIR:PATH=%{_mingw64_includedir} \\\
-DLIB_INSTALL_DIR:PATH=%{_mingw64_libdir} \\\
-DSHARE_INSTALL_DIR:PATH=%{_mingw64_datadir} \\\
-DSYSCONF_INSTALL_DIR:PATH=%{_mingw64_sysconfdir} \\\
-DSHARE_INSTALL_PREFIX:PATH=%{_mingw64_datadir} \\\
-DBUILD_SHARED_LIBS:BOOL=ON \\\
-DCMAKE_C_COMPILER="%{_bindir}/%{_mingw64_cc}" \\\
-DCMAKE_CXX_COMPILER="%{_bindir}/%{_mingw64_cxx}" \\\
-DCMAKE_Fortran_COMPILER="%{_bindir}/%{_mingw64_fc}" \\\
-DCMAKE_RC_COMPILER="%{_bindir}/%{_mingw64_windres}" \\\
-DCMAKE_FIND_ROOT_PATH="%{_mingw64_prefix}" \\\
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \\\
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \\\
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER
%__mingw64_cmake \
echo "Deprecated %%__mingw64_cmake macro used, please use %%_mingw64_cmake" \
%{_mingw64_cmake}
%_mingw64_cmake_build %cmake_build
%_mingw64_cmake_install %{_mingw64_env}; \
%cmake_install
%_mingw64_ctest(:-:) \
%__ctest --test-dir %__builddir --output-on-failure --force-new-ctest-process %{?_smp_mflags} %**

View File

@ -1,80 +0,0 @@
#!/usr/bin/python3
# -*- coding:utf-8 -*-
#
# Copyright (C) 2015 Daniel Vrátil <dvratil@redhat.com>
#
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Library General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, 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
# 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 Library 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.
#
import sys
import re
import glob
class CMakeParser:
def __init__(self, filelist = None):
if filelist == None:
filelist = sys.stdin
paths = map(lambda x: x.rstrip(), filelist.readlines())
for path in paths:
for (modulePath, cmakeModule, lowercase) in self.parseCmakeModuleConfig(path):
version = self.resolveCMakeModuleVersion(modulePath, cmakeModule, lowercase)
if version:
print("mingw64(cmake:%s) = %s" % (cmakeModule, version))
else:
print("mingw64(cmake:%s)" % cmakeModule)
def parseCmakeModuleConfig(self, configFile):
paths = configFile.rsplit("/", 3)
modulePath = "%s/cmake/%s" % (paths[0], paths[2])
result = []
for configFile in glob.glob("%s/*Config.cmake" % modulePath):
moduleName = configFile[len(modulePath) + 1:-len("Config.cmake")]
result.append( (modulePath, moduleName, False) )
for configFile in glob.glob("%s/*-config.cmake" % modulePath):
moduleName = configFile[len(modulePath) + 1:-len("-config.cmake")]
if (modulePath, moduleName, False) not in result:
result.append( (modulePath, moduleName, True) )
return result
def resolveCMakeModuleVersion(self, modulePath, cmakeModule, lowercase):
versionFile = ("%s/%s-config-version.cmake" if lowercase else "%s/%sConfigVersion.cmake") % (modulePath, cmakeModule)
try:
f = open(versionFile, 'r')
except:
return None
for line in f:
line = line.strip()
# set(PACKAGE_VERSION <version>)
version = re.match(r"^set[\ ]*\([\ ]*PACKAGE_VERSION[\ ]+[\"]*([0-9\.]+)[\"]*[\ ]*[.]*\)", line)
if version:
_version = version.groups(1)[0]
if _version == '..':
sys.stderr.write("error: Version pattern found without values - '%s' was created incorrectly\n" % versionFile)
return _version
return None
if __name__ == "__main__":
parser = CMakeParser()

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Tue Mar 28 04:05:34 UTC 2023 - Ralf Habacker <ralf.habacker@freenet.de>
- Update to version 20230401
* Drop cmake support files as they are now located in the
mingw32-cross-cmake (boo#1209611)
-------------------------------------------------------------------
Fri Mar 17 08:54:56 UTC 2023 - Ralf Habacker <ralf.habacker@freenet.de>

View File

@ -31,7 +31,7 @@
%define _rpmmacrodir %{_sysconfdir}/rpm
%endif
Name: mingw64-filesystem
Version: 20230309
Version: 20230401
Release: 0
Summary: MinGW base filesystem and environment
License: GPL-2.0-or-later
@ -49,13 +49,9 @@ Source8: mingw64-install-post.sh
Source9: mingw64-find-lang.sh
Source10: languages
Source11: languages.man
Source12: mingw64-cmake.prov
Source13: mingw64_cmake.attr
Source14: macros.mingw64-cmake
Source15: mingw64-filesystem-rpmlintrc
Source16: mingw-objdump-srcfiles
Source17: mingw64_binaries.attr
Source18: mingw64_cmake.attr
Source19: mingw64_config.attr
Source20: mingw64_libs.attr
Source21: mingw64_pkgconfig.attr
@ -119,7 +115,7 @@ install -m 755 %{SOURCE6} %{buildroot}%{_libexecdir}/mingw64-scripts
# but including macros.mingw64 results into an unknown failure
mkdir -p %{buildroot}%{_bindir}
pushd %{buildroot}%{_bindir}
for i in mingw64-configure mingw64-make mingw64-cmake mingw64-gdb; do
for i in mingw64-configure mingw64-make mingw64-gdb; do
ln -s %{_libexecdir}/mingw64-scripts $i
done
popd
@ -129,7 +125,6 @@ install -m 644 %{SOURCE2} %{buildroot}%{_distconfdir}/profile.d/
mkdir -p %{buildroot}%{_rpmmacrodir}
install -m 644 %{SOURCE1} %{buildroot}%{_rpmmacrodir}/macros.mingw64
install -m 644 %{SOURCE14} %{buildroot}%{_rpmmacrodir}/$(basename %{SOURCE14})
mkdir -p %{buildroot}%_rpmlintdir
# tumbleweed
@ -187,13 +182,9 @@ install -m 0755 %{SOURCE4} %{buildroot}%{_rpmconfigdir}
install -m 0755 %{SOURCE5} %{buildroot}%{_rpmconfigdir}
install -m 0755 %{SOURCE8} %{buildroot}%{_rpmconfigdir}
install -m 0755 %{SOURCE9} %{buildroot}%{_rpmconfigdir}
# cmake support
install -m 0755 %{SOURCE12} %{buildroot}%{_rpmconfigdir}
mkdir -p %{buildroot}%{_fileattrsdir}
install -m 0644 %{SOURCE13} %{buildroot}%{_fileattrsdir}
# dependency generator support
mkdir -p %{buildroot}%{_fileattrsdir}
install -m 0644 %{SOURCE17} %{buildroot}%{_fileattrsdir}
install -m 0644 %{SOURCE18} %{buildroot}%{_fileattrsdir}
install -m 0644 %{SOURCE19} %{buildroot}%{_fileattrsdir}
install -m 0644 %{SOURCE20} %{buildroot}%{_fileattrsdir}
install -m 0644 %{SOURCE21} %{buildroot}%{_fileattrsdir}
@ -216,7 +207,6 @@ install -m 0755 %{SOURCE16} %{buildroot}%{_bindir}/x86_64-w64-mingw32-objdump-sr
%files
%license COPYING
%{_rpmmacrodir}/macros.mingw64
%{_rpmmacrodir}/macros.mingw64-cmake
%if %{undefined _distconfdir}
%config %{_sysconfdir}/profile.d/mingw64.sh
%else
@ -228,7 +218,6 @@ install -m 0755 %{SOURCE16} %{buildroot}%{_bindir}/x86_64-w64-mingw32-objdump-sr
%_rpmlintdir/mingw64-rpmlint.config
%endif
%{_rpmconfigdir}/mingw64-*.prov
%{_fileattrsdir}/mingw64*.attr
%{_bindir}/mingw64-*
%{_bindir}/x86_64-w64-mingw32-*

View File

@ -16,7 +16,6 @@ filelist=`sed "s/['\"]/\\\&/g"`
dlls=$(echo "$filelist" | grep '\.dll$')
pcs=$(echo "$filelist" | grep '\.pc$')
libs=$(echo "$filelist" | grep '\.a$')
cmakes=$(echo "$filelist" | grep '[cC]onfig.cmake$')
for f in $dlls; do
[ ! -f "$f" ] && continue
@ -34,8 +33,3 @@ for h in $libs; do
libname=`basename "$h" | sed 's#^lib##g' | sed 's#\.dll\.#\.#g' | sed 's#\.a##g'`
echo "$target(lib:$libname)"
done
for h in $cmakes; do
[ ! -f "$h" ] && continue
echo $h | /usr/lib/rpm/mingw64-cmake.prov
done

View File

@ -1,2 +0,0 @@
%__mingw64_cmake_provides %{_rpmconfigdir}/mingw64-cmake.prov
%__mingw64_cmake_path ^(%{_mingw64_libdir}/cmake|%{_mingw64_datadir})/.*/.*(Config\.cmake|-config\.cmake)$