Skip to content

Instantly share code, notes, and snippets.

@MaZderMind
Forked from christoph-buente/osmium.rb
Created April 26, 2012 14:57
Show Gist options
  • Save MaZderMind/2500156 to your computer and use it in GitHub Desktop.
Save MaZderMind/2500156 to your computer and use it in GitHub Desktop.
Osmium Homebrew formula
require 'formula'
class Osmium < Formula
head 'https://github.com/joto/osmium.git'
homepage 'http://wiki.openstreetmap.org/wiki/Osmium'
md5 'dce9eb59d86caf1186fc93567b94feed'
depends_on 'boost'
depends_on 'lzlib'
depends_on 'shapelib'
depends_on 'expat'
depends_on 'geos'
depends_on 'protobuf'
depends_on 'v8'
depends_on 'icu4c'
depends_on 'google-sparsehash'
depends_on 'osm-pbf'
depends_on 'libgd'
depends_on 'doxygen'
depends_on 'gdal'
skip_clean :all
def install
cd 'osmjs' do
icu = Formula.factory("icu4c")
ENV['CPLUS_INCLUDE_PATH'] = icu.include
ENV['LIBRARY_PATH'] = icu.lib
system "make"
bin.install 'osmjs'
end
cd 'examples' do
system "make"
bin.install 'osmium_convert'
bin.install 'osmium_debug'
bin.install 'osmium_store_and_debug'
bin.install 'osmium_find_bbox'
bin.install 'osmium_progress'
bin.install 'osmium_range_from_history'
bin.install 'osmium_sizeof'
bin.install 'osmium_stats'
bin.install 'osmium_time'
bin.install 'osmium_toogr'
bin.install 'osmium_toogr2'
bin.install 'osmium_toshape'
bin.install 'nodedensity'
end
system "make doc"
include.install Dir['include/*']
doc.install Dir['doc/*']
end
end
@christoph-buente
Copy link

You're right, it is. At least we got osmium up and running, so i can start playing with it :)

@christoph-buente
Copy link

Does it really compile? I get an compile error now:

g++ -g -Wall -Wextra -Wredundant-decls -Wdisabled-optimization -pedantic -Wctor-dtor-privacy -Wnon-virtual-dtor -Woverloaded-virtual -Wsign-promo -Wno-long-long -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I../include -o nodedensity nodedensity.cpp -L/usr/local/lib -lexpat -lpthread -lz -lprotobuf-lite -losmpbf -lgd -lz -lm
nodedensity.cpp:25:16: error: gd.h: No such file or directory
In file included from /usr/local/Cellar/geos/3.3.3/include/geos/geom/GeometryFactory.h:26,
from ../include/osmium/geometry_factory.hpp:4,
from ../include/osmium.hpp:109,
from osmium_toshape.cpp:30:
/usr/local/Cellar/geos/3.3.3/include/geos/geom/MultiPoint.h: In copy constructor ‘geos::geom::MultiPoint::MultiPoint(const geos::geom::MultiPoint&)’:
/usr/local/Cellar/geos/3.3.3/include/geos/geom/MultiPoint.h:112: warning: base class ‘class geos::geom::Puntal’ should be explicitly initialized in the copy constructor
In file included from /usr/local/Cellar/geos/3.3.3/include/geos/geom/GeometryFactory.h:26,
from ../include/osmium/geometry_factory.hpp:4,
from ../include/osmium.hpp:109,
from osmium_toogr2.cpp:35:
/usr/local/Cellar/geos/3.3.3/include/geos/geom/MultiPoint.h: In copy constructor ‘geos::geom::MultiPoint::MultiPoint(const geos::geom::MultiPoint&)’:
/usr/local/Cellar/geos/3.3.3/include/geos/geom/MultiPoint.h:112: warning: base class ‘class geos::geom::Puntal’ should be explicitly initialized in the copy constructor
nodedensity.cpp: In member function ‘void NodeDensityHandler::after_nodes()’:
nodedensity.cpp:80: error: ‘gdImagePtr’ was not declared in this scope
nodedensity.cpp:80: error: expected `;' before ‘im’
nodedensity.cpp:83: error: ‘im’ was not declared in this scope
nodedensity.cpp:83: error: ‘gdImageColorAllocate’ was not declared in this scope
nodedensity.cpp:92: error: ‘im’ was not declared in this scope
nodedensity.cpp:92: error: ‘gdImageSetPixel’ was not declared in this scope
nodedensity.cpp:96: error: ‘im’ was not declared in this scope
nodedensity.cpp:96: error: ‘gdImagePng’ was not declared in this scope
nodedensity.cpp:97: error: ‘gdImageDestroy’ was not declared in this scope
make: *** [nodedensity] Error 1

@MaZderMind
Copy link
Author

MaZderMind commented Apr 26, 2012 via email

@christoph-buente
Copy link

Sweet: depends_on 'libgd' did the trick. Thx!

@MaZderMind
Copy link
Author

you can refer to https://github.com/MaZderMind/osmium/tarball/2012.04.27 as a versioned url. Because I'm not the repo-owner I won't introduce a versioning scheme but instead use the current date to specify a tag.

@christoph-buente
Copy link

@MaZderMind Hey, my pull request to osm-pbf was accepted. Would you mind to create a new formula pull request for osmium?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment