Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrap PROJ 7.2.0 #47

Merged
merged 4 commits into from
Jan 3, 2021
Merged
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
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
*.jl.*.cov
*.jl.cov
*.jl.mem
deps/build.log
deps/deps.jl
deps/usr
/Manifest.toml
/gen/doxygen.xml
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name = "Proj4"
uuid = "9a7e659c-8ee8-5706-894e-f68f43bc57ea"
version = "0.7.2"
version = "0.7.3"

[deps]
CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82"
PROJ_jll = "58948b4f-47e0-5654-a9ad-f609743f8632"

[compat]
CEnum = "0.2, 0.3, 0.4"
PROJ_jll = "6.2.1, 7"
PROJ_jll = "7.2"
julia = "1.3"

[extras]
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Proj4.jl

[![Build status](https://travis-ci.com/JuliaGeo/Proj4.jl.svg?branch=master)](https://travis-ci.com/JuliaGeo/Proj4.jl)
[![Build status](https://ci.appveyor.com/api/projects/status/tscgm13l1pvajqqa/branch/master?svg=true)](https://ci.appveyor.com/project/JuliaGeo/proj4-jl/branch/master)
[![CI](https://github.com/JuliaGeo/Proj4.jl/workflows/CI/badge.svg)](https://github.com/JuliaGeo/Proj4.jl/actions?query=workflow%3ACI)

A simple Julia wrapper around the [PROJ](https://proj.org/) cartographic projections library.

Expand Down
5 changes: 5 additions & 0 deletions gen/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[deps]
Clang = "40e3b903-d033-50b4-a0cc-940c62c95e31"
EzXML = "8f5d6c58-4d21-5cfd-889c-e3ad7ee6a615"
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
PROJ_jll = "58948b4f-47e0-5654-a9ad-f609743f8632"
20 changes: 11 additions & 9 deletions gen/wrap_proj.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
#=
Run this file to regenerate `proj_c.jl` and `proj_common.jl`.

It expects a PROJ install in the deps folder, run `build Proj4` in Pkg mode
if these are not in place.

The wrapped PROJ version and provided PROJ version should be kept in sync.
So when updating the PROJBuilder provided version, also rerun this wrapper.
So when updating the provided PROJ_jll version, also rerun this wrapper.
This way we ensure that the provided library has the same functions available
as the wrapped one. Furthermore this makes sure constants in `proj_common.jl`
like `PROJ_VERSION_PATCH`, which are just literals, are correct.
Expand All @@ -19,11 +16,17 @@ Several custom transformations are applied that should make using this package m
These transformations are based on the code developed for GDAL.jl, see
https://github.com/JuliaGeo/GDAL.jl/blob/master/gen/README.md for more information
on how to construct the PROJ Doxygen XML file needed here.

If Doxygen gives errors, it helps to turn off Latex and HTML output:
GENERATE_LATEX = NO
GENERATE_HTML = NO
GENERATE_XML = YES
=#

using Clang # needs a post 0.9.1 release with #231 and #232
using Clang
using MacroTools
using EzXML
using PROJ_jll

const xmlpath = joinpath(@__DIR__, "doxygen.xml")

Expand Down Expand Up @@ -66,7 +69,7 @@ function keywordify!(fargs2, argpos, i)
return nothing
else
arg = fargs2[i]
fargs2[i] = :($arg = C_NULL)
fargs2[i] = Expr(:kw, arg, :C_NULL)
# in optpos is does not have to be at i anymore if it already was moved
argoptpos = findfirst(==(i), argpos)
splice!(argpos, argoptpos)
Expand Down Expand Up @@ -129,11 +132,10 @@ function rewriter(x::Expr)
end
end

# parse GDAL's Doxygen XML file
# parse PROJ's Doxygen XML file
const doc = readxml(xmlpath)

# should be here if you pkg> build Proj4
includedir = normpath(joinpath(@__DIR__, "..", "deps", "usr", "include"))
includedir = joinpath(PROJ_jll.artifact_dir, "include")
headerfiles = [joinpath(includedir, "proj.h")]

wc = init(; headers = headerfiles,
Expand Down
Loading