Skip to content

Commit

Permalink
[WIP] Add Linux (x86/x64) library installation, fix #2 (#23)
Browse files Browse the repository at this point in the history
* Modify build script for all linux
  • Loading branch information
samuelpowell authored Oct 7, 2018
1 parent 84e0274 commit f609e48
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Documentation: http://docs.travis-ci.com/user/languages/julia/
language: julia
os:
# - linux
- linux
- osx
julia:
- 0.6
Expand Down
22 changes: 12 additions & 10 deletions deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,31 +54,33 @@ provides(BuildProcess,

# Linux
#
libFTD2XX_glx_dir = joinpath(@__DIR__, "usr", "lib")

# ARMv7 hard float, 32-bit
libFTD2XX_glx_armv7hf_URI = URI("https://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx-arm-v7-hf-1.4.8.gz")
libFTD2XX_glx_armv8hf_URI = URI("https://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx-arm-v8-1.4.8.gz")
libFTD2XX_glx_x86_URI = URI("https://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx-i386-1.4.8.gz")
libFTD2XX_glx_x64_URI = URI("https://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx-x86_64-1.4.8.gz")
libFTD2XX_glx_dir = joinpath(@__DIR__, "usr", "lib")

if (Sys.ARCH == :arm) && (Sys.MACHINE == "arm-linux-gnueabihf")
if Compat.Sys.islinux()

if (Sys.ARCH == :arm) && (Sys.MACHINE == "arm-linux-gnueabihf")
libFTD2XX_glx_URI = (Sys.WORD_SIZE == 32) ? libFTD2XX_glx_armv7hf_URI : libFTD2XX_glx_armv8hf_URI
else
libFTD2XX_glx_URI = (Sys.WORD_SIZE == 32) ? libFTD2XX_glx_x86_URI : libFTD2XX_glx_x64_URI
end

# Driver layout is identical for ARMv7 and v8, so just choose the correct download
libFTD2XX_glx_arm_URI = (Sys.WORD_SIZE == 32) ? libFTD2XX_glx_armv7hf_URI : libFTD2XX_glx_armv8hf_URI

provides(BuildProcess,
(@build_steps begin
CreateDirectory(libFTD2XX_glx_dir)
CreateDirectory(download_dir)
FileDownloader(string(libFTD2XX_glx_armv7hf_URI), joinpath(download_dir, "libftd2xx-arm.gz"))
FileDownloader(string(libFTD2XX_glx_URI), joinpath(download_dir, "libftd2xx.gz"))
FileRule(joinpath(libFTD2XX_glx_dir, "libftd2xx.so.1.4.8"), @build_steps begin
`./build_glx_arm.sh`
`./build_glx.sh`
end)
end), libFTD2XX, installed_libpath = joinpath(@__DIR__, "usr", "lib"), os = :Linux)

# BinDeps doesn't do something sensible with .gz, so the following approach fails
# provides(Binaries, libFTD2XX_glx_armv7hf_URI, libFTD2XX, #unpacked_dir = ".",
# installed_libpath = joinpath(@__DIR__, "release", "build"), os = :Linux)

end


Expand Down
2 changes: 1 addition & 1 deletion deps/build_glx_arm.sh → deps/build_glx.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

cd downloads
tar -zxvf ./libftd2xx-arm.gz
tar -zxvf ./libftd2xx.gz
mv release/build/* ../usr/lib/
rm -rf release

0 comments on commit f609e48

Please sign in to comment.