Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions recipes/libosmium/build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
@echo off
setlocal enabledelayedexpansion

mkdir build
if errorlevel 1 exit /b 1

cd build
if errorlevel 1 exit /b 1

cmake %CMAKE_ARGS% ^
-GNinja ^
-DWERROR=OFF ^
-DCMAKE_PREFIX_PATH=%PREFIX% ^
-DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
%SRC_DIR%
if errorlevel 1 exit /b 1

ninja
if errorlevel 1 exit /b 1

ninja install
if errorlevel 1 exit /b 1
17 changes: 17 additions & 0 deletions recipes/libosmium/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#! /bin/bash
set -e

extra_cmake_args=(
-GNinja
-DWERROR=OFF
)

mkdir build && cd build

cmake ${CMAKE_ARGS} "${extra_cmake_args[@]}" \
-DCMAKE_PREFIX_PATH=$PREFIX \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
$SRC_DIR

ninja
ninja install
11 changes: 11 additions & 0 deletions recipes/libosmium/cmake_minimum_version.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,7 +6,7 @@
#
#-----------------------------------------------------------------------------

-cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")


52 changes: 52 additions & 0 deletions recipes/libosmium/recipe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
context:
version: "2.22.0"

package:
name: libosmium
version: ${{ version }}

source:
- url: https://github.com/osmcode/libosmium/archive/refs/tags/v${{ version }}.tar.gz
sha256: 8f74e3f6ba295baa7325ae5606e8f74ad9056f1d6ab4555c50bff6aa8246f366
patches:
- cmake_minimum_version.patch

build:
number: 0

requirements:
build:
- ${{ compiler('cxx') }}
# - ${{ stdlib('c') }}
- cmake
- ninja

host:
- libboost-headers
- expat
- protozero
- bzip2
- zlib

run:
- libboost-headers
- protozero

tests:

about:
homepage: https://osmcode.org/libosmium/
license: BSL-1.0
license_file:
- LICENSE
summary: Fast and flexible C++ library for working with OpenStreetMap data.
description: |
The Osmium Library has extensive support for all types of OSM entities: nodes, ways, relations,
and changesets. It allows reading from and writing to OSM files in XML, PBF, and several other
formats, including change files and full history files.
documentation: https://github.com/mapbox/libosmium
repository: https://github.com/mapbox/libosmium

extra:
recipe-maintainers:
- travishathaway
32 changes: 32 additions & 0 deletions recipes/osm2pgsql/build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
setlocal EnableDelayedExpansion

set BUILD_DIR=build

cd %SRC_DIR%

if exist %BUILD_DIR% rmdir /s /q %BUILD_DIR%
mkdir %BUILD_DIR%

if exist osm2pgsql\contrib rmdir /s /q osm2pgsql\contrib

cmake -S osm2pgsql ^
-B %BUILD_DIR% ^
-G "Ninja" ^
-D CMAKE_BUILD_TYPE=Release ^
-D EXTERNAL_LIBOSMIUM=ON ^
-D EXTERNAL_FMT=ON ^
-D EXTERNAL_CLI11=ON ^
-D EXTERNAL_PROTOZERO=ON ^
-D OSMIUM_INCLUDE_DIR=libosmium\include ^
-D PROTOZERO_INCLUDE_DIR=protozero\include ^
-D CMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%"

if errorlevel 1 exit 1

cmake --build %BUILD_DIR% --target all

if errorlevel 1 exit 1

cmake --build %BUILD_DIR% --target install

if errorlevel 1 exit 1
32 changes: 32 additions & 0 deletions recipes/osm2pgsql/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env bash
set -e

BUILD_DIR="build"

# osx-64 compatibility (https://conda-forge.org/docs/maintainer/knowledge_base/#newer-c-features-with-old-sdk)
export CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY"

cd ${SRC_DIR}

mkdir -p ${BUILD_DIR}

rm -rf "osm2pgsql/contrib/"

cmake ${CMAKE_ARGS} -S osm2pgsql \
-B ${BUILD_DIR} \
-G "Ninja" \
-D CMAKE_BUILD_TYPE=Release \
-D EXTERNAL_LIBOSMIUM=ON \
-D EXTERNAL_FMT=ON \
-D EXTERNAL_CLI11=ON \
-D EXTERNAL_PROTOZERO=ON \
-D OSMIUM_INCLUDE_DIR=libosmium/include \
-D PROTOZERO_INCLUDE_DIR=protozero/include \
-D CMAKE_INSTALL_PREFIX="${PREFIX}"


cmake --build ${BUILD_DIR} --target all

cmake --build ${BUILD_DIR} --target install


66 changes: 66 additions & 0 deletions recipes/osm2pgsql/recipe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
context:
osm2pgsql_version: "2.2.0"
libosmium_version: "2.22.0"
protozero_version: "1.8.1"

package:
name: osm2pgsql
version: ${{ osm2pgsql_version }}

source:
- url: https://github.com/osm2pgsql-dev/osm2pgsql/archive/refs/tags/${{ osm2pgsql_version }}.tar.gz
sha256: 567dad078f8a66d6d706ac1876b5251b688109d16974909d89ce2056d6e9f258
target_directory: osm2pgsql

- url: https://github.com/osmcode/libosmium/archive/refs/tags/v${{ libosmium_version }}.tar.gz
sha256: 8f74e3f6ba295baa7325ae5606e8f74ad9056f1d6ab4555c50bff6aa8246f366
target_directory: libosmium

- url: https://github.com/mapbox/protozero/archive/refs/tags/v${{ protozero_version }}.tar.gz
sha256: 6c7a896f1dc08435e8cd4f3780ff688cd0bfce6890599b755f6f3cb36398dc25
target_directory: protozero

build:
number: 0

requirements:
build:
- ${{ compiler('cxx') }}
- ${{ stdlib('c') }}
- cmake
- ninja
- pkg-config

host:
- libboost-devel
- catch2
- cli11
- expat
- fmt <12
- proj
- bzip2
- zlib
- postgresql
- nlohmann_json
- lua

tests:
- script:
- osm2pgsql --version
- osm2pgsql --help

about:
homepage: https://osm2pgsql.org
license: GPL-2.0-only
license_file:
- osm2pgsql/COPYING
- libosmium/LICENSE
- protozero/LICENSE.md
summary: Import OpenStreetMap data into a PostgreSQL/PostGIS database
description: osm2pgsql is a tool for loading OpenStreetMap data into a PostgreSQL / PostGIS database suitable for applications like rendering into a map, geocoding with Nominatim, or general analysis.
documentation: https://osm2pgsql.org
repository: https://github.com/osm2pgsql-dev/osm2pgsql

extra:
recipe-maintainers:
- travishathaway
Loading