Skip to content

Commit 19af2a4

Browse files
committed
Extra build patch for mingw32-nspr.
1 parent 44ec8da commit 19af2a4

File tree

2 files changed

+84
-31
lines changed

2 files changed

+84
-31
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
--- lib/ds/Makefile.in.orig 2009-10-09 23:53:03.034630801 +0100
2+
+++ lib/ds/Makefile.in 2009-10-09 23:53:30.545755685 +0100
3+
@@ -121,10 +121,11 @@
4+
endif
5+
6+
LIBRARY_NAME = plds
7+
-IMPORT_LIBRARY = libplds.dll.a
8+
+IMPORT_LIBRARY = libplds4.dll.a
9+
+TARGETS += libplds4.dll.a
10+
OS_LIBS = -ladvapi32 -lwsock32 -lwinmm
11+
LIBRARY_VERSION = $(MOD_MAJOR_VERSION)
12+
-libplds.dll.a: libplds.dll
13+
+libplds4.dll.a: libplds4.dll
14+
15+
RELEASE_HEADERS = $(HEADERS)
16+
RELEASE_HEADERS_DEST = $(RELEASE_INCLUDE_DIR)

nspr/mingw32-nspr.spec

Lines changed: 68 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,81 @@
1-
%define __strip %{_mingw32_strip}
2-
%define __objdump %{_mingw32_objdump}
3-
%define _use_internal_dependency_generator 0
4-
%define __find_requires %{_mingw32_findrequires}
5-
%define __find_provides %{_mingw32_findprovides}
1+
%global __strip %{_mingw32_strip}
2+
%global __objdump %{_mingw32_objdump}
3+
%global _use_internal_dependency_generator 0
4+
%global __find_requires %{_mingw32_findrequires}
5+
%global __find_provides %{_mingw32_findprovides}
66

7-
Name: mingw32-nspr
8-
Version: 4.7.2
9-
Release: 7%{?dist}
107
Summary: MinGW Windows port of the Netscape Portable Runtime (NSPR)
11-
8+
Name: mingw32-nspr
9+
Version: 4.8
10+
Release: 1%{?dist}
1211
License: MPLv1.1 or GPLv2+ or LGPLv2+
13-
Group: Development/Libraries
1412
URL: http://www.mozilla.org/projects/nspr/
15-
Source0: ftp://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v%{version}/src/nspr-%{version}.tar.gz
16-
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
13+
Group: System Environment/Libraries
14+
BuildRoot: %{_tmppath}/%{name}-%{version}-root
1715

1816
BuildArch: noarch
1917

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

2325
Patch1: nspr-config-pc.patch
26+
Patch1000: mingw32-nspr-4.7.2-build.patch
27+
Patch1001: mingw32-nspr-4.7.2-extra-build.patch
2428

2529
BuildRequires: mingw32-filesystem >= 33
2630
BuildRequires: mingw32-gcc
2731
BuildRequires: mingw32-binutils
2832

2933
Requires: pkgconfig
3034

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

41+
# static package not created at the moment
42+
#%package static
43+
#Summary: Static version of the MinGW Windows NSPR library
44+
#Requires: %{name} = %{version}-%{release}
45+
#Group: Development/Libraries
46+
#
47+
#%description static
48+
#Static version of the MinGW Windows NSPR library.
3849

3950
%prep
4051
%setup -q -n nspr-%{version}
4152

42-
cp ./mozilla/nsprpub/config/nspr-config.in \
43-
./mozilla/nsprpub/config/nspr-config-pc.in
53+
# Original nspr-config is not suitable for our distribution,
54+
# because on different platforms it contains different dynamic content.
55+
# Therefore we produce an adjusted copy of nspr-config that will be
56+
# identical on all platforms.
57+
# However, we need to use original nspr-config to produce some variables
58+
# that go into nspr.pc for pkg-config.
59+
60+
cp ./mozilla/nsprpub/config/nspr-config.in ./mozilla/nsprpub/config/nspr-config-pc.in
4461
%patch1 -p0
62+
pushd ./mozilla/nsprpub
63+
%patch1000 -p0
64+
%patch1001 -p0
65+
popd
4566

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

