Skip to content

Commit

Permalink
Move to libserialport_jll dependency (#43)
Browse files Browse the repository at this point in the history
* move to JLL dependency for libserialport (V1.3+)

* tidy

* travis update: add windows, limit to 1.3+

* add arm64 arch & exclude incompatible

* Update .travis.yml

* fix nettle typo

* try different permissions fix on linux

* add compat julia 1.3
  • Loading branch information
IanButterworth authored Nov 27, 2019
1 parent 6ee67bf commit db2aa97
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 79 deletions.
34 changes: 23 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,36 @@ language: julia
os:
- linux
- osx
- windows
arch:
- x64
- x86
- arm64
julia:
# - release
- 0.7
- 1.0
- 1.1
- 1.3
- nightly
## uncomment the following lines to allow failures on nightly julia
## (tests will run but not make your overall status red)
before_install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo chmod 666 /dev/tty*; fi
matrix:
allow_failures:
- julia: nightly
- julia: nightly
exclude:
- os: osx
arch: x86
- os: osx
arch: arm64
- os: windows
arch: arm64
- julia: nightly
arch: arm64

before_install:
# - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo chmod 666 /dev/tty*; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo usermod -a -G dialout $USER; fi

notifications:
email: false
# uncomment the following lines to override the default test script
#script:
# - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
# - julia -e 'Pkg.clone(pwd()); Pkg.build("LibSerialPort"); Pkg.test("LibSerialPort"; coverage=true)'
# Documenter auto-deploy
# following `using` instruction is for triggering precompilation
# Documenter auto-deploy
# following `using` instruction is for triggering precompilation
13 changes: 9 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@ uuid = "a05a14c7-6e3b-5ba9-90a2-45558833e1df"
version = "0.2.0"

[deps]
BinDeps = "9e28174c-4ba2-5203-b857-d8d62c4213ee"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
libserialport_jll = "220460dc-b50e-5ed0-8176-09b0fd261e90"

[compat]
julia = "1"
BinDeps = "0.8"
julia = "1.3"
libserialport_jll = "0.1.1"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]
15 changes: 0 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,10 @@

Apart from a very few non-essential functions, the entire library API (about 75 functions) is wrapped using `ccall`. In addition, a higher-level interface is also provided that follows Julia's IO stream interface.


## Dependencies

[BinDeps.jl](https://github.com/JuliaLang/BinDeps.jl) is required, as well as standard tools for building the C library (make, gcc/clang, etc).


## Installation

pkg> add LibSerialPort

To install the C library, use `Pkg.build`:

pkg> build LibSerialPort

On Unix-like systems, `libserialport` will be built from source. On Windows a pre-built shared library is downloaded and installed into the package directory. Alternatively, follow the [build instructions](http://sigrok.org/wiki/Libserialport) for a system-wide build. If installation through the package system succeeded, then

julia> readdir(joinpath(Pkg.dir("LibSerialPort"), "deps/usr/lib"))

should list your new library.

## Usage

Expand Down
32 changes: 0 additions & 32 deletions deps/build.jl

This file was deleted.

21 changes: 4 additions & 17 deletions src/LibSerialPort.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@

module LibSerialPort

using Libdl
using libserialport_jll

export
# Enum types
SPReturn,
Expand Down Expand Up @@ -173,23 +176,7 @@ export
seteof,
reseteof

const depsdir = joinpath(dirname(dirname(@__FILE__)), "deps")
const depsfile = joinpath(depsdir, "deps.jl")
if isfile(depsfile)
include(depsfile)

# This is supposed to address runtime linking problems.
# Exporting environment variables like (DY)LD_LIBRARY_PATH works,
# but this is a more self-contained and portable solution.
libdir = joinpath(depsdir, "usr/lib")
if !in(libdir, DL_LOAD_PATH)
push!(DL_LOAD_PATH, libdir)
end
else
error("LibSerialPort not properly installed. Please run Pkg.build(\"LibSerialPort\")")
end

include("wrap.jl")
include("high-level-api.jl")

end # LibSerialPort
end # LibSerialPort

0 comments on commit db2aa97

Please sign in to comment.