17 Commits

Author SHA1 Message Date
Carlo Cabrera
309504a32c
formula: add rpath helper method
About 40 formulae set `CMAKE_INSTALL_RPATH` to `lib` or `opt_lib`, but
this breaks bottle relocatability.

The correct solution is to use `@loader_path/../lib`, but this is macOS
specific, so it requires some OS-specific logic. Rather than replicating
this logic over many formulae, we may as well define a helper method for
it.

See https://github.com/Homebrew/homebrew-core/issues/75458.
2021-04-19 09:23:33 +01:00
Seeker
0aa4259654 formula: include versioned *.so.* libs for shared_library("*") 2020-12-24 08:51:01 -08:00
Seeker
a2af19360b extend: add on_os (for on_macos/on_linux) 2020-12-07 10:36:51 -08:00
Markus Reiter
0184e271d8 Fix RuboCop offenses. 2020-11-17 11:09:55 +01:00
Michka Popoff
8b85ef2e88 formula: add on_linux and on_macos blocks
for install and others
2020-11-03 22:54:07 +01:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Maxim Belkin
152dd1ca24 Move allowed_missing_libraries: extend/os/linux/formula.rb ~> formula.rb 2020-07-24 11:06:38 +00:00
Maxim Belkin
85cca2e852 formula.rb [Linux]: undefine allowed_missing_libraries first 2020-07-24 10:54:44 +00:00
Maxim Belkin
1b8c32c716 Move allowed_missing_libs? to linkage_checker.rb.
Optimize 'unexpected_broken_dylibs'
2020-07-22 14:30:52 +00:00
Maxim Belkin
73495c4959 formula.rb [extend/Linux]: add missing comma 2020-07-21 15:48:55 +00:00
Maxim Belkin
2ffb9fd0fc
extend/os/linux/formula.rb: ignore_missing_libraries: change unless to if
Change
```rb
      unless libraries.all? { |x| x.is_a?(String) || x.is_a?(Regexp) }
```
to
```rb
if libraries.any? { |x| !x.is_a?(String) && !x.is_a?(Regexp) }
```

Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2020-07-21 10:43:28 -05:00
Maxim Belkin
68ebf8866a extend/os/linux/formula.rb: allowed_missing_lib: check input class 2020-07-21 15:40:27 +00:00
Maxim Belkin
7080ad5ebc formula.rb: update missing libs feature
1. Raise an exception on macOS.
2. Verify that the missing libraries are specified either as Strings or
   Regular Expressions.

Signed-off-by: Maxim Belkin <maxim.belkin@gmail.com>
2020-07-21 13:16:56 +00:00
Maxim Belkin
f2ddcda85b Fix style (Convert if-elsif to case-when) 2020-07-16 13:53:32 +00:00
Maxim Belkin
c61aba4ec3 Formula: ignore_missing_libraries DSL 2020-07-16 13:51:16 +00:00
Michka Popoff
955bca6574 formule: add generic shared-lib methods
We have strings containing hardcoded ".dylib" extensions in homebrew-core.
To be able to bring linuxbrew-core and homebrew-core closer together,
I am introducing a new generic attribute that can be used in formulae.
2020-06-20 23:14:18 +02:00
Michka Popoff
c7927f5af5 formula: add linux and macos only function blocks 2020-04-12 23:51:41 +02:00