Skip to content

Commit f9664a2

Browse files
authored
Gettin' our bindeps2 on (#100)
* Use BinaryProvider for getting libmysql shared libraries
1 parent a0c23f6 commit f9664a2

File tree

9 files changed

+169
-74
lines changed

9 files changed

+169
-74
lines changed

.appveyor.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
environment:
2+
matrix:
3+
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.6/julia-0.6-latest-win32.exe"
4+
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.6/julia-0.6-latest-win64.exe"
5+
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe"
6+
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"
7+
8+
services:
9+
- mysql
10+
11+
branches:
12+
only:
13+
- master
14+
- /release-.*/
15+
16+
notifications:
17+
- provider: Email
18+
on_build_success: false
19+
on_build_failure: false
20+
on_build_status_changed: false
21+
22+
install:
23+
- ps: "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12"
24+
# if there's a newer build queued for the same PR, cancel this one
25+
- ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
26+
https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | `
27+
Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
28+
throw "There are newer queued builds for this pull request, failing early." }
29+
# Download most recent Julia Windows binary
30+
- ps: (new-object net.webclient).DownloadFile(
31+
$env:JULIA_URL,
32+
"C:\projects\julia-binary.exe")
33+
# Run installer silently, output to C:\projects\julia
34+
- C:\projects\julia-binary.exe /S /D=C:\projects\julia
35+
36+
build_script:
37+
# Need to convert from shallow to complete for Pkg.clone to work
38+
- IF EXIST .git\shallow (git fetch --unshallow)
39+
- C:\projects\julia\bin\julia -e "versioninfo();
40+
Pkg.clone(pwd(), \"MySQL\"); Pkg.build(\"MySQL\")"
41+
42+
test_script:
43+
- C:\projects\julia\bin\julia -e "Pkg.test(\"MySQL\")"

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,9 @@
3030

3131
# Debug files
3232
*.dSYM/
33+
34+
deps/deps.jl
35+
deps/usr/
36+
deps/mysql-connector*
37+
deps/downloads/
38+
deps/manifests/

.travis.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
language: julia
33

44
services:
5-
- mysql
5+
- mysql
66

77
os:
88
- linux
@@ -17,15 +17,16 @@ notifications:
1717

1818
after_success:
1919
# push coverage results to Coveralls
20-
- julia -e 'cd(Pkg.dir("MySQL")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'
20+
#- julia -e 'cd(Pkg.dir("MySQL")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'
2121
# push coverage results to Codecov
2222
- julia -e 'cd(Pkg.dir("MySQL")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())'
23+
2324
before_script:
24-
- export OLD_PATH=$LD_LIBRARY_PATH
25-
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`mysql_config --libs | cut -d ' ' -f1 | sed 's/-L//'`
26-
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install mysql ; fi
27-
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then mysql.server start ; fi
25+
- export OLD_PATH=$LD_LIBRARY_PATH
26+
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`mysql_config --libs | cut -d ' ' -f1 | sed 's/-L//'`
27+
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install mysql ; fi
28+
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then mysql.server start ; fi
2829

2930
after_script:
30-
- export LD_LIBRARY_PATH=$OLD_PATH
31-
- unset OLD_PATH
31+
- export LD_LIBRARY_PATH=$OLD_PATH
32+
- unset OLD_PATH

REQUIRE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ DataStreams
33
Compat 0.48.0
44
Missings
55
DecFP
6+
BinaryProvider

deps/build.jl

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
using BinaryProvider
2+
3+
# Parse some basic command-line arguments
4+
const verbose = "--verbose" in ARGS
5+
const prefix = Prefix(get([a for a in ARGS if a != "--verbose"], 1, joinpath(@__DIR__, "usr")))
6+
products = Product[
7+
LibraryProduct(prefix, String["libmariadb"], :libmariadb),
8+
]
9+
10+
# Download binaries from hosted location
11+
bin_prefix = "https://github.com/JuliaDatabases/MySQLBuilder/releases/download/v0.20"
12+
13+
# Listing of files generated by BinaryBuilder:
14+
download_info = Dict(
15+
BinaryProvider.Linux(:aarch64, :glibc) => ("$bin_prefix/MySQL.aarch64-linux-gnu.tar.gz", "d64387bb5fcaee52c3f5a826d49a9ed67b21799df44c77e0cb20bead1c72076a"),
16+
BinaryProvider.Linux(:armv7l, :glibc) => ("$bin_prefix/MySQL.arm-linux-gnueabihf.tar.gz", "413aa31791ddb88f074528fb0dabe5158a5aa72a92008aabbd440392dd3ec8ee"),
17+
BinaryProvider.Linux(:i686, :glibc) => ("$bin_prefix/MySQL.i686-linux-gnu.tar.gz", "c74e646ed02b91113bef5d51d81dd38600dbb91568679bdfdeebfeb3c455ad9c"),
18+
BinaryProvider.Linux(:powerpc64le, :glibc) => ("$bin_prefix/MySQL.powerpc64le-linux-gnu.tar.gz", "5c610ecacb736a41b2eba747192bbab95f54ff8a3622412c58308e2951d17dff"),
19+
BinaryProvider.MacOS() => ("$bin_prefix/MySQL.x86_64-apple-darwin14.tar.gz", "7980bed3b89fbf2f043a64871166df48d3c0b73436af9da0b2cd539a889daee5"),
20+
BinaryProvider.Linux(:x86_64, :glibc) => ("$bin_prefix/MySQL.x86_64-linux-gnu.tar.gz", "482a1abb9e594af99c7dd43ddf8898ab41192d2686aaf85535993e63ff6aafd5"),
21+
22+
BinaryProvider.Windows(:i686) => ("$bin_prefix/MySQL.i686-w64-mingw32.tar.gz", "8f391c46b412c51298192955840268b296a751a0b07e66ca7951cade27bdf667"),
23+
BinaryProvider.Windows(:x86_64) => ("$bin_prefix/MySQL.x86_64-w64-mingw32.tar.gz", "f80694f5bb756240fa04965c02c2820005bac9d452045c43f77bbc944236025f"),
24+
)
25+
26+
# First, check to see if we're all satisfied
27+
if any(!satisfied(p; verbose=verbose) for p in products)
28+
if haskey(download_info, platform_key())
29+
# Download and install binaries
30+
url, tarball_hash = download_info[platform_key()]
31+
install(url, tarball_hash; prefix=prefix, force=true, verbose=verbose)
32+
else
33+
# If we don't have a BinaryProvider-compatible .tar.gz to download, complain.
34+
# Alternatively, you could attempt to install from a separate provider,
35+
# build from source or something more even more ambitious here.
36+
error("Your platform $(Sys.MACHINE) is not supported by this package!")
37+
end
38+
end
39+
40+
# Write out a deps.jl file that will contain mappings for our products
41+
write_deps_file(joinpath(@__DIR__, "deps.jl"), products)

0 commit comments

Comments
 (0)