forked from AlexR2D2/duckdbex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mix.exs
118 lines (106 loc) · 2.69 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
110
111
112
113
114
115
116
117
118
defmodule Duckdbex.MixProject do
use Mix.Project
@version "0.3.3"
@duckdb_version "1.1.0"
def project do
[
app: :duckdbex,
version: @version,
elixir: "~> 1.14",
start_permanent: Mix.env() == :prod,
deps: deps(),
package: package(),
description: description(),
elixirc_paths: elixirc_paths(Mix.env()),
compilers: [:elixir_make] ++ Mix.compilers(),
make_targets: ["all"],
make_clean: ["clean"],
# elixir_make specific config
make_precompiler: {:nif, CCPrecompiler},
make_precompiler_url:
"https://github.com/AlexR2D2/duckdbex/releases/download/v#{@version}/@{artefact_filename}",
make_precompiler_filename: "duckdb_nif",
make_precompiler_nif_versions: [
versions: &nif_versions/1,
fallback_version: &fallback_nif_versions/1
],
cc_precompiler: cc_precompiler(),
# Docs
name: "Duckdbex",
source_url: "https://github.com/AlexR2D2/duckdbex/",
homepage_url: "https://github.com/AlexR2D2/duckdbex/",
docs: docs()
]
end
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
def application do
[
extra_applications: [:logger, :public_key]
]
end
defp deps do
[
{:elixir_make, "~> 0.8", runtime: false},
{:cc_precompiler, "~> 0.1", runtime: false},
{:ex_doc, "~> 0.24", only: :dev, runtime: false}
]
end
defp nif_versions(_opts) do
["2.16", "2.17"]
end
defp fallback_nif_versions(opts) do
hd(nif_versions(opts))
end
defp package do
[
files: ~w(
lib
c_src
bin
.formatter.exs
Makefile*
mix.exs
checksum.exs
README.md
LICENSE
),
name: "duckdbex",
licenses: ["MIT"],
links: %{
"GitHub" => "https://github.com/AlexR2D2/duckdbex",
"Changelog" => "https://github.com/AlexR2D2/duckdbex/blob/main/CHANGELOG.md"
}
]
end
defp cc_precompiler do
[
cleanup: "clean",
compilers: %{
{:unix, :linux} => %{
"x86_64-linux-gnu" => "x86_64-linux-gnu-",
"aarch64-linux-gnu" => "aarch64-linux-gnu-",
"riscv64-linux-gnu" => "riscv64-linux-gnu-"
},
{:unix, :darwin} => %{
:include_default_ones => true
}
}
]
end
defp docs do
[
main: "readme",
extras: [
"README.md": [title: "Duckdbex"],
"CHANGELOG.md": []
],
source_ref: "v#{@version}",
source_url: "https://github.com/AlexR2D2/duckdbex"
]
end
defp description do
"An Elixir DuckDB library"
end
def duckdb_version, do: @duckdb_version
end