48-
4969
%build
5070
pushd mozilla/nsprpub
5171

5272
# Configure for Windows cross-compiling.
5373
%{_mingw32_configure} \
5474
--includedir=%{_mingw32_includedir}/nspr4 \
55-
--enable-optimize="%{_mingw32_cflags}" \
56-
--disable-debug \
5775
--enable-win32-target=WINNT \
58-
--enable-64bit=no
76+
--enable-64bit=no \
77+
--enable-optimize="%{_mingw32_cflags}" \
78+
--disable-debug
5979

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

7393

7494
%install
75-
rm -rf $RPM_BUILD_ROOT
95+
96+
%{__rm} -Rf $RPM_BUILD_ROOT
7697

7798
pushd mozilla/nsprpub
7899

@@ -82,7 +103,8 @@ mkdir -p $RPM_BUILD_ROOT%{_mingw32_libdir}
82103
mkdir -p $RPM_BUILD_ROOT%{_mingw32_includedir}
83104
install dist/bin/*.dll $RPM_BUILD_ROOT%{_mingw32_bindir}
84105
install dist/lib/*.a $RPM_BUILD_ROOT%{_mingw32_libdir}
85-
cp -rL dist/include/nspr $RPM_BUILD_ROOT%{_mingw32_includedir}/
106+
cp -rL dist/include/nspr $RPM_BUILD_ROOT%{_mingw32_includedir}/nspr4
107+
install -m 755 ./config/nspr-config $RPM_BUILD_ROOT%{_mingw32_bindir}
86108

87109
# Write an nspr pkgconfig file.
88110

@@ -107,25 +129,40 @@ popd
107129

108130

109131
%clean
110-
rm -rf $RPM_BUILD_ROOT
132+
%{__rm} -Rf $RPM_BUILD_ROOT
111133

112134

113135
%files
114-
%defattr(-,root,root)
136+
%defattr(-,root,root,-)
115137
%{_mingw32_bindir}/libnspr4.dll
116138
%{_mingw32_bindir}/libplc4.dll
117139
%{_mingw32_bindir}/libplds4.dll
118-
%{_mingw32_libdir}/libnspr4.a
119-
%{_mingw32_libdir}/libplc4.a
120-
%{_mingw32_libdir}/libnspr4_s.a
121-
%{_mingw32_libdir}/libplc4_s.a
122-
%{_mingw32_libdir}/libplds4.a
123-
%{_mingw32_libdir}/libplds4_s.a
140+
%{_mingw32_libdir}/libnspr4.dll.a
141+
%{_mingw32_libdir}/libplc4.dll.a
142+
%{_mingw32_libdir}/libplds4.dll.a
143+
# not generated for some reason
144+
#%{_mingw32_bindir}/libnspr4.la
145+
#%{_mingw32_bindir}/libplc4.la
146+
#%{_mingw32_bindir}/libplds4.la
147+
%{_mingw32_includedir}/nspr4/
124148
%{_mingw32_libdir}/pkgconfig/nspr.pc
125-
%{_mingw32_includedir}/nspr
126-
149+
%{_mingw32_bindir}/nspr-config
150+
151+
# static package not created at the moment
152+
#%files static
153+
#%defattr(-,root,root,-)
154+
#%{_mingw32_libdir}/libnspr4.a
155+
#%{_mingw32_libdir}/libplc4.a
156+
#%{_mingw32_libdir}/libplds4.a
157+
#%{_mingw32_libdir}/libnspr4_s.a
158+
#%{_mingw32_libdir}/libplc4_s.a
159+
#%{_mingw32_libdir}/libplds4_s.a
127160

128161
%changelog
162+
* Fri Oct 9 2009 Amorilia <amorilia@users.sourceforge.net> - 4.8-1
163+
- Update to 4.8
164+
- Fix for libplds4.dll.a import library
165+
129166
* Fri Feb 20 2009 Richard W.M. Jones <rjones@redhat.com> - 4.7.2-7
130167
- Rebuild for mingw32-gcc 4.4
131168

0 commit comments

Comments
 (0)