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