├── Project.toml ├── Artifacts.toml ├── LICENSE.md ├── LICENSE ├── README.md └── src ├── wrappers ├── x86_64-linux-gnu-cxx03.jl └── x86_64-linux-gnu-cxx11.jl └── ConnectFourSolver_jll.jl /Project.toml: -------------------------------------------------------------------------------- 1 | name = "ConnectFourSolver_jll" 2 | uuid = "5ab91c8a-5c16-538d-97cb-84915cefd4b0" 3 | version = "0.1.0+0" 4 | 5 | [deps] 6 | Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" 7 | libcxxwrap_julia_jll = "3eaa8342-bff7-56a5-9981-c04077f7cee7" 8 | Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" 9 | 10 | [compat] 11 | julia = "1.0" 12 | -------------------------------------------------------------------------------- /Artifacts.toml: -------------------------------------------------------------------------------- 1 | [[ConnectFourSolver]] 2 | arch = "x86_64" 3 | cxxstring_abi = "cxx11" 4 | git-tree-sha1 = "4d50a2767cad83788b65da2663e7813cc949be6c" 5 | libc = "glibc" 6 | os = "linux" 7 | 8 | [[ConnectFourSolver.download]] 9 | sha256 = "cff945be559870864364ec7626f38d236f9e7dfc7118fd07b1376c78a6617404" 10 | url = "https://github.com/findmyway/ConnectFourSolver_jll.jl/releases/download/ConnectFourSolver-v0.1.0+0/ConnectFourSolver.v0.1.0.x86_64-linux-gnu-cxx11.tar.gz" 11 | [[ConnectFourSolver]] 12 | arch = "x86_64" 13 | cxxstring_abi = "cxx03" 14 | git-tree-sha1 = "1d05801070fdfe71564b664f42ac20c5efe5b5e4" 15 | libc = "glibc" 16 | os = "linux" 17 | 18 | [[ConnectFourSolver.download]] 19 | sha256 = "1327ef627bf0ed2e13c891171f18936569be247af11d929bb2ddc61685a06b79" 20 | url = "https://github.com/findmyway/ConnectFourSolver_jll.jl/releases/download/ConnectFourSolver-v0.1.0+0/ConnectFourSolver.v0.1.0.x86_64-linux-gnu-cxx03.tar.gz" 21 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright 2020 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Jun Tian 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ConnectFourSolver_jll.jl 2 | 3 | This is an autogenerated package constructed using [`BinaryBuilder.jl`](https://github.com/JuliaPackaging/BinaryBuilder.jl). 4 | 5 | ## Products 6 | 7 | The code bindings within this package are autogenerated from the following `Products` defined within the `build_tarballs.jl` file that generated this package: 8 | 9 | ```julia 10 | products = [ 11 | LibraryProduct(["libconnect4jl"], :libconnect4jl) 12 | ] 13 | ``` 14 | 15 | ## Usage example 16 | 17 | For example purposes, we will assume that the following products were defined in the imaginary package `Example_jll`: 18 | 19 | ```julia 20 | products = [ 21 | FileProduct("src/data.txt", :data_txt), 22 | LibraryProduct("libdataproc", :libdataproc), 23 | ExecutableProduct("mungify", :mungify_exe) 24 | ] 25 | ``` 26 | 27 | With such products defined, `Example_jll` would contain `data_txt`, `libdataproc` and `mungify_exe` symbols exported. For `FileProduct` variables, the exported value is a string pointing to the location of the file on-disk. For `LibraryProduct` variables, it is a string corresponding to the `SONAME` of the desired library (it will have already been `dlopen()`'ed, so typical `ccall()` usage applies), and for `ExecutableProduct` variables, the exported value is a function that can be called to set appropriate environment variables. Example: 28 | 29 | ```julia 30 | using Example_jll 31 | 32 | # For file products, you can access its file location directly: 33 | data_lines = open(data_txt, "r") do io 34 | readlines(io) 35 | end 36 | 37 | # For library products, you can use the exported variable name in `ccall()` invocations directly 38 | num_chars = ccall((:count_characters, libdataproc), Cint, (Cstring, Cint), data_lines[1], length(data_lines[1])) 39 | 40 | # For executable products, you can use the exported variable name as a function that you can call 41 | mungify_exe() do mungify_exe_path 42 | run(`$mungify_exe_path $num_chars`) 43 | end 44 | ``` 45 | -------------------------------------------------------------------------------- /src/wrappers/x86_64-linux-gnu-cxx03.jl: -------------------------------------------------------------------------------- 1 | # Autogenerated wrapper script for ConnectFourSolver_jll for x86_64-linux-gnu-cxx03 2 | export libconnect4jl 3 | 4 | using libcxxwrap_julia_jll 5 | ## Global variables 6 | PATH = "" 7 | LIBPATH = "" 8 | LIBPATH_env = "LD_LIBRARY_PATH" 9 | 10 | # Relative path to `libconnect4jl` 11 | const libconnect4jl_splitpath = ["lib", "libconnect4jl.so"] 12 | 13 | # This will be filled out by __init__() for all products, as it must be done at runtime 14 | libconnect4jl_path = "" 15 | 16 | # libconnect4jl-specific global declaration 17 | # This will be filled out by __init__() 18 | libconnect4jl_handle = C_NULL 19 | 20 | # This must be `const` so that we can use it with `ccall()` 21 | const libconnect4jl = "libconnect4jl.so" 22 | 23 | 24 | """ 25 | Open all libraries 26 | """ 27 | function __init__() 28 | global artifact_dir = abspath(artifact"ConnectFourSolver") 29 | 30 | # Initialize PATH and LIBPATH environment variable listings 31 | global PATH_list, LIBPATH_list 32 | # We first need to add to LIBPATH_list the libraries provided by Julia 33 | append!(LIBPATH_list, [joinpath(Sys.BINDIR, Base.LIBDIR, "julia"), joinpath(Sys.BINDIR, Base.LIBDIR)]) 34 | # From the list of our dependencies, generate a tuple of all the PATH and LIBPATH lists, 35 | # then append them to our own. 36 | foreach(p -> append!(PATH_list, p), (libcxxwrap_julia_jll.PATH_list,)) 37 | foreach(p -> append!(LIBPATH_list, p), (libcxxwrap_julia_jll.LIBPATH_list,)) 38 | 39 | global libconnect4jl_path = normpath(joinpath(artifact_dir, libconnect4jl_splitpath...)) 40 | 41 | # Manually `dlopen()` this right now so that future invocations 42 | # of `ccall` with its `SONAME` will find this path immediately. 43 | global libconnect4jl_handle = dlopen(libconnect4jl_path) 44 | push!(LIBPATH_list, dirname(libconnect4jl_path)) 45 | 46 | # Filter out duplicate and empty entries in our PATH and LIBPATH entries 47 | filter!(!isempty, unique!(PATH_list)) 48 | filter!(!isempty, unique!(LIBPATH_list)) 49 | global PATH = join(PATH_list, ':') 50 | global LIBPATH = join(LIBPATH_list, ':') 51 | 52 | # Add each element of LIBPATH to our DL_LOAD_PATH (necessary on platforms 53 | # that don't honor our "already opened" trick) 54 | #for lp in LIBPATH_list 55 | # push!(DL_LOAD_PATH, lp) 56 | #end 57 | end # __init__() 58 | 59 | -------------------------------------------------------------------------------- /src/wrappers/x86_64-linux-gnu-cxx11.jl: -------------------------------------------------------------------------------- 1 | # Autogenerated wrapper script for ConnectFourSolver_jll for x86_64-linux-gnu-cxx11 2 | export libconnect4jl 3 | 4 | using libcxxwrap_julia_jll 5 | ## Global variables 6 | PATH = "" 7 | LIBPATH = "" 8 | LIBPATH_env = "LD_LIBRARY_PATH" 9 | 10 | # Relative path to `libconnect4jl` 11 | const libconnect4jl_splitpath = ["lib", "libconnect4jl.so"] 12 | 13 | # This will be filled out by __init__() for all products, as it must be done at runtime 14 | libconnect4jl_path = "" 15 | 16 | # libconnect4jl-specific global declaration 17 | # This will be filled out by __init__() 18 | libconnect4jl_handle = C_NULL 19 | 20 | # This must be `const` so that we can use it with `ccall()` 21 | const libconnect4jl = "libconnect4jl.so" 22 | 23 | 24 | """ 25 | Open all libraries 26 | """ 27 | function __init__() 28 | global artifact_dir = abspath(artifact"ConnectFourSolver") 29 | 30 | # Initialize PATH and LIBPATH environment variable listings 31 | global PATH_list, LIBPATH_list 32 | # We first need to add to LIBPATH_list the libraries provided by Julia 33 | append!(LIBPATH_list, [joinpath(Sys.BINDIR, Base.LIBDIR, "julia"), joinpath(Sys.BINDIR, Base.LIBDIR)]) 34 | # From the list of our dependencies, generate a tuple of all the PATH and LIBPATH lists, 35 | # then append them to our own. 36 | foreach(p -> append!(PATH_list, p), (libcxxwrap_julia_jll.PATH_list,)) 37 | foreach(p -> append!(LIBPATH_list, p), (libcxxwrap_julia_jll.LIBPATH_list,)) 38 | 39 | global libconnect4jl_path = normpath(joinpath(artifact_dir, libconnect4jl_splitpath...)) 40 | 41 | # Manually `dlopen()` this right now so that future invocations 42 | # of `ccall` with its `SONAME` will find this path immediately. 43 | global libconnect4jl_handle = dlopen(libconnect4jl_path) 44 | push!(LIBPATH_list, dirname(libconnect4jl_path)) 45 | 46 | # Filter out duplicate and empty entries in our PATH and LIBPATH entries 47 | filter!(!isempty, unique!(PATH_list)) 48 | filter!(!isempty, unique!(LIBPATH_list)) 49 | global PATH = join(PATH_list, ':') 50 | global LIBPATH = join(LIBPATH_list, ':') 51 | 52 | # Add each element of LIBPATH to our DL_LOAD_PATH (necessary on platforms 53 | # that don't honor our "already opened" trick) 54 | #for lp in LIBPATH_list 55 | # push!(DL_LOAD_PATH, lp) 56 | #end 57 | end # __init__() 58 | 59 | -------------------------------------------------------------------------------- /src/ConnectFourSolver_jll.jl: -------------------------------------------------------------------------------- 1 | module ConnectFourSolver_jll 2 | 3 | if VERSION < v"1.3.0-rc4" 4 | # We lie a bit in the registry that JLL packages are usable on Julia 1.0-1.2. 5 | # This is to allow packages that might want to support Julia 1.0 to get the 6 | # benefits of a JLL package on 1.3 (requiring them to declare a dependence on 7 | # this JLL package in their Project.toml) but engage in heroic hacks to do 8 | # something other than actually use a JLL package on 1.0-1.2. By allowing 9 | # this package to be installed (but not loaded) on 1.0-1.2, we enable users 10 | # to avoid splitting their package versions into pre-1.3 and post-1.3 branches 11 | # if they are willing to engage in the kinds of hoop-jumping they might need 12 | # to in order to install binaries in a JLL-compatible way on 1.0-1.2. One 13 | # example of this hoop-jumping being to express a dependency on this JLL 14 | # package, then import it wtihin a `VERSION >= v"1.3"` conditional, and use 15 | # the deprecated `build.jl` mechanism to download the binaries through e.g. 16 | # `BinaryProvider.jl`. This should work well for the simplest packages, and 17 | # require greater and greater heroics for more and more complex packages. 18 | error("Unable to import ConnectFourSolver_jll on Julia versions older than 1.3!") 19 | end 20 | 21 | using Pkg, Pkg.BinaryPlatforms, Pkg.Artifacts, Libdl 22 | import Base: UUID 23 | 24 | # We put these inter-JLL-package API values here so that they are always defined, even if there 25 | # is no underlying wrapper held within this JLL package. 26 | const PATH_list = String[] 27 | const LIBPATH_list = String[] 28 | 29 | # Load Artifacts.toml file 30 | artifacts_toml = joinpath(@__DIR__, "..", "Artifacts.toml") 31 | 32 | # Extract all platforms 33 | artifacts = Pkg.Artifacts.load_artifacts_toml(artifacts_toml; pkg_uuid=UUID("5ab91c8a-5c16-538d-97cb-84915cefd4b0")) 34 | platforms = [Pkg.Artifacts.unpack_platform(e, "ConnectFourSolver", artifacts_toml) for e in artifacts["ConnectFourSolver"]] 35 | 36 | # Filter platforms based on what wrappers we've generated on-disk 37 | filter!(p -> isfile(joinpath(@__DIR__, "wrappers", replace(triplet(p), "arm-" => "armv7l-") * ".jl")), platforms) 38 | 39 | # From the available options, choose the best platform 40 | best_platform = select_platform(Dict(p => triplet(p) for p in platforms)) 41 | 42 | # Silently fail if there's no binaries for this platform 43 | if best_platform === nothing 44 | @debug("Unable to load ConnectFourSolver; unsupported platform $(triplet(platform_key_abi()))") 45 | else 46 | # Load the appropriate wrapper. Note that on older Julia versions, we still 47 | # say "arm-linux-gnueabihf" instead of the more correct "armv7l-linux-gnueabihf", 48 | # so we manually correct for that here: 49 | best_platform = replace(best_platform, "arm-" => "armv7l-") 50 | include(joinpath(@__DIR__, "wrappers", "$(best_platform).jl")) 51 | end 52 | 53 | end # module ConnectFourSolver_jll 54 | --------------------------------------------------------------------------------