Skip to content

Commit

Permalink
use Bzip2_jll instead of deps/build.jl (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanKarpinski authored Mar 13, 2020
1 parent 4b96230 commit b7775b2
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 75 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ os:
- linux
- osx
julia:
- 1.0
- 1.1
- 1.3
- 1.4
- nightly
matrix:
allow_failures:
Expand Down
6 changes: 4 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@ name = "CodecBzip2"
uuid = "523fee87-0ab8-5b00-afb7-3ecf72e48cfd"
license = "MIT"
authors = ["Kenta Sato <[email protected]>"]
version = "0.6.0"
version = "0.7.0"

[deps]
BinaryProvider = "b99e7846-7c00-51b0-8f62-c81ae34c0232"
Bzip2_jll = "6e34b625-4abd-537c-b88f-471c36dfa7a0"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
TranscodingStreams = "3bb67fe8-82b1-5028-8e26-92a6c54297fa"

[compat]
BinaryProvider = "0.5"
Bzip2_jll = "1.0.6"
TranscodingStreams = "0.9"
julia = "1"
julia = "1.3"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
environment:
matrix:
- julia_version: 1.0
- julia_version: 1.1
- julia_version: 1.3
- julia_version: 1.4
- julia_version: latest

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

This file was deleted.

11 changes: 3 additions & 8 deletions src/CodecBzip2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,11 @@ import TranscodingStreams:
initialize,
finalize,
splitkwargs
using Libdl

const libbz2path = joinpath(dirname(@__FILE__), "..", "deps", "deps.jl")
if !isfile(libbz2path)
error("CodecBzip2.jl is not installed properly, run Pkg.build(\"CodecBzip2\") and restart Julia.")
end
include(libbz2path)
check_deps()
import Bzip2_jll:
libbzip2

include("libbz2.jl")
include("libbzip2.jl")
include("compression.jl")
include("decompression.jl")

Expand Down
26 changes: 13 additions & 13 deletions src/libbz2.jl → src/libbzip2.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# The libbz2 Interfaces
# The libbzip2 Interfaces
# =====================

const WIN32 = Sys.iswindows() && Sys.WORD_SIZE == 32
Expand Down Expand Up @@ -60,14 +60,14 @@ function compress_init!(stream::BZStream,
workfactor::Integer)
if WIN32
return ccall(
("BZ2_bzCompressInit@16", libbz2),
("BZ2_bzCompressInit@16", libbzip2),
stdcall,
Cint,
(Ref{BZStream}, Cint, Cint, Cint),
stream, blocksize100k, verbosity, workfactor)
else
return ccall(
(:BZ2_bzCompressInit, libbz2),
(:BZ2_bzCompressInit, libbzip2),
Cint,
(Ref{BZStream}, Cint, Cint, Cint),
stream, blocksize100k, verbosity, workfactor)
Expand All @@ -77,14 +77,14 @@ end
function compress_end!(stream::BZStream)
if WIN32
return ccall(
("BZ2_bzCompressEnd@4", libbz2),
("BZ2_bzCompressEnd@4", libbzip2),
stdcall,
Cint,
(Ref{BZStream},),
stream)
else
return ccall(
(:BZ2_bzCompressEnd, libbz2),
(:BZ2_bzCompressEnd, libbzip2),
Cint,
(Ref{BZStream},),
stream)
Expand All @@ -94,14 +94,14 @@ end
function compress!(stream::BZStream, action::Integer)
if WIN32
return ccall(
("BZ2_bzCompress@8", libbz2),
("BZ2_bzCompress@8", libbzip2),
stdcall,
Cint,
(Ref{BZStream}, Cint),
stream, action)
else
return ccall(
(:BZ2_bzCompress, libbz2),
(:BZ2_bzCompress, libbzip2),
Cint,
(Ref{BZStream}, Cint),
stream, action)
Expand All @@ -115,14 +115,14 @@ end
function decompress_init!(stream::BZStream, verbosity::Integer, small::Bool)
if WIN32
return ccall(
("BZ2_bzDecompressInit@12", libbz2),
("BZ2_bzDecompressInit@12", libbzip2),
stdcall,
Cint,
(Ref{BZStream}, Cint, Cint),
stream, verbosity, small)
else
return ccall(
(:BZ2_bzDecompressInit, libbz2),
(:BZ2_bzDecompressInit, libbzip2),
Cint,
(Ref{BZStream}, Cint, Cint),
stream, verbosity, small)
Expand All @@ -132,14 +132,14 @@ end
function decompress_end!(stream::BZStream)
if WIN32
return ccall(
("BZ2_bzDecompressEnd@4", libbz2),
("BZ2_bzDecompressEnd@4", libbzip2),
stdcall,
Cint,
(Ref{BZStream},),
stream)
else
return ccall(
(:BZ2_bzDecompressEnd, libbz2),
(:BZ2_bzDecompressEnd, libbzip2),
Cint,
(Ref{BZStream},),
stream)
Expand All @@ -149,14 +149,14 @@ end
function decompress!(stream::BZStream)
if WIN32
return ccall(
("BZ2_bzDecompress@4", libbz2),
("BZ2_bzDecompress@4", libbzip2),
stdcall,
Cint,
(Ref{BZStream},),
stream)
else
return ccall(
(:BZ2_bzDecompress, libbz2),
(:BZ2_bzDecompress, libbzip2),
Cint,
(Ref{BZStream},),
stream)
Expand Down

0 comments on commit b7775b2

Please sign in to comment.