Several patches for static library subpackages
by Erik van Pienbroek
Hi all,
Lately I've been working on getting static libraries operational and
usable in our toolchain. Attached to this mail are patches for pixman,
cairo, libxml2, gettext, libssh2, libidn, openssl and curl.
I've also been working on static libraries for GTK+, but there are still
some issues remaining with it (like a crash when loading external
gdk-pixbuf modules or the 'wimp' theme engine) so I'm holding those off
for now.
Developers/packagers which are going to use these static libraries need
to customize their CFLAGS for some of the packages. This is necessary
to prevent compile failures. A list of these customized CFLAGS is
published at our new 'Tips and Tricks' page at
https://fedoraproject.org/wiki/MinGW/Tips
Are these patches good to be applied? The packages libssh2, libidn,
openssl and curl aren't in Fedora yet, so somebody else has to commit
those to the temporary HG repository.
Regards,
Erik van Pienbroek
15 years
rpms/mingw32-pixman/devel mingw32-pixman.spec,1.3,1.4
by Erik van Pienbroek
Author: epienbro
Update of /cvs/pkgs/rpms/mingw32-pixman/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv25972
Modified Files:
mingw32-pixman.spec
Log Message:
- Fixed %defattr line
- Added -static subpackage
Index: mingw32-pixman.spec
===================================================================
RCS file: /cvs/pkgs/rpms/mingw32-pixman/devel/mingw32-pixman.spec,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- mingw32-pixman.spec 26 Feb 2009 01:20:54 -0000 1.3
+++ mingw32-pixman.spec 14 Apr 2009 19:30:36 -0000 1.4
@@ -6,7 +6,7 @@
Name: mingw32-pixman
Version: 0.13.2
-Release: 4%{?dist}
+Release: 5%{?dist}
Summary: MinGW Windows Pixman library
License: MIT
@@ -32,6 +32,15 @@
MinGW Windows Pixman library.
+%package static
+Summary: Static version of the MinGW Windows Pixman library
+Requires: %{name} = %{version}-%{release}
+Group: Development/Libraries
+
+%description static
+Static version of the MinGW Windows Pixman library.
+
+
%prep
%setup -q -n pixman-%{version}
%patch0 -p1
@@ -40,7 +49,7 @@
%build
# Uses GTK for its testsuite, so disable this otherwise
# we have a chicken & egg problem on mingw
-%{_mingw32_configure} --disable-gtk --disable-static
+%{_mingw32_configure} --disable-gtk --enable-static --enable-shared
make %{?_smp_mflags}
@@ -55,7 +64,7 @@
%files
-%defattr(-,root,root)
+%defattr(-,root,root,-)
%doc LICENSE
%{_mingw32_bindir}/libpixman-1-0.dll
%{_mingw32_includedir}/pixman-1
@@ -64,7 +73,16 @@
%{_mingw32_libdir}/pkgconfig/pixman-1.pc
+%files static
+%defattr(-,root,root,-)
+%{_mingw32_libdir}/libpixman-1.a
+
+
%changelog
+* Fri Apr 3 2009 Erik van Pienbroek <epienbro(a)fedoraproject.org> - 0.13.2-5
+- Fixed %%defattr line
+- Added -static subpackage
+
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> - 0.13.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
15 years
rpms/mingw32-libxml2/devel mingw32-libxml2-static-build-compile-fix.patch, NONE, 1.1 mingw32-libxml2.spec, 1.3, 1.4
by Erik van Pienbroek
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(a)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(a)lists.fedoraproject.org> - 2.7.2-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
15 years
rpms/mingw32-gettext/devel mingw32-gettext.spec,1.4,1.5
by Erik van Pienbroek
Author: epienbro
Update of /cvs/pkgs/rpms/mingw32-gettext/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv24382
Modified Files:
mingw32-gettext.spec
Log Message:
Added -static subpackage
Index: mingw32-gettext.spec
===================================================================
RCS file: /cvs/pkgs/rpms/mingw32-gettext/devel/mingw32-gettext.spec,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- mingw32-gettext.spec 26 Feb 2009 01:07:19 -0000 1.4
+++ mingw32-gettext.spec 14 Apr 2009 19:26:46 -0000 1.5
@@ -6,7 +6,7 @@
Name: mingw32-gettext
Version: 0.17
-Release: 10%{?dist}
+Release: 11%{?dist}
Summary: GNU libraries and utilities for producing multi-lingual messages
License: GPLv2+ and LGPLv2+
@@ -39,6 +39,15 @@
MinGW Windows Gettext library
+%package static
+Summary: Static version of the MinGW Windows Gettext library
+Requires: %{name} = %{version}-%{release}
+Group: Development/Libraries
+
+%description static
+Static version of the MinGW Windows Gettext library.
+
+
%prep
%setup -q -n gettext-%{version}
@@ -50,7 +59,7 @@
--disable-java \
--disable-native-java \
--disable-csharp \
- --disable-static \
+ --enable-static \
--enable-threads=win32 \
--without-emacs
make %{?_smp_mflags}
@@ -123,8 +132,17 @@
%{_mingw32_datadir}/info/autosprintf.info
%{_mingw32_datadir}/info/gettext.info
+%files static
+%defattr(-,root,root,-)
+%{_mingw32_libdir}/libasprintf.a
+%{_mingw32_libdir}/libgettextpo.a
+%{_mingw32_libdir}/libintl.a
+
%changelog
+* Fri Apr 3 2009 Erik van Pienbroek <epienbro(a)fedoraproject.org> - 0.17-11
+- Added -static subpackage
+
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> - 0.17-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
15 years