-
Notifications
You must be signed in to change notification settings - Fork 0
/
mix.exs
109 lines (101 loc) · 2.67 KB
/
mix.exs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
defmodule Pythonx.MixProject do
use Mix.Project
@app :pythonx
@version "0.2.6"
@github_url "https://github.com/cocoa-xu/pythonx"
def project do
[
app: @app,
version: @version,
elixir: "~> 1.14",
start_permanent: Mix.env() == :prod,
deps: deps(),
docs: docs(),
# Package information
name: "Pythonx",
description: "Python Interpreter in Elixir",
package: package(),
preferred_cli_env: [
docs: :docs,
"hex.publish": :docs
],
# Compilers
compilers: [:elixir_make] ++ Mix.compilers(),
make_precompiler: {:nif, CCPrecompiler},
make_precompiler_url: "#{@github_url}/releases/download/v#{@version}/@{artefact_filename}",
make_precompiler_nif_versions: [versions: ["2.16"]],
cc_precompiler: [
cleanup: "clean",
only_listed_targets: true,
compilers: %{
{:unix, :linux} => %{
"x86_64-linux-gnu" => {
"x86_64-linux-gnu-gcc",
"x86_64-linux-gnu-g++"
},
"aarch64-linux-gnu" => {
"aarch64-linux-gnu-gcc",
"aarch64-linux-gnu-g++"
},
"powerpc64le-linux-gnu" => {
"powerpc64le-linux-gnu-gcc",
"powerpc64le-linux-gnu-g++"
},
"riscv64-linux-gnu" => {
"riscv64-linux-gnu-gcc",
"riscv64-linux-gnu-g++"
},
"s390x-linux-gnu" => {
"s390x-linux-gnu-gcc",
"s390x-linux-gnu-g++"
}
},
{:unix, :darwin} => %{
"x86_64-apple-darwin" => {
"gcc",
"g++",
"<%= cc %> -arch x86_64",
"<%= cxx %> -arch x86_64"
},
"aarch64-apple-darwin" => {
"gcc",
"g++",
"<%= cc %> -arch arm64",
"<%= cxx %> -arch arm64"
}
}
}
]
]
end
def application do
[
extra_applications: [:logger]
]
end
defp deps do
[
{:elixir_make, "~> 0.8"},
{:cc_precompiler, "~> 0.1"},
{:jason, "~> 1.2"},
{:req, "~> 0.3"},
{:ex_doc, "~> 0.34", only: :docs, runtime: false},
{:styler, "~> 0.11.9", only: [:dev, :test], runtime: false}
]
end
defp docs do
[
main: "Pythonx",
source_ref: "v#{@version}",
source_url: @github_url
]
end
defp package do
[
name: "pythonx",
files: ~w(c_src lib mix.exs README* LICENSE* Makefile CMakeLists.txt checksum.exs scripts),
licenses: ["Apache-2.0"],
links: %{"GitHub" => @github_url}
]
end
end