Skip to content

Commit

Permalink
Extra build patch for mingw32-nspr.
Browse files Browse the repository at this point in the history
  • Loading branch information
amorilia committed Jan 31, 2010
1 parent 44ec8da commit 19af2a4
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 31 deletions.
16 changes: 16 additions & 0 deletions nspr/mingw32-nspr-4.7.2-extra-build.patch
@@ -0,0 +1,16 @@
--- lib/ds/Makefile.in.orig 2009-10-09 23:53:03.034630801 +0100
+++ lib/ds/Makefile.in 2009-10-09 23:53:30.545755685 +0100
@@ -121,10 +121,11 @@
endif

LIBRARY_NAME = plds
-IMPORT_LIBRARY = libplds.dll.a
+IMPORT_LIBRARY = libplds4.dll.a
+TARGETS += libplds4.dll.a
OS_LIBS = -ladvapi32 -lwsock32 -lwinmm
LIBRARY_VERSION = $(MOD_MAJOR_VERSION)
-libplds.dll.a: libplds.dll
+libplds4.dll.a: libplds4.dll

RELEASE_HEADERS = $(HEADERS)
RELEASE_HEADERS_DEST = $(RELEASE_INCLUDE_DIR)
99 changes: 68 additions & 31 deletions nspr/mingw32-nspr.spec
@@ -1,61 +1,81 @@
%define __strip %{_mingw32_strip}
%define __objdump %{_mingw32_objdump}
%define _use_internal_dependency_generator 0
%define __find_requires %{_mingw32_findrequires}
%define __find_provides %{_mingw32_findprovides}
%global __strip %{_mingw32_strip}
%global __objdump %{_mingw32_objdump}
%global _use_internal_dependency_generator 0
%global __find_requires %{_mingw32_findrequires}
%global __find_provides %{_mingw32_findprovides}

Name: mingw32-nspr
Version: 4.7.2
Release: 7%{?dist}
Summary: MinGW Windows port of the Netscape Portable Runtime (NSPR)

Name: mingw32-nspr
Version: 4.8
Release: 1%{?dist}
License: MPLv1.1 or GPLv2+ or LGPLv2+
Group: Development/Libraries
URL: http://www.mozilla.org/projects/nspr/
Source0: ftp://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v%{version}/src/nspr-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Group: System Environment/Libraries
BuildRoot: %{_tmppath}/%{name}-%{version}-root

BuildArch: noarch

# Sources available at ftp://ftp.mozilla.org/pub/mozilla.org/nspr/releases/
# When CVS tag based snapshots are being used, refer to CVS documentation on
# mozilla.org and check out subdirectory mozilla/nsprpub.
Source0: nspr-%{version}.tar.bz2
Source1: nspr.pc.in
Source2: nspr-config-vars.in

Patch1: nspr-config-pc.patch
Patch1000: mingw32-nspr-4.7.2-build.patch
Patch1001: mingw32-nspr-4.7.2-extra-build.patch

BuildRequires: mingw32-filesystem >= 33
BuildRequires: mingw32-gcc
BuildRequires: mingw32-binutils

Requires: pkgconfig


%description
NSPR provides platform independence for non-GUI operating system
facilities. These facilities include threads, thread synchronization,
normal file and network I/O, interval timing and calendar time, basic
memory management (malloc and free) and shared library linking.

# static package not created at the moment
#%package static
#Summary: Static version of the MinGW Windows NSPR library
#Requires: %{name} = %{version}-%{release}
#Group: Development/Libraries
#
#%description static
#Static version of the MinGW Windows NSPR library.

%prep
%setup -q -n nspr-%{version}

cp ./mozilla/nsprpub/config/nspr-config.in \
./mozilla/nsprpub/config/nspr-config-pc.in
# Original nspr-config is not suitable for our distribution,
# because on different platforms it contains different dynamic content.
# Therefore we produce an adjusted copy of nspr-config that will be
# identical on all platforms.
# However, we need to use original nspr-config to produce some variables
# that go into nspr.pc for pkg-config.

