]> git.pld-linux.org Git - packages/dmd.git/blob - dmd.spec
- disable dynamic linking with libphobos by default (causes symbol clashes between...
[packages/dmd.git] / dmd.spec
1 #
2 # Conditional build:
3 %bcond_with     dynamic # dynamic linking with libphobos (doesn't work properly as of 2.065.0)
4 #
5 Summary:        Digital Mars D compiler
6 Summary(pl.UTF-8):      Digital Mars D - kompilator języka D
7 Name:           dmd
8 Version:        2.065.0
9 Release:        1
10 # Digital Mars is proprietary license (not redistributable)
11 License:        Boost v1.0 (D runtime, Phobos, tools), GPL v1+ or Artistic (compiler frontend), Digital Mars (the rest)
12 Group:          Development/Languages
13 Source0:        http://downloads.dlang.org/releases/2014/%{name}.%{version}.zip
14 # NoSource0-md5:        a17a699a7e4715658393819e9dc1814a
15 Source1:        https://github.com/D-Programming-Language/tools/archive/v%{version}/d-tools-%{version}.tar.gz
16 # Source1-md5:  d6b0b7a2a6b90a1374202c7582fc38e7
17 Patch0:         %{name}-system-zlib.patch
18 Patch1:         %{name}-shared.patch
19 NoSource:       0
20 URL:            http://dlang.org/dmd-linux.html
21 BuildRequires:  curl-devel
22 BuildRequires:  libstdc++-devel
23 BuildRequires:  zlib-devel
24 %if %{with dynamic}
25 Requires:       %{name}-libs = %{version}-%{release}
26 %endif
27 # used as linker
28 Requires:       gcc
29 ExclusiveArch:  %{ix86} %{x8664}
30 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31
32 %ifarch %{ix86}
33 %define         model   32
34 %else
35 %define         model   64
36 %endif
37
38 %description
39 Digital Mars D compiler.
40
41 %description -l pl.UTF-8
42 Digital Mars D - kompilator języka D.
43
44 %package libs
45 Summary:        Phobos runtime library for D language
46 Summary(pl.UTF-8):      Biblioteka uruchomieniowa Phobos dla języka D
47 Group:          Libraries
48
49 %description libs
50 Phobos runtime library for D language.
51
52 %description libs -l pl.UTF-8
53 Biblioteka uruchomieniowa Phobos dla języka D.
54
55 %package static
56 Summary:        Phobos and D-runtime static libraries for D language
57 Summary(pl.UTF-8):      Biblioteki statyczne Phobos oraz D-runtime dla języka D
58 Group:          Development/Libraries
59 Requires:       %{name} = %{version}-%{release}
60
61 %description static
62 Phobos and D-runtime static libraries for D language.
63
64 %description static -l pl.UTF-8
65 Biblioteki statyczne Phobos oraz D-runtime dla języka D.
66
67 %prep
68 %setup -q -n dmd2 -a1
69 %{__mv} tools-%{version} tools
70
71 %patch0 -p1
72 %{?with_dynamic:%patch1 -p1}
73
74 echo "%{version}" > src/dmd/VERSION
75
76 cp -p src/dmd/backendlicense.txt dmd-backendlicense.txt
77 cp -p src/dmd/readme.txt dmd-readme.txt
78 cp -p src/druntime/LICENSE druntime-LICENSE
79 cp -p src/druntime/README.md druntime-README.md
80
81 %build
82 %{__make} -C src/dmd -f posix.mak \
83         OS=LINUX \
84         TARGET_CPU=X86 \
85         MODEL=%{model} \
86         HOST_CC="%{__cxx}" \
87         GFLAGS='%{rpmcxxflags} $(WARNINGS) -D__pascal= -fno-exceptions'
88
89 DMD=$(pwd)/src/dmd/dmd
90 for t in target lib/libdruntime-linux%{model}.so ; do
91 %{__make} -C src/druntime -f posix.mak $t \
92         OS=linux \
93         MODEL=%{model} \
94         CC="%{__cc}" \
95         CFLAGS="%{rpmcflags} -m%{model} -fPIC" \
96         DMD="$DMD" \
97         PIC="-fPIC"
98 done
99
100 %{__make} -C src/phobos -f posix.mak \
101         OS=linux \
102         MODEL=%{model} \
103         CC="%{__cc}" \
104         CFLAGS="%{rpmcflags} -m%{model} -fPIC" \
105         DMD="$DMD" \
106         LIBCURL_STUB= \
107         PIC="-fPIC"
108
109 %{__make} -C tools -f posix.mak \
110         OS=linux \
111         MODEL=%{model} \
112         CC="%{__cc}" \
113         CFLAGS="%{rpmcflags} -m%{model} -fPIC" \
114         DMD="$DMD -I$(pwd)/src/phobos -I$(pwd)/src/druntime -L-L$(pwd)/src/phobos/generated/linux/release/%{model}"
115
116 %install
117 rm -rf $RPM_BUILD_ROOT
118 install -d $RPM_BUILD_ROOT{%{_includedir}/d/dmd/phobos/etc/c,%{_libdir},%{_sysconfdir},%{_docdir}/dmd}
119
120 install -Dp src/dmd/dmd $RPM_BUILD_ROOT%{_bindir}/dmd
121 cp -p src/druntime/lib/libdruntime-linux%{model}* $RPM_BUILD_ROOT%{_libdir}
122 cp -a src/phobos/generated/linux/release/%{model}/libphobos2.so* $RPM_BUILD_ROOT%{_libdir}
123 cp -p src/phobos/generated/linux/release/%{model}/libphobos2.a $RPM_BUILD_ROOT%{_libdir}
124 cp -pr src/druntime/import $RPM_BUILD_ROOT%{_includedir}/d/dmd/druntime
125 cp -pr src/phobos/{std,*.d} $RPM_BUILD_ROOT%{_includedir}/d/dmd/phobos
126 cp -p src/phobos/etc/c/*.d $RPM_BUILD_ROOT%{_includedir}/d/dmd/phobos/etc/c
127 cp -pr src/druntime/doc $RPM_BUILD_ROOT%{_docdir}/dmd/druntime
128 install tools/generated/linux/%{model}/{ddemangle,rdmd} $RPM_BUILD_ROOT%{_bindir}
129 install -Dp man/man1/dmd.1 $RPM_BUILD_ROOT%{_mandir}/man1/dmd.1
130 install -Dp man/man5/dmd.conf.5 $RPM_BUILD_ROOT%{_mandir}/man5/dmd.conf.5
131
132 cat >$RPM_BUILD_ROOT%{_sysconfdir}/dmd.conf <<EOF
133 [Environment]
134 DFLAGS=-I/usr/include/d/dmd/phobos -I/usr/include/d/dmd/druntime -L-L%{_libdir} -L--no-warn-search-mismatch -L--export-dynamic
135 EOF
136
137 %clean
138 rm -rf $RPM_BUILD_ROOT
139
140 %post   libs -p /sbin/ldconfig
141 %postun libs -p /sbin/ldconfig
142
143 %files libs
144 %defattr(644,root,root,755)
145 %attr(755,root,root) %{_libdir}/libphobos2.so.*.*.*
146 %attr(755,root,root) %ghost %{_libdir}/libphobos2.so.0.65
147
148 %files
149 %defattr(644,root,root,755)
150 %doc README.TXT license.txt dmd-*.txt druntime-*
151 %attr(755,root,root) %{_bindir}/ddemangle
152 %attr(755,root,root) %{_bindir}/dmd
153 %attr(755,root,root) %{_bindir}/rdmd
154 %if %{with dynamic}
155 %attr(755,root,root) %{_libdir}/libphobos2.so
156 %attr(755,root,root) %{_libdir}/libdruntime-linux%{model}.so
157 %endif
158 %{_libdir}/libdruntime-linux%{model}so.a
159 %{_libdir}/libdruntime-linux%{model}so.o
160 %{_sysconfdir}/dmd.conf
161 %dir %{_includedir}/d
162 %{_includedir}/d/dmd
163 %{_mandir}/man1/dmd.1*
164 %{_mandir}/man5/dmd.conf.5*
165 %{_docdir}/dmd
166
167 %if %{with dynamic}
168 %files static
169 %defattr(644,root,root,755)
170 %endif
171 %{_libdir}/libdruntime-linux%{model}.a
172 %{_libdir}/libdruntime-linux%{model}.o
173 %{_libdir}/libphobos2.a
This page took 0.160507 seconds and 3 git commands to generate.