osm2pgsql 0.90.1

switch to CMake
drop unused protobuf-c dependency
exit code for -h is now 0 so update the test accordingly

Closes #3412.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
This commit is contained in:
ilovezfs 2016-08-22 07:04:42 -07:00
parent d4c41ac232
commit 700b715405

View file

@ -1,9 +1,18 @@
class Osm2pgsql < Formula
desc "OpenStreetMap data to PostgreSQL converter"
homepage "https://wiki.openstreetmap.org/wiki/Osm2pgsql"
url "https://github.com/openstreetmap/osm2pgsql/archive/0.88.1.tar.gz"
sha256 "08ec33c833768dec9856f537bbf4416ad45837ee0851eeeab0081c7bbed3449e"
revision 1
head "https://github.com/openstreetmap/osm2pgsql.git"
stable do
url "https://github.com/openstreetmap/osm2pgsql/archive/0.90.1.tar.gz"
sha256 "f9ba09714603db251e4a357c1968640c350b0ca5c99712008dadc71c0c3e898b"
# Remove for >0.90.1; adds the option to build without lua (-DWITH_LUA=OFF)
patch do
url "https://github.com/openstreetmap/osm2pgsql/commit/dbbca884.patch"
sha256 "1efce5c8feeb3646450bee567582252b15634c7e139d4aa73058efbd8236fb60"
end
end
bottle do
sha256 "7f388ee56a6bf0d685434823d238ebbd8ca01e74320c862892e61e21b24b9a08" => :el_capitan
@ -11,41 +20,24 @@ class Osm2pgsql < Formula
sha256 "ef2655f802ca66c3cb137d80be9fcbe9fae64743c0f67c0b0e3944faddbc8913" => :mavericks
end
depends_on "cmake" => :build
depends_on :postgresql
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "boost"
depends_on "geos"
depends_on "proj"
depends_on "protobuf-c" => :recommended
depends_on "lua" => :recommended
def install
args = [
"--prefix=#{prefix}",
"--disable-dependency-tracking",
"--with-proj=#{Formula["proj"].opt_prefix}",
"--with-boost=#{Formula["boost"].opt_prefix}",
"--with-zlib=/usr",
"--with-bzip2=/usr",
]
puts args
if build.with? "protobuf-c"
args << "--with-protobuf-c=#{Formula["protobuf-c"].opt_prefix}"
args = std_cmake_args
args << "-DWITH_LUA=OFF" if build.without? "lua"
mkdir "build" do
system "cmake", "..", *args
system "make", "install"
end
# Mountain Lion has some problems with C++11.
# This is probably going to be a fatal issue for 0.89 and 0.90, but
# for now it can be worked around.
args << "--without-cxx11" if MacOS.version < :mavericks
system "./autogen.sh"
system "./configure", *args
system "make"
system "make", "install"
end
test do
assert_match "version #{version}",
shell_output("#{bin}/osm2pgsql -h 2>&1", 1)
assert_match version.to_s, shell_output("#{bin}/osm2pgsql -h 2>&1")
end
end