cp ./mozilla/nsprpub/config/nspr-config.in ./mozilla/nsprpub/config/nspr-config-pc.in
%patch1 -p0
pushd ./mozilla/nsprpub
%patch1000 -p0
%patch1001 -p0
popd

cp %{SOURCE2} ./mozilla/nsprpub/config/


%build
pushd mozilla/nsprpub

# Configure for Windows cross-compiling.
%{_mingw32_configure} \
--includedir=%{_mingw32_includedir}/nspr4 \
--enable-optimize="%{_mingw32_cflags}" \
--disable-debug \
--enable-win32-target=WINNT \
--enable-64bit=no
--enable-64bit=no \
--enable-optimize="%{_mingw32_cflags}" \
--disable-debug

# NSPR comes with its own "special" install program called nsinstall.
# This must be built as a native program.
Expand All @@ -72,7 +92,8 @@ popd


%install
rm -rf $RPM_BUILD_ROOT

%{__rm} -Rf $RPM_BUILD_ROOT

pushd mozilla/nsprpub

Expand All @@ -82,7 +103,8 @@ mkdir -p $RPM_BUILD_ROOT%{_mingw32_libdir}
mkdir -p $RPM_BUILD_ROOT%{_mingw32_includedir}
install dist/bin/*.dll $RPM_BUILD_ROOT%{_mingw32_bindir}
install dist/lib/*.a $RPM_BUILD_ROOT%{_mingw32_libdir}
cp -rL dist/include/nspr $RPM_BUILD_ROOT%{_mingw32_includedir}/
cp -rL dist/include/nspr $RPM_BUILD_ROOT%{_mingw32_includedir}/nspr4
install -m 755 ./config/nspr-config $RPM_BUILD_ROOT%{_mingw32_bindir}

# Write an nspr pkgconfig file.

Expand All @@ -107,25 +129,40 @@ popd


%clean
rm -rf $RPM_BUILD_ROOT
%{__rm} -Rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root)
%defattr(-,root,root,-)
%{_mingw32_bindir}/libnspr4.dll
%{_mingw32_bindir}/libplc4.dll
%{_mingw32_bindir}/libplds4.dll
%{_mingw32_libdir}/libnspr4.a
%{_mingw32_libdir}/libplc4.a
%{_mingw32_libdir}/libnspr4_s.a
%{_mingw32_libdir}/libplc4_s.a
%{_mingw32_libdir}/libplds4.a
%{_mingw32_libdir}/libplds4_s.a
%{_mingw32_libdir}/libnspr4.dll.a
%{_mingw32_libdir}/libplc4.dll.a
%{_mingw32_libdir}/libplds4.dll.a
# not generated for some reason
#%{_mingw32_bindir}/libnspr4.la
#%{_mingw32_bindir}/libplc4.la
#%{_mingw32_bindir}/libplds4.la
%{_mingw32_includedir}/nspr4/
%{_mingw32_libdir}/pkgconfig/nspr.pc
%{_mingw32_includedir}/nspr

%{_mingw32_bindir}/nspr-config

# static package not created at the moment
#%files static
#%defattr(-,root,root,-)
#%{_mingw32_libdir}/libnspr4.a
#%{_mingw32_libdir}/libplc4.a
#%{_mingw32_libdir}/libplds4.a
#%{_mingw32_libdir}/libnspr4_s.a
#%{_mingw32_libdir}/libplc4_s.a
#%{_mingw32_libdir}/libplds4_s.a

%changelog
* Fri Oct 9 2009 Amorilia <amorilia@users.sourceforge.net> - 4.8-1
- Update to 4.8
- Fix for libplds4.dll.a import library

* Fri Feb 20 2009 Richard W.M. Jones <rjones@redhat.com> - 4.7.2-7
- Rebuild for mingw32-gcc 4.4

Expand Down

0 comments on commit 19af2a4

Please sign in to comment.