Skip to content

Commit c2831ac

Browse files
committed
Allow to override target architecture sufix in archive name
tgz_package uses build platform for naming archives. When build packages for multiple architectures like x86_64 and arm, then the archive name is not correct. Update the script of tgz_package to check for configuration option `ohai['target_arch']` as target arch name. It allows to specify architecture in project like: ``` ohai['target_arch'] = 'universal' dependency 'tgz_package' ```
1 parent 1134a76 commit c2831ac

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
command: |
2828
cd omnibus
2929
bundle check || bundle install --binstubs
30-
bundle exec omnibus build llvm
30+
bundle exec omnibus build llvm --log-level debug
3131
- store_artifacts:
3232
path: ./omnibus/pkg
3333
destination: llvm

darwin/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,18 @@ The whole process is automated using a `Makefile`.
99
* `pkgconfig`, `libtool` (Can be installed by `$ brew install pkgconfig libtool`)
1010
* Own `/opt/crystal`, `/var/cache`.
1111

12-
```
12+
```shell
1313
sudo mkdir -p /opt/crystal
1414
sudo chown $(whoami) /opt/crystal/
1515
sudo mkdir -p /var/cache
1616
sudo chown $(whoami) /var/cache
1717
```
18+
* Optional: If you need to build LLVM, ensure the existence of the /opt/llvm directory.
19+
20+
```shell
21+
sudo mkdir -p /opt/llvm
22+
sudo chown $(whoami) /opt/llvm/
23+
```
1824

1925
# Getting started
2026

omnibus/config/projects/llvm.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ def valid_cmake_version?
1818

1919
dependency 'cmake' unless valid_cmake_version?
2020
dependency 'llvm'
21+
22+
# Requires for tgz_package to generate a proper archive name with sufix universal.
23+
ohai['target_arch'] = 'universal'
2124
dependency 'tgz_package' if macos? || mac_os_x? || centos?
2225

2326
exclude '\.git*'

omnibus/config/software/tgz_package.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44

55
build do
66
block do
7+
platform = ohai['os']
8+
target_arch = ohai['target_arch'] || ohai['kernel']['machine']
79
destination = File.expand_path('pkg', Omnibus::Config.project_root)
810
version = "#{project.build_version}-#{project.build_iteration}"
911
version.gsub!("/", "-")
10-
tgz_name = "#{project.name}-#{version}-#{ohai['os']}-#{ohai['kernel']['machine']}.tar.gz"
12+
tgz_name = "#{project.name}-#{version}-#{platform}-#{target_arch}.tar.gz"
1113
if macos? || mac_os_x?
1214
transform = "-s /./#{project.name}-#{version}/"
1315
else

0 commit comments

Comments
 (0)