]> git.pld-linux.org Git - packages/crossnacl-newlib.git/blame - crossnacl-newlib.spec
use xz source
[packages/crossnacl-newlib.git] / crossnacl-newlib.spec
CommitLineData
78a56c9e 1%define gitver 67e3510
a6a083c8
ER
2Summary: C library intended for use on embedded systems
3Name: crossnacl-newlib
555495c1 4Version: 1.20.0
78a56c9e 5Release: 1.git%{gitver}
a6a083c8
ER
6License: BSD and MIT and LGPL v2+
7Group: Libraries
8Source0: nacl-newlib-%{version}-git%{gitver}.tar.bz2
78a56c9e
ER
9# Source0-md5: 62471478377d5f99a2ce88213731e500
10Source1: nacl-headers-21.0.1180.57.tar.bz2
11# Source1-md5: 8e76cde640c1f268e14dbd67568a4bee
a6a083c8 12Source2: newlib-libc-script
a6a083c8 13Source3: pthread.h
555495c1 14Source4: get-source.sh
a6a083c8
ER
15URL: http://sourceware.org/newlib/
16BuildRequires: crossnacl-binutils
17BuildRequires: crossnacl-gcc
91b4de56 18BuildRequires: fslint
462cb7b4
ER
19BuildRequires: tar >= 1:1.22
20BuildRequires: xz
a6a083c8
ER
21ExclusiveArch: %{ix86} %{x8664}
22BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
23
24%define target x86_64-nacl
25
26%description
27Newlib is a C library intended for use on embedded systems. It is a
28conglomeration of several library parts, all under free software
29licenses that make them easily usable on embedded products.
30
31This is the nacl fork.
32
33%prep
34%setup -q -n nacl-newlib-%{version}-git%{?gitver}
555495c1 35tar -xvf %{SOURCE1} -C newlib/libc/sys/nacl --strip-components=1
a6a083c8
ER
36cp -p %{SOURCE2} .
37
38%build
39export NEWLIB_CFLAGS="-O2 -D_I386MACH_ALLOW_HW_INTERRUPTS -DSIGNAL_PROVIDED -mtls-use-call"
40%configure \
41 --disable-libgloss \
42 --enable-newlib-iconv \
43 --enable-newlib-io-long-long \
44 --enable-newlib-io-long-double \
45 --enable-newlib-io-c99-formats \
46 --enable-newlib-mb \
47 libc_cv_initfinit_array=yes \
48 CFLAGS="-O2" \
49 CFLAGS_FOR_TARGET="$NEWLIB_CFLAGS" \
50 CXXFLAGS_FOR_TARGET="$NEWLIB_CFLAGS" \
51 --target=%{target}
52
53%{__make}
54
55%install
56rm -rf $RPM_BUILD_ROOT
57%{__make} install \
58 DESTDIR=$RPM_BUILD_ROOT
59
60# Conflicts with binutils
61%{__rm} -r $RPM_BUILD_ROOT%{_infodir}
62
63# The default pthread.h doesn't work right?
64%{__rm} $RPM_BUILD_ROOT%{_prefix}/%{target}/include/pthread.h
65cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_prefix}/%{target}/include/
66
67# We have to hack up libc.a to get things working.
68# 32bit
69mv $RPM_BUILD_ROOT%{_prefix}/%{target}/lib/32/libc.a $RPM_BUILD_ROOT%{_prefix}/%{target}/lib/32/libcrt_common.a
70sed "s/@OBJFORMAT@/elf32-nacl/" newlib-libc-script > $RPM_BUILD_ROOT%{_prefix}/%{target}/lib/32/libc.a
71
72# 64bit (default)
73mv $RPM_BUILD_ROOT%{_prefix}/%{target}/lib/libc.a $RPM_BUILD_ROOT%{_prefix}/%{target}/lib/libcrt_common.a
74sed "s/@OBJFORMAT@/elf64-nacl/" newlib-libc-script > $RPM_BUILD_ROOT%{_prefix}/%{target}/lib/libc.a
75
91b4de56
ER
76# fix copies to be hardlinks (maybe should symlink in the future)
77findup -m $RPM_BUILD_ROOT
78
a6a083c8
ER
79%clean
80rm -rf $RPM_BUILD_ROOT
81
82%files
83%defattr(644,root,root,755)
84%{_datadir}/iconv_data
85%{_prefix}/%{target}/include
86%{_prefix}/%{target}/lib
This page took 0.303501 seconds and 4 git commands to generate.