diff --git a/.travis.yml b/.travis.yml index 40c5b88..0f80755 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ sudo: required dist: trusty os: - linux - - osx + # - osx julia: - 0.5 - nightly diff --git a/REQUIRE b/REQUIRE index 84c6b26..a35b54a 100644 --- a/REQUIRE +++ b/REQUIRE @@ -1,3 +1,4 @@ julia 0.5 BinDeps 0.4.0 @osx Homebrew 0.3.0 +@windows WinRPM 0.2.0 diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..5cab910 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,38 @@ +environment: + matrix: + # - JULIAVERSION: "julialang/bin/winnt/x86/0.5/julia-0.5-latest-win32.exe" + - JULIAVERSION: "julialang/bin/winnt/x64/0.5/julia-0.5-latest-win64.exe" + # - JULIAVERSION: "julianightlies/bin/winnt/x86/julia-latest-win32.exe" + # - JULIAVERSION: "julianightlies/bin/winnt/x64/julia-latest-win64.exe" + +branches: + only: + - master + +notifications: + - provider: Email + on_build_success: false + on_build_failure: false + on_build_status_changed: false + +install: +# If there's a newer build queued for the same PR, cancel this one + - ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod ` + https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | ` + Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { ` + throw "There are newer queued builds for this pull request, failing early." } +# Download most recent Julia Windows binary + - ps: (new-object net.webclient).DownloadFile( + $("http://s3.amazonaws.com/"+$env:JULIAVERSION), + "C:\projects\julia-binary.exe") +# Run installer silently, output to C:\projects\julia + - C:\projects\julia-binary.exe /S /D=C:\projects\julia + +build_script: +# Need to convert from shallow to complete for Pkg.clone to work + - IF EXIST .git\shallow (git fetch --unshallow) + - C:\projects\julia\bin\julia -F -e "versioninfo(); + Pkg.clone(pwd(), \"LCMCore\"); using BinDeps; println(BinDeps.debug(\"LCMCore\")); Pkg.build(\"LCMCore\")" + +test_script: + - C:\projects\julia\bin\julia -e "Pkg.test(\"LCMCore\")" \ No newline at end of file diff --git a/deps/build.jl b/deps/build.jl index 3fc0103..e229d5c 100644 --- a/deps/build.jl +++ b/deps/build.jl @@ -38,10 +38,18 @@ lcm_cmake_arguments = String[] using Homebrew provides(Homebrew.HB, "glib", glib, os=:Darwin) push!(lcm_cmake_arguments, - "-DCMAKE_LIBRARY_PATH=$(joinpath(Pkg.dir("Homebrew"), "deps", "usr", "lib"))") + "-DCMAKE_PREFIX_PATH=$(joinpath(Pkg.dir("Homebrew"), "deps", "usr"))") +elseif is_windows() + using WinRPM + win_prefix = joinpath(Pkg.dir("WinRPM"), "deps", "usr", + "$(Sys.ARCH)-w64-mingw32", + "sys-root", + "mingw") push!(lcm_cmake_arguments, - "-DCMAKE_INCLUDE_PATH=$(joinpath(Pkg.dir("Homebrew"), "deps", "usr", "include"))") - + "-DCMAKE_PREFIX_PATH=$(win_prefix)") + push!(lcm_cmake_arguments, + "-DCMAKE_LIBRARY_PATH=$(joinpath(win_prefix, "bin"))") + provides(WinRPM.RPM, "glib-dev", [glib], os=:Windows) end provides(Yum, @@ -65,6 +73,14 @@ lcm_cmake_command = `$lcm_cmake_command $lcm_srcdir` provides(BuildProcess, (@build_steps begin + () -> begin + path = joinpath(Pkg.dir("WinRPM"), "deps", "usr") + for element in ["$(Sys.ARCH)-w64-mingw32", "sys-root", "mingw", "bin"] + path = joinpath(path, element) + @show path + @show readdir(path) + end + end GetSources(lcm) CreateDirectory(lcm_builddir) @build_steps begin @@ -78,4 +94,13 @@ provides(BuildProcess, const lcm_prefix = "$prefix" """) +# Hack inspired by https://github.com/JuliaLang/BinDeps.jl/issues/55 +@static if is_windows() + push!(BinDeps.defaults, BuildProcess) +end + @BinDeps.install Dict(:lcm => :liblcm) + +@static if is_windows() + pop!(BinDeps.defaults) +end