Skip to content

Commit

Permalink
Merge pull request #4 from IHPostal/feature/Add_build_script
Browse files Browse the repository at this point in the history
Added build script using BinDeps
  • Loading branch information
kmsquire committed Jul 28, 2015
2 parents 5a1f3e9 + d538d2e commit 380b5a3
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 17 deletions.
26 changes: 11 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
language: cpp
compiler:
- clang
language: julia
os:
- linux
- osx
julia:
- release
- nightly
notifications:
email: false
env:
matrix:
- JULIAVERSION="juliareleases"
- JULIAVERSION="julianightlies"
before_install:
- sudo add-apt-repository ppa:staticfloat/julia-deps -y
- sudo add-apt-repository ppa:staticfloat/${JULIAVERSION} -y
- sudo apt-get update -qq -y
- sudo apt-get install libpcre3-dev julia -y
- if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
script:
- julia -e 'Pkg.init(); Pkg.clone(pwd()); Pkg.test("VLFeat")'
# uncomment the following lines to override the default test script
#script:
# - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
# - julia --check-bounds=yes -e 'Pkg.clone(pwd()); Pkg.build("FooBar"); Pkg.test("VLFeat"; coverage=true)'
4 changes: 4 additions & 0 deletions REQUIRE
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
julia 0.3 0.4
BinDeps
Compat
Images
4 changes: 4 additions & 0 deletions deps/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
downloads/
src/
usr/
deps.jl
28 changes: 28 additions & 0 deletions deps/build.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using BinDeps
using Compat

@BinDeps.setup

const version = "0.9.20"

libvl = library_dependency("libvl", aliases = ["vl"])

provides(Sources, URI("http://www.vlfeat.org/download/vlfeat-$version.tar.gz"), libvl)

src = joinpath(srcdir(libvl), "vlfeat-$version")
usr = usrdir(libvl)
shlib_ext = BinDeps.shlib_ext
arch = OS_NAME == :Linux ? "glnxa64" : OS_NAME == :Darwin ? "maci64" : "*"
provides(BuildProcess,
(@build_steps begin
GetSources(libvl)
@build_steps begin
FileRule(joinpath(usr, "lib", "libvl."*shlib_ext), @build_steps begin
MakeTargets(src, ["all"]; env = @compat Dict("MEX" => ""))
CreateDirectory(libdir(libvl))
`cp -a $src/bin/$arch/libvl.$shlib_ext $usr/lib`
end)
end
end), libvl, os = :Unix)

@BinDeps.install @compat Dict(:libvl => :libvl)
10 changes: 8 additions & 2 deletions src/VLFeat.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
module VLFeat
using Images
using BinDeps

export vl_hog
depsfile = Pkg.dir("VLFeat","deps","deps.jl")
if isfile(depsfile)
include(depsfile)
else
error("VLFeat not properly installed. Please run Pkg.build(\"VLFeat\")")
end

const libvl=:libvl
export vl_hog

include("libvl/LIBVL.jl")
include("hog.jl")
Expand Down

0 comments on commit 380b5a3

Please sign in to comment.