Skip to content

Commit

Permalink
postgis: Rename binaries and man pages to avoid link conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
9999years committed Jul 3, 2024
1 parent 0454805 commit 7a75eb7
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Generated with:
# brew tap --force homebrew/homebrew-core
# brew extract homebrew/homebrew-core/postgis MercuryTechnologies/homebrew-tap
class PostgisForPostgresql16 < Formula
class PostgisAT16 < Formula
desc "Adds support for geographic objects to PostgreSQL"
homepage "https://postgis.net/"
url "https://download.osgeo.org/postgis/source/postgis-3.4.2.tar.gz"
Expand All @@ -16,8 +16,6 @@ class PostgisForPostgresql16 < Formula
regex(/href=.*?postgis[._-]v?(\d+(?:\.\d+)+)\.t/i)
end

keg_only :versioned_formula

head do
url "https://git.osgeo.org/gitea/postgis/postgis.git", branch: "master"

Expand All @@ -44,6 +42,13 @@ def postgresql
Formula["postgresql@16"]
end

def add_suffix(file, suffix)
dir = File.dirname(file)
ext = File.extname(file)
base = File.basename(file, ext)
File.rename file, "#{dir}/#{base}-#{suffix}#{ext}"
end

def install
# Work around an Xcode 15 linker issue which causes linkage against LLVM's
# libunwind due to it being present in a library search path.
Expand Down Expand Up @@ -114,6 +119,10 @@ def install
utils/test_geography_joinestimation.pl
utils/test_joinestimation.pl
]

# Handle conflicts between different PostGIS formulae.
bin.children.each { |file| add_suffix file, postgresql.version.major }
man1.children.each { |file| add_suffix file, postgresql.version.major }
end

test do
Expand Down

0 comments on commit 7a75eb7

Please sign in to comment.