Skip to content

Commit f882a4b

Browse files
committed
Merge pull request #7 from JuliaGeo/bindeps
Provide build script
2 parents cfdc154 + 20f58c2 commit f882a4b

File tree

6 files changed

+89
-1
lines changed

6 files changed

+89
-1
lines changed

.travis.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
language: julia
2+
os:
3+
- osx
4+
- linux
5+
julia:
6+
- release
7+
- nightly
8+
notifications:
9+
email: false
10+
script:
11+
- if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
12+
- julia -e 'Pkg.clone(pwd()); Pkg.build("LibGEOS"); Pkg.test("LibGEOS"; coverage=true)'
13+
after_success:
14+
- julia -e 'cd(Pkg.dir("LibGEOS")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())';

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
LibGEOS.jl
22
==========
3+
34
LibGEOS is a LGPL-licensed package for manipulation and analysis of planar geometric objects, based on the libraries [GEOS](https://trac.osgeo.org/geos/) (the engine of PostGIS) and JTS (from which GEOS is ported).
45

56
Among other things, it allows you to parse [Well-known Text (WKT)](https://en.wikipedia.org/wiki/Well-known_text)

REQUIRE

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
julia 0.3
22
GeoInterface
3+
BinDeps
4+
@osx Homebrew
35
Compat
6+
@windows WinRPM

appveyor.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
environment:
2+
matrix:
3+
- JULIAVERSION: "julialang/bin/winnt/x86/0.3/julia-0.3-latest-win32.exe"
4+
- JULIAVERSION: "julialang/bin/winnt/x64/0.3/julia-0.3-latest-win64.exe"
5+
- JULIAVERSION: "julianightlies/bin/winnt/x86/julia-latest-win32.exe"
6+
- JULIAVERSION: "julianightlies/bin/winnt/x64/julia-latest-win64.exe"
7+
8+
branches:
9+
only:
10+
- master
11+
- /release-.*/
12+
13+
notifications:
14+
- provider: Email
15+
on_build_success: false
16+
on_build_failure: false
17+
on_build_status_changed: false
18+
19+
install:
20+
# Download most recent Julia Windows binary
21+
- ps: (new-object net.webclient).DownloadFile(
22+
$("http://s3.amazonaws.com/"+$env:JULIAVERSION),
23+
"C:\projects\julia-binary.exe")
24+
# Run installer silently, output to C:\projects\julia
25+
- C:\projects\julia-binary.exe /S /D=C:\projects\julia
26+
27+
build_script:
28+
# Need to convert from shallow to complete for Pkg.clone to work
29+
- IF EXIST .git\shallow (git fetch --unshallow)
30+
- C:\projects\julia\bin\julia -e "versioninfo();
31+
Pkg.clone(pwd(), \"LibGEOS\"); Pkg.build(\"LibGEOS\")"
32+
33+
test_script:
34+
- C:\projects\julia\bin\julia --check-bounds=yes -e "Pkg.test(\"LibGEOS\")"

deps/build.jl

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
using BinDeps, Compat
2+
@BinDeps.setup
3+
4+
libgeos = library_dependency("libgeos",aliases=["libgeos_c", "libgeos_c-1"], validate = function(path, handle)
5+
return @compat(Libdl.dlsym_e(handle,:initGEOS)) != C_NULL && @compat(Libdl.dlsym_e(handle,:GEOSDelaunayTriangulation)) != C_NULL
6+
end)
7+
8+
version = "3.4.2"
9+
10+
provides(Sources, URI("http://download.osgeo.org/geos/geos-$(version).tar.bz2"), [libgeos], os = :Unix)
11+
provides(BuildProcess,Autotools(libtarget = "capi/.libs/libgeos_c."*BinDeps.shlib_ext),libgeos)
12+
# provides(AptGet,"libgeos-dev", libgeos)
13+
# TODO: provides(Yum,"libgeos-dev", libgeos)
14+
# TODO: provides(Pacman,"libgeos-dev", libgeos)
15+
16+
@windows_only begin
17+
using WinRPM
18+
push!(WinRPM.sources, "http://download.opensuse.org/repositories/home:yeesian/openSUSE_13.1")
19+
push!(WinRPM.sources, "http://download.opensuse.org/repositories/home:yeesian/windows_mingw_win32_openSUSE_13.1")
20+
WinRPM.update()
21+
provides(WinRPM.RPM, "libgeos", [libgeos], os = :Windows)
22+
end
23+
24+
@osx_only begin
25+
if Pkg.installed("Homebrew") === nothing
26+
error("Homebrew package not installed, please run Pkg.add(\"Homebrew\")")
27+
end
28+
using Homebrew
29+
provides(Homebrew.HB, "geos", libgeos, os = :Darwin)
30+
end
31+
32+
@BinDeps.install @compat Dict(:libgeos => :libgeos)

src/LibGEOS.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
module LibGEOS
22

3-
@unix_only const libgeos = "libgeos_c"
3+
if isfile(joinpath(dirname(@__FILE__),"..","deps","deps.jl"))
4+
include("../deps/deps.jl")
5+
else
6+
error("LibGEOS not properly installed. Please run Pkg.build(\"LibGEOS\")")
7+
end
48

59
using Compat, GeoInterface
610

0 commit comments

Comments
 (0)