rpms/mingw32-libxml2/devel mingw32-libxml2-static-build-compile-fix.patch, NONE, 1.1 mingw32-libxml2.spec, 1.3, 1.4

Erik van Pienbroek epienbro at fedoraproject.org
Tue Apr 14 19:29:22 UTC 2009


Author: epienbro

Update of /cvs/pkgs/rpms/mingw32-libxml2/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv25099

Modified Files:
	mingw32-libxml2.spec 
Added Files:
	mingw32-libxml2-static-build-compile-fix.patch 
Log Message:
- Fixed %defattr line
- Added -static subpackage. Applications which want to link
  against this static library needs to add -DLIBXML_STATIC to the CFLAGS
- This package shouldn't own %%{_mingw32_libdir}/pkgconfig


mingw32-libxml2-static-build-compile-fix.patch:

--- NEW FILE mingw32-libxml2-static-build-compile-fix.patch ---
--- threads.c.orig	2009-04-03 19:12:55.382657819 +0200
+++ threads.c	2009-04-03 19:13:10.362407937 +0200
@@ -975,8 +975,8 @@
  */
 #if defined(HAVE_WIN32_THREADS) && !defined(HAVE_COMPILER_TLS) && (!defined(LIBXML_STATIC) || defined(LIBXML_STATIC_FOR_DLL))
 #if defined(LIBXML_STATIC_FOR_DLL)
-BOOL XMLCALL
-xmlDllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+int XMLCALL
+xmlDllMain(void *hinstDLL, unsigned long fdwReason, void *lpvReserved)
 #else
 BOOL WINAPI
 DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)


Index: mingw32-libxml2.spec
===================================================================
RCS file: /cvs/pkgs/rpms/mingw32-libxml2/devel/mingw32-libxml2.spec,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- mingw32-libxml2.spec	26 Feb 2009 01:17:29 -0000	1.3
+++ mingw32-libxml2.spec	14 Apr 2009 19:28:52 -0000	1.4
@@ -6,7 +6,7 @@
 
 Name:           mingw32-libxml2
 Version:        2.7.2
-Release:        8%{?dist}
+Release:        9%{?dist}
 Summary:        MinGW Windows libxml2 XML processing library
 
 License:        MIT
@@ -20,6 +20,7 @@
 
 # MinGW-specific patches.
 Patch1000:      mingw32-libxml2-2.7.2-with-modules.patch
+Patch1001:      mingw32-libxml2-static-build-compile-fix.patch
 
 BuildArch:      noarch
 
@@ -41,10 +42,20 @@
 MinGW Windows libxml2 XML processing library.
 
 
+%package static
+Summary:        Static version of the MinGW Windows XML processing library
+Requires:       %{name} = %{version}-%{release}
+Group:          Development/Libraries
+
+%description static
+Static version of the MinGW Windows XML processing library.
+
+
 %prep
 %setup -q -n libxml2-%{version}
 
 %patch1000 -p1
+%patch1001 -p0
 
 # Patched configure.in, so rebuild configure.
 libtoolize --force --copy
@@ -52,15 +63,39 @@
 
 
 %build
-LDFLAGS="-no-undefined" \
-%{_mingw32_configure} --without-python --with-modules --disable-static
-make %{?_smp_mflags}
+# LibXML2 can't build static and shared libraries in one go, so we
+# build LibXML2 twice here
+mkdir build_static
+pushd build_static
+    LDFLAGS="-no-undefined" \
+    %{_mingw32_configure} --without-python --with-modules --enable-static --disable-shared CFLAGS="$CFLAGS -DLIBXML_STATIC_FOR_DLL"
+    make %{?_smp_mflags}
+popd
+
+mkdir build_shared
+pushd build_shared
+    LDFLAGS="-no-undefined" \
+    %{_mingw32_configure} --without-python --with-modules --disable-static --enable-shared
+    make %{?_smp_mflags}
+popd
 
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
-make DESTDIR=$RPM_BUILD_ROOT install
+# First install all the files belonging to the shared build
+make -C build_shared DESTDIR=$RPM_BUILD_ROOT install
+
+# Install all the files from the static build in a seperate folder
+# and move the static libraries to the right location
+make -C build_static DESTDIR=$RPM_BUILD_ROOT/build_static install
+mv $RPM_BUILD_ROOT/build_static%{_mingw32_libdir}/*.a $RPM_BUILD_ROOT%{_mingw32_libdir}
+
+# Manually merge the libtool files
+sed -i s/"old_library=''"/"old_library='libxml2.a'"/ $RPM_BUILD_ROOT%{_mingw32_libdir}/libxml2.la
+
+# Drop the folder which was temporary used for installing the static bits
+rm -rf $RPM_BUILD_ROOT/build_static
 
 # Remove manpages which duplicate Fedora native.
 rm -rf $RPM_BUILD_ROOT%{_mingw32_mandir}
@@ -71,14 +106,13 @@
 
 
 %files
-%defattr(-,root,root)
+%defattr(-,root,root,-)
 %{_mingw32_bindir}/libxml2-2.dll
 %{_mingw32_bindir}/xml2-config
 %{_mingw32_bindir}/xmlcatalog.exe
 %{_mingw32_bindir}/xmllint.exe
 %{_mingw32_libdir}/libxml2.dll.a
 %{_mingw32_libdir}/libxml2.la
-%{_mingw32_libdir}/pkgconfig
 %{_mingw32_libdir}/pkgconfig/libxml-2.0.pc
 %{_mingw32_libdir}/xml2Conf.sh
 %{_mingw32_includedir}/libxml2
@@ -87,7 +121,17 @@
 %{_mingw32_datadir}/gtk-doc/html/libxml2/
 
 
+%files static
+%defattr(-,root,root,-)
+%{_mingw32_libdir}/libxml2.a
+
 %changelog
+* Fri Apr  3 2009 Erik van Pienbroek <epienbro at fedoraproject.org> - 2.7.2-9
+- Fixed %%defattr line
+- Added -static subpackage. Applications which want to link
+  against this static library needs to add -DLIBXML_STATIC to the CFLAGS
+- This package shouldn't own %%{_mingw32_libdir}/pkgconfig
+
 * Wed Feb 25 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.7.2-8
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
 




More information about the scm-commits mailing list