]> git.pld-linux.org Git - packages/ldc.git/blob - ldc.spec
rpm version for noarch subpackage
[packages/ldc.git] / ldc.spec
1 #
2 # Conditional build:
3 %bcond_with     bootstrap               # bootstrap from pre-compiled binaries
4
5 %define bootstrap_version 1.27.1
6 Summary:        LLVM D Compiler
7 Name:           ldc
8 Version:        1.29.0
9 Release:        1
10 # The DMD frontend in dmd/* GPL version 1 or artistic license
11 # The files gen/asmstmt.cpp and gen/asm-*.hG PL version 2+ or artistic license
12 License:        BSD
13 Source0:        https://github.com/ldc-developers/ldc/releases/download/v%{version}/%{name}-%{version}-src.tar.gz
14 # Source0-md5:  34a5314be02d809258267fb1ba62e8a8
15 Source1:        https://github.com/ldc-developers/ldc/releases/download/v%{bootstrap_version}/%{name}2-%{bootstrap_version}-linux-x86_64.tar.xz
16 # Source1-md5:  1bc671b41ba59848e3d0ffe74c83fc7b
17 Source3:        macros.%{name}
18 Patch0:         %{name}-include-path.patch
19 Patch1:         %{name}-no-default-rpath.patch
20 URL:            https://github.com/ldc-developers/ldc
21 BuildRequires:  bash-completion
22 BuildRequires:  cmake
23 BuildRequires:  curl-devel
24 BuildRequires:  gc
25 %{!?with_bootstrap:BuildRequires:       ldc}
26 BuildRequires:  libconfig-devel
27 BuildRequires:  libedit-devel
28 BuildRequires:  libstdc++-devel
29 BuildRequires:  llvm-devel >= 12
30 BuildRequires:  rpm-build >= 4.6
31 BuildRequires:  rpmbuild(macros) >= 2.008
32 BuildRequires:  zlib-devel
33 ExclusiveArch:  %{x8664}
34 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35
36 %define dmdfe_major 2
37 %define dmdfe_minor 0
38 %define dmdfe_bump  99
39 %define dmdfe       %{dmdfe_major}.%{dmdfe_minor}.%{dmdfe_bump}
40
41 # Unresolved symbols found: _D4core9exception6_storeG128v
42 %define skip_post_check_so libphobos2-ldc-debug-shared.so.*
43
44 %description
45 LDC is a portable compiler for the D programming language with modern
46 optimization and code generation capabilities.
47
48 It uses the official DMD compiler frontend to support the latest
49 version of D, and relies on the LLVM Core libraries for code
50 generation.
51
52 %package druntime
53 Summary:        Runtime library for D
54 License:        Boost
55
56 %description druntime
57 Druntime is the minimum library required to support the D programming
58 language. It includes the system code required to support the garbage
59 collector, associative arrays, exception handling, array vector
60 operations, startup/shutdown, etc.
61
62 %description druntime -l fr
63 Druntime est la bibliothèque minimal requise pour supporter la
64 programmation en D. Est inclut le code système requis pour supporter
65 le ramasse miette, tableau associatif, gestion des exceptions,
66 opertation sur des vecteurs, démarage/extinction, etc
67
68 %package phobos
69 Summary:        Standard Runtime Library
70 License:        Boost
71 Requires:       %{name}-druntime = %{version}-%{release}
72
73 %description phobos
74 Each module in Phobos conforms as much as possible to the following
75 design goals. These are goals rather than requirements because D is
76 not a religion, it's a programming language, and it recognizes that
77 sometimes the goals are contradictory and counterproductive in certain
78 situations, and programmers have jobs that need to get done
79
80 %description phobos -l fr
81 Chaque module de Phobos est conforme autant que possible à la
82 conception suivante objectifs. Ce sont des objectifs plutôt que des
83 exigences car D n'est pas une religion, c'est un language de
84 programmation, et il reconnaît que, parfois, les objectifs sont
85 contradictoires et contre-productif dans certaines situations, et les
86 programmeurs ont travail qui doit être effectué.
87
88 %package phobos-geany-tags
89 Summary:        Support for enable autocompletion in geany
90 BuildRequires:  geany
91 Requires:       %{name} = %{version}-%{release}
92 Requires:       geany
93 BuildArch:      noarch
94
95 %description phobos-geany-tags
96 Enable autocompletion for phobos library in geany (IDE)
97
98 %description phobos-geany-tags -l fr
99 Active l'autocompletion pour pour la bibliothèque phobos dans geany
100 (IDE)
101
102 %prep
103 %setup -q -n %{name}-%{version}-src
104 %patch0 -p1
105 %patch1 -p1
106
107 # temp geany config directory for allow geany to generate tags
108 install -d geany_config
109
110 %if %{with bootstrap}
111 set -- *
112 install -d build-bootstrap2
113 cp -al "$@" build-bootstrap2
114 tar xf %{SOURCE1}
115 mv ldc2-%{bootstrap_version}-linux-x86_64 build-bootstrap1
116 %endif
117
118 %build
119 %if %{with bootstrap}
120 cd build-bootstrap2
121 %cmake \
122         -S .. \
123         -B build \
124         -DD_COMPILER:PATH=$(pwd)/../build-bootstrap1/bin/ldmd2 \
125         -DLDC_WITH_LLD:BOOL=OFF \
126         %{nil}
127 %{__cmake} --build build
128 cd ..
129 %endif
130
131 %cmake \
132         -B build \
133         -DMULTILIB:BOOL=OFF \
134         -DINCLUDE_INSTALL_DIR:PATH=%{_prefix}/lib/ldc/%{_target_platform}/include/d \
135         -DBASH_COMPLETION_COMPLETIONSDIR:PATH=%{_datadir}/bash-completion/completions \
136 %if %{with bootstrap}
137         -DD_COMPILER:PATH=$(pwd)/build-bootstrap2/build/bin/ldmd2 \
138 %endif
139         -DLDC_WITH_LLD:BOOL=OFF \
140         %{nil}
141
142 %{__cmake} --build build
143
144 # generate geany tags
145 geany -c geany_config -g phobos.d.tags $(find runtime/phobos/std -name "*.d")
146
147 %install
148 rm -rf $RPM_BUILD_ROOT
149 DESTDIR="$RPM_BUILD_ROOT" %{__cmake} --install build
150
151 # macros for D package
152 install -d $RPM_BUILD_ROOT%{_rpmconfigdir}/macros.d/
153 install --mode=0644 %{SOURCE3} $RPM_BUILD_ROOT%{_rpmconfigdir}/macros.d/macros.ldc
154
155 # geany tags
156 install -d $RPM_BUILD_ROOT%{_datadir}/geany/tags/
157 cp -p phobos.d.tags $RPM_BUILD_ROOT%{_datadir}/geany/tags/
158
159 %clean
160 rm -rf $RPM_BUILD_ROOT
161
162 %files
163 %defattr(644,root,root,755)
164 %doc README.md LICENSE
165 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ldc2.conf
166 %attr(755,root,root) %{_bindir}/ldc2
167 %attr(755,root,root) %{_bindir}/ldmd2
168 %attr(755,root,root) %{_bindir}/ldc-build-runtime
169 %attr(755,root,root) %{_bindir}/ldc-profdata
170 %attr(755,root,root) %{_bindir}/ldc-prune-cache
171 %{_rpmconfigdir}/macros.d/macros.ldc
172 %dir %{_prefix}/lib/ldc
173 %dir %{_prefix}/lib/ldc/%{_target_platform}
174 %dir %{_prefix}/lib/ldc/%{_target_platform}/include
175 %dir %{_prefix}/lib/ldc/%{_target_platform}/include/d
176 %{_prefix}/lib/ldc/%{_target_platform}/include/d/__builtins.di
177 %{_prefix}/lib/ldc/%{_target_platform}/include/d/core
178 %{_prefix}/lib/ldc/%{_target_platform}/include/d%{_sysconfdir}
179 %{_prefix}/lib/ldc/%{_target_platform}/include/d/importc.h
180 %{_prefix}/lib/ldc/%{_target_platform}/include/d/ldc
181 %{_prefix}/lib/ldc/%{_target_platform}/include/d/object.d
182 %{_prefix}/lib/ldc/%{_target_platform}/include/d/std
183 %{_libdir}/ldc_rt.dso.o
184 %{_libdir}/libdruntime-ldc-debug-shared.so
185 %{_libdir}/libdruntime-ldc-shared.so
186 %{_libdir}/libphobos2-ldc-debug-shared.so
187 %{_libdir}/libphobos2-ldc-shared.so
188 %dir %{_datadir}/bash-completion
189 %dir %{bash_compdir}
190 %{bash_compdir}/ldc2
191
192 %files druntime
193 %defattr(644,root,root,755)
194 %doc runtime/druntime/README.md runtime/README runtime/druntime/LICENSE.txt
195 %{_libdir}/libdruntime-ldc-debug-shared.so.%{dmdfe}
196 %{_libdir}/libdruntime-ldc-debug-shared.so.%{dmdfe_bump}
197 %{_libdir}/libdruntime-ldc-shared.so.%{dmdfe}
198 %{_libdir}/libdruntime-ldc-shared.so.%{dmdfe_bump}
199
200 %files phobos
201 %defattr(644,root,root,755)
202 %doc runtime/phobos/LICENSE_1_0.txt
203 %{_libdir}/libphobos2-ldc-debug-shared.so.%{dmdfe}
204 %{_libdir}/libphobos2-ldc-debug-shared.so.%{dmdfe_bump}
205 %{_libdir}/libphobos2-ldc-shared.so.%{dmdfe}
206 %{_libdir}/libphobos2-ldc-shared.so.%{dmdfe_bump}
207
208 %files phobos-geany-tags
209 %defattr(644,root,root,755)
210 %{_datadir}/geany/tags/phobos.d.tags
This page took 0.079863 seconds and 3 git commands to generate.