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