Current section

Files

Jump to
exboost mix.exs
Raw

mix.exs

defmodule Exboost.MixProject do
# Boost Software License - Version 1.0 - August 17th, 2003
#
# Permission is hereby granted, free of charge, to any person or organization
# obtaining a copy of the software and accompanying documentation covered by
# this license (the "Software") to use, reproduce, display, distribute,
# execute, and transmit the Software, and to prepare derivative works of the
# Software, and to permit third-parties to whom the Software is furnished to
# do so, all subject to the following:
#
# The copyright notices in the Software and this entire statement, including
# the above license grant, this restriction and the following disclaimer,
# must be included in all copies of the Software, in whole or in part, and
# all derivative works of the Software, unless such copies or derivative
# works are solely in the form of machine-executable object code generated by
# a source language processor.
#
# 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, TITLE AND NON-INFRINGEMENT. IN NO EVENT
# SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
# FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
use Mix.Project
def project do
[
app: :exboost,
version: "0.1.0",
elixir: "~> 1.6",
start_permanent: Mix.env() == :prod,
compilers: [:make, :elixir, :app], # Add the make compiler
deps: deps(),
## Hex stuff:
description: description(),
package: package(),
name: "ExBoost",
source_url: "https://github.com/piisgaaf/exboost"
]
end
# Run "mix help compile.app" to learn about applications.
def application do
[
]
end
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:boost,
github: "boostorg/boost",
tag: "boost-1.67.0",
submodules: true,
compile: "./bootstrap.sh --with-libraries=math; ./b2 headers; ./b2 link=static runtime-link=static threading=single stage",
app: false,
only: :dev},
{:ex_doc, "~> 0.16", only: :dev, runtime: false}
]
end
# Hex Package Manager stuff:
defp description() do
"""
Provides an elixir wrapper for the C++ Boost library.
"""
end
defp package() do
[
maintainers: [ "Pieter Rijken" ],
licenses: [ "Boost 1.0" ],
files: [ "lib", "mix.exs", "test", "Makefile", "priv/*.c", "README*", "LICENSE*", "priv/libboostnif.so" ],
links: %{ "GitHub" => "https://github.com/piisgaaf/exboost" }
]
end
end
defmodule Mix.Tasks.Compile.Make do
use Mix.Task.Compiler
@shortdoc "Compiles with make"
def run(_) do
{result, _error_code} = System.cmd("make", ["priv/libboostnif.so"], stderr_to_stdout: true)
Mix.shell.info result
end
end