Skip to content

Commit

Permalink
Make homebrew optional
Browse files Browse the repository at this point in the history
Force-adding homebrew paths to `text-icu`, causes compilation and link errors on systems that have a mixture of homebrew and other system library providers. There currently is no way to prohibit `text-icu` from _not_ force-injecting homebrew paths. 

This change adds a flag to allow disabling the forced addition of homebrew paths to the package description.

Morally I'd argue that this flag should be off by default, I do however see this as a harder case to argue, and the current on-by-default to be less contentious.
  • Loading branch information
angerman authored Apr 5, 2024
1 parent 6f48020 commit ceb0842
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion text-icu.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ license: BSD3
license-file: LICENSE
build-type: Simple

flag homebrew
Description: Assume homebrew on macOS. Automatically add /usr/local/opt/ and /usr/homebrew/opt/ paths to extra-lib-dirs and include-dirs.
Default: True
Manual: True

extra-doc-files:
README.markdown
changelog.md
Expand Down Expand Up @@ -122,7 +127,7 @@ library
c-sources: cbits/text_icu.c
cc-options: -Wall -Wextra -pedantic -Wno-deprecated
include-dirs: include
if os(darwin)
if os(darwin) && flag(homebrew)
extra-lib-dirs:
/usr/local/opt/icu4c/lib
/opt/homebrew/opt/icu4c/lib
Expand Down

0 comments on commit ceb0842

Please sign in to comment.