Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

postgis: add html and api doc generation options #38872

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 29 additions & 0 deletions Library/Formula/postgis.rb
Expand Up @@ -21,6 +21,8 @@ def pour_bottle?

option "with-gui", "Build shp2pgsql-gui in addition to command line tools"
option "without-gdal", "Disable postgis raster support"
option "with-html-docs", "Generate multi-file HTML documentation"
option "with-api-docs", "Generate developer API documentation (long process)"

depends_on "pkg-config" => :build
depends_on "gpp" => :build
Expand All @@ -37,6 +39,16 @@ def pour_bottle?
# For advanced 2D/3D functions
depends_on "sfcgal" => :recommended

if build.with? "html-docs"
depends_on "imagemagick"
depends_on "docbook-xsl"
end

if build.with? "api-docs"
depends_on "graphviz"
depends_on "doxygen"
end

def install
# Follow the PostgreSQL linked keg back to the active Postgres installation
# as it is common for people to avoid upgrading Postgres.
Expand All @@ -63,10 +75,27 @@ def install
args << "--with-gui" if build.with? "gui"
args << "--without-raster" if build.without? "gdal"

args << "--with-xsldir=#{Formula["docbook-xsl"].opt_prefix}/docbook-xsl" if build.with? "html-docs"

system "./autogen.sh" if build.head?
system "./configure", *args
system "make"

if build.with? "html-docs"
cd "doc" do
ENV["XML_CATALOG_FILES"] ="#{HOMEBREW_PREFIX}/etc/xml/catalog"
system "make", "chunked-html"
doc.install "html"
end
end

if build.with? "api-docs"
cd "doc" do
system "make", "doxygen"
doc.install "doxygen/html" => "api"
end
end

# PostGIS includes the PGXS makefiles and so will install __everything__
# into the Postgres keg instead of the PostGIS keg. Unfortunately, some
# things have to be inside the Postgres keg in order to be function. So, we
Expand Down