|
1 | | -%define debug_package %nil |
2 | | - |
3 | | -Name: crystal |
4 | | -Version: 1.18.2 |
5 | | -Release: 1%?dist |
6 | | -Summary: The Crystal Programming Language |
7 | | -License: Apache-2.0 |
8 | | -URL: https://crystal-lang.org/ |
9 | | -Source0: https://github.com/crystal-lang/crystal/releases/download/%version/crystal-%version-1-linux-x86_64-bundled.tar.gz |
10 | | -ExclusiveArch: x86_64 |
11 | | -BuildRequires: rpm_macro(fdupes) |
| 1 | +%bcond bootstrap 1 |
| 2 | +%global bootstrap_version 1.17.1 |
12 | 3 |
|
13 | | -%description |
14 | | -%summary. |
15 | | - |
16 | | -%package devel |
17 | | -Summary: Development files for the crystal package |
| 4 | +Name: crystal |
| 5 | +Version: 1.18.2 |
| 6 | +Release: 2%?dist |
| 7 | +Summary: A general-purpose, object-oriented programming language |
| 8 | +License: Apache-2.0 |
| 9 | +Packager: Carl Hörberg <carl@84codes.com> |
| 10 | +URL: https://crystal-lang.org/ |
| 11 | +Source0: https://github.com/crystal-lang/crystal/archive/%version.tar.gz |
| 12 | +%if %{with bootstrap} |
| 13 | +Source1: https://dev.alpinelinux.org/archive/crystal/crystal-%{bootstrap_version}-%{_arch}-alpine-linux-musl.tar.gz |
| 14 | +%else |
| 15 | +BuildRequires: crystal |
| 16 | +%endif |
| 17 | +BuildRequires: gcc gcc-c++ make gc-devel llvm-devel |
| 18 | +BuildRequires: pcre2-devel libyaml-devel libffi-devel |
| 19 | +Requires: gcc pkgconfig gc-devel |
| 20 | +Requires: pcre2-devel openssl-devel zlib-devel |
| 21 | +Requires: libyaml-devel libxml2-devel gmp-devel |
| 22 | +Suggests: shards |
18 | 23 |
|
19 | | -%description devel |
20 | | -%summary. |
| 24 | +%description |
| 25 | +Crystal is a programming language with the following goals: |
| 26 | +- Have a syntax similar to Ruby (but compatibility with it is not a goal) |
| 27 | +- Statically type-checked but without having to specify the type of variables or method arguments |
| 28 | +- Be able to call C code by writing bindings to it in Crystal |
| 29 | +- Have compile-time evaluation and generation of code, to avoid boilerplate code |
| 30 | +- Compile to efficient native code |
21 | 31 |
|
22 | 32 | %prep |
23 | | -%autosetup -n crystal-%version-1 |
| 33 | +%setup -q |
| 34 | +%if %{with bootstrap} |
| 35 | +%setup -q -b 1 |
| 36 | +%endif |
24 | 37 |
|
25 | 38 | %build |
| 39 | +%if %{with bootstrap} |
| 40 | +# Use bootstrap crystal binary |
| 41 | +export PATH="%{_builddir}/crystal-%{bootstrap_version}-%{_arch}-alpine-linux-musl/bin:$PATH" |
| 42 | +%endif |
| 43 | +%make_build release=1 interpreter=1 LDFLAGS="%{build_ldflags}" CRYSTAL_CONFIG_LIBRARY_PATH=%{_libdir}/crystal |
26 | 44 |
|
27 | 45 | %install |
28 | | -mkdir -p %buildroot/usr/bin |
29 | | -mkdir -p %buildroot/usr/share |
30 | | -mkdir -p %buildroot/usr/lib/crystal |
31 | | -install -Dm755 bin/* %buildroot/usr/bin/ |
32 | | -cp -r share/* %buildroot/usr/share/ |
33 | | -cp -r lib/crystal/* %buildroot/usr/lib/crystal/ |
34 | | - |
35 | | -%fdupes %buildroot%_datadir/crystal/src/lib_c/ |
36 | | - |
| 46 | +%make_install PREFIX=%{_prefix} |
37 | 47 |
|
38 | 48 | %files |
39 | | -%license /usr/share/licenses/crystal/LICENSE |
40 | | -/usr/bin/crystal |
41 | | -/usr/share/zsh/site-functions/_crystal |
42 | | -/usr/share/man/man1/crystal.1.gz |
43 | | -/usr/share/crystal/ |
44 | | -/usr/share/fish/vendor_completions.d/crystal.fish |
45 | | -/usr/share/bash-completion/completions/crystal |
46 | | - |
47 | | -/usr/bin/shards |
48 | | -/usr/share/man/man1/shards.1.gz |
49 | | -/usr/share/man/man5/shard.yml.5.gz |
50 | | - |
51 | | -%files devel |
52 | | -/usr/lib/crystal/ |
| 49 | +%license %{_datadir}/licenses/crystal/LICENSE |
| 50 | +%{_bindir}/crystal |
| 51 | +%{_datadir}/crystal |
| 52 | +%{_datadir}/zsh/site-functions/_crystal |
| 53 | +%{_datadir}/bash-completion/completions/crystal |
| 54 | +%{_datadir}/fish/vendor_completions.d/crystal.fish |
| 55 | +%{_mandir}/man1/crystal.1.gz |
53 | 56 |
|
54 | 57 | %changelog |
| 58 | +* Mon Nov 03 2025 Carl Hörberg <carl@84codes.com> - 1.18.2-2 |
| 59 | +- Build from source, support multiple architectures. |
| 60 | + |
55 | 61 | * Sat Jun 17 2023 windowsboy111 <windowsboy111@fyralabs.com> - 1.8.2-2 |
56 | 62 | - Add devel package. |
57 | 63 |
|
|
0 commit comments