Blob Blame History Raw
%global win32_dir %{_builddir}/mingw32-%{name}-%{version}-%{release}
%global win64_dir %{_builddir}/mingw64-%{name}-%{version}-%{release}
%global win32_host_dir %{_builddir}/mingw32-host-%{name}-%{version}-%{release}
%global win64_host_dir %{_builddir}/mingw64-host-%{name}-%{version}-%{release}

# Disable debuginfo subpackages and debugsource packages for now to use old logic
%undefine _debugsource_packages
%undefine _debuginfo_subpackages

# Override the __debug_install_post argument as this package
# contains both native as well as cross compiled binaries
%global __debug_install_post %%{mingw_debug_install_post}; %{_rpmconfigdir}/ %{?_missing_build_ids_terminate_build:--strict-build-id} %{?_find_debuginfo_opts} "%{_builddir}/%%{?buildsubdir}" %{nil}

%global pkgname sip

Name:           mingw-%{pkgname}
Summary:        MinGW Windows SIP
Version:        4.19.5
Release:        1%{?dist}

# sipgen/parser.{c.h} is GPLv3+ with exceptions (bison)
License:        GPLv2 or GPLv3 and (GPLv3+ with exceptions)
Source1:        mingw-win32-host-pyconfig
Source2:        mingw-win64-host-pyconfig
Source3:        mingw-win32-pyconfig
Source4:        mingw-win64-pyconfig
Source5:        mingw-win32-g++
Source6:        mingw-win64-g++

# make install should not strip (by default), kills -debuginfo
Patch0:         sip-4.16.3-no_strip.patch
# try not to rpath the world
Patch1:         sip-4.16.3-no_rpath.patch
# Fix some config paths, add -lpythonX.Y to linker flags
Patch2:         sip-4.19-config.patch

BuildRequires:  gcc-c++
BuildRequires:  python2-devel

BuildRequires:  mingw32-filesystem >= 102
BuildRequires:  mingw32-python2
BuildRequires:  mingw32-qt5-qtbase

BuildRequires:  mingw64-filesystem >= 102
BuildRequires:  mingw64-python2
BuildRequires:  mingw64-qt5-qtbase

MinGW Windows SIP.

%package -n mingw32-%{pkgname}
Summary:       MinGW Windows SIP
Requires:      mingw32-python2

%description -n mingw32-%{pkgname}
MinGW Windows SIP.

%package -n mingw64-%{pkgname}
Summary:       MinGW Windows SIP
Requires:      mingw64-python2

%description -n mingw64-%{pkgname}
MinGW Windows SIP.


%autosetup -p1 -n %{pkgname}-%{version}
cp -a %{SOURCE5} specs/mingw-win32-g++
cp -a %{SOURCE6} specs/mingw-win64-g++

rm -rf %{win32_dir}
rm -rf %{win64_dir}
rm -rf %{win32_host_dir}
rm -rf %{win64_host_dir}
cp -a . %{win32_dir}
cp -a . %{win64_dir}
cp -a . %{win32_host_dir}
cp -a . %{win64_host_dir}

pushd %{win32_host_dir}
%{__python2} --configuration=%{SOURCE1} \
    CXXFLAGS="%{optflags} -I/usr/include/python2.7" CFLAGS="%{optflags} -I/usr/include/python2.7" LFLAGS="%{?__global_ldflags}"

pushd %{win64_host_dir}
%{__python2} --configuration=%{SOURCE2} \
    CXXFLAGS="%{optflags} -I/usr/include/python2.7" CFLAGS="%{optflags} -I/usr/include/python2.7" LFLAGS="%{?__global_ldflags}"

pushd %{win32_dir}
mingw32-python --configuration=%{SOURCE3} --use-qmake -p mingw-win32-g++ \
    CXXFLAGS="%{optflags}" CFLAGS="%{optflags}" LFLAGS="%{?__global_ldflags}"
%mingw32_make %{?_smp_mflags}

pushd %{win64_dir}
mingw64-python --configuration=%{SOURCE4} --use-qmake -p mingw-win64-g++ \
    CXXFLAGS="%{optflags}" CFLAGS="%{optflags}" LFLAGS="%{?__global_ldflags}"
%mingw64_make %{?_smp_mflags}

%make_install -C %{win32_host_dir}
%make_install -C %{win64_host_dir}
%mingw32_make INSTALL_ROOT=%{buildroot} -C %{win32_dir} install
%mingw64_make INSTALL_ROOT=%{buildroot} -C %{win64_dir} install

mkdir -p %{buildroot}%{mingw32_datadir}/sip
mkdir -p %{buildroot}%{mingw64_datadir}/sip

mkdir -p %{buildroot}%{_bindir}
ln -s %{_prefix}/%{mingw32_target}/bin/sip %{buildroot}%{_bindir}/mingw32-sip
ln -s %{_prefix}/%{mingw64_target}/bin/sip %{buildroot}%{_bindir}/mingw64-sip

# Exclude debug files from the main files (note: the debug files are only created after %%install, so we can't search for them directly)
find %{buildroot}%{mingw32_prefix} | grep -E '.(exe|dll|pyd)$' | sed 's|^%{buildroot}\(.*\)$|%%exclude \1.debug|' > mingw32-%{pkgname}.debugfiles
find %{buildroot}%{mingw64_prefix} | grep -E '.(exe|dll|pyd)$' | sed 's|^%{buildroot}\(.*\)$|%%exclude \1.debug|' > mingw64-%{pkgname}.debugfiles

%files -n mingw32-%{pkgname} -f mingw32-%{pkgname}.debugfiles
%exclude %{mingw32_python2_sitearch}/*.debug
%dir %{mingw32_datadir}/sip

%files -n mingw64-%{pkgname} -f mingw64-%{pkgname}.debugfiles
%exclude %{mingw64_python2_sitearch}/*.debug
%dir %{mingw64_datadir}/sip

* Tue Nov 07 2017 Sandro Mani <> - 4.19.5-1
- Update to 4.19.5

* Sat Nov 04 2017 Sandro Mani <> - 4.19.4-1
- Update to 4.19.4

* Sat Sep 09 2017 Sandro Mani <> - 4.19.3-4
- More robust debug file filtering

* Sat Sep 09 2017 Sandro Mani <> - 4.19.3-3
- Rebuild for mingw-filesystem

* Mon Sep 04 2017 Sandro Mani <> - 4.19.3-2
- Build against Qt5

* Tue Jul 11 2017 Sandro Mani <> - 4.19.3-1
- Update to 4.19.3

* Tue Apr 25 2017 Sandro Mani <> - 4.19.2-1
- Update to 4.19.2

* Mon Jan 16 2017 Sandro Mani <> - 4.19-1
- Update to 4.19.0

* Fri Jan 22 2016 Sandro Mani <> - 4.17-1
- Update to 4.17.0

* Mon Aug 10 2015 Sandro Mani <> - 4.16.9-1
- Initial package