-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.asdf
132 lines (106 loc) · 4.39 KB
/
Makefile.asdf
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# vim: filetype=make
# This file manages the installation of the `asdf` command and its plugins.
#
# To add an additional plugin make the following changes:
#
# 1. Add the plugin name, as passed to `asdf plugin-add` to
# `ASDF_PLUGINS_LIST`
# 2. Create a new goal that is the same value as above
#
# The goal should install the dependencies for the plugin, often found in the
# plugin docs and then add the plugin with `asdf plugin-add`. To make
# maintenance easier, add the goal and plugin name in alphabetical order.
.ONESHELL:
SHELL := /bin/bash
.SHELLFLAGS := $(DOTSHELLFLAGS)
ASDF_VERSION := 0.13.1
ASDF_INSTALL_PATH ?= $(HOME)/.asdf
ASDF_CMD := $(ASDF_INSTALL_PATH)/bin/asdf
all: asdf asdf-plugins
asdf: $(HOME)/.asdf
# asdf
$(HOME)/.asdf:
LOG_INFO "Installing asdf and its dependencies"
sudo apt-get install curl git
git clone https://github.com/asdf-vm/asdf.git $(HOME)/.asdf --branch v$(ASDF_VERSION)
# asdf plugins
ASDF_PLUGINS_LIST := elixir erlang golang nim nodejs php rabbitmq rebar zig
asdf-plugins: $(ASDF_PLUGINS_LIST)
elixir: $(ASDF_INSTALL_PATH)/plugins/elixir
.PHONY: elixir
$(ASDF_INSTALL_PATH)/plugins/elixir:
# https://github.com/asdf-vm/asdf-elixir
LOG_INFO "Installing dependencies for $(notdir $@)"
sudo apt-get --yes install unzip
LOG_INFO "Adding asdf plugin $(notdir $@)"
$(ASDF_CMD) plugin-add $(notdir $@)
.PHONY: $(ASDF_INSTALL_PATH)/plugins/elixir
erlang: $(ASDF_INSTALL_PATH)/plugins/erlang
.PHONY: erlang
$(ASDF_INSTALL_PATH)/plugins/erlang:
# https://github.com/asdf-vm/asdf-erlang
LOG_INFO "Installing dependencies for $(notdir $@)"
sudo apt-get --yes install libssl-dev automake autoconf libncurses-dev xsltproc fop \
libxml2-utils libwxgtk-webview3.0-gtk3-dev wx-common gcc g++ openjdk-11-jdk m4 \
libglu1-mesa-dev libgl1-mesa-dev libpng-dev unixodbc-dev;
LOG_INFO "Adding asdf plugin $(notdir $@)"
$(ASDF_CMD) plugin-add $(notdir $@)
.PHONY: $(ASDF_INSTALL_PATH)/plugins/erlang
golang: $(ASDF_INSTALL_PATH)/plugins/golang
.PHONY: golang
$(ASDF_INSTALL_PATH)/plugins/golang:
# https://github.com/asdf-community/asdf-golang
LOG_INFO "Installing dependencies for $(notdir $@)"
sudo apt-get --yes install coreutils curl
LOG_INFO "Adding asdf plugin $(notdir $@)"
$(ASDF_CMD) plugin-add $(notdir $@)
.PHONY: $(ASDF_INSTALL_PATH)/plugins/asdf-golang
nim: $(ASDF_INSTALL_PATH)/plugins/nim
.PHONY: nim
$(ASDF_INSTALL_PATH)/plugins/nim:
# https://github.com/asdf-community/asdf-nim
LOG_INFO "Installing dependencies for $(notdir $@)"
sudo apt-get --yes install build-essential xz-utils
LOG_INFO "Adding asdf plugin $(notdir $@)"
$(ASDF_CMD) plugin-add $(notdir $@)
.PHONY: $(ASDF_INSTALL_PATH)/plugins/asdf-nim
nodejs: $(ASDF_INSTALL_PATH)/plugins/nodejs
.PHONY: nodejs
$(ASDF_INSTALL_PATH)/plugins/nodejs:
# https://github.com/asdf-vm/asdf-nodejs
LOG_INFO "Adding asdf plugin $(notdir $@)"
$(ASDF_CMD) plugin-add $(notdir $@)
.PHONY: $(ASDF_INSTALL_PATH)/plugins/asdf-nodejs
php: $(ASDF_INSTALL_PATH)/plugins/php
.PHONY: php
$(ASDF_INSTALL_PATH)/plugins/php:
# https://github.com/asdf-community/asdf-php
LOG_INFO "Installing dependencies for $(notdir $@)"
sudo apt-get --yes install autoconf bison build-essential curl gettext git libgd-dev \
libcurl4-openssl-dev libedit-dev libicu-dev libjpeg-dev libmysqlclient-dev libonig-dev \
libpng-dev libpq-dev libreadline-dev libsqlite3-dev libssl-dev libxml2-dev libzip-dev \
openssl pkg-config re2c zlib1g-dev;
LOG_INFO "Adding asdf plugin $(notdir $@)"
$(ASDF_CMD) plugin-add $(notdir $@)
.PHONY: $(ASDF_INSTALL_PATH)/plugins/asdf-php
rabbitmq: $(ASDF_INSTALL_PATH)/plugins/rabbitmq
.PHONY: rabbitmq
$(ASDF_INSTALL_PATH)/plugins/rabbitmq: $(ASDF_INSTALL_PATH)/plugins/erlang
# https://github.com/w-sanches/asdf-rabbitmq
LOG_INFO "Adding asdf plugin $(notdir $@)"
$(ASDF_CMD) plugin-add $(notdir $@)
.PHONY: $(ASDF_INSTALL_PATH)/plugins/rabbitmq
rebar: $(ASDF_INSTALL_PATH)/plugins/rebar
.PHONY: rebar
$(ASDF_INSTALL_PATH)/plugins/rebar: $(ASDF_INSTALL_PATH)/plugins/erlang
# https://github.com/Stratus3D/asdf-rebar
LOG_INFO "Adding asdf plugin $(notdir $@)"
$(ASDF_CMD) plugin-add $(notdir $@)
.PHONY: $(ASDF_INSTALL_PATH)/plugins/rebar
zig: $(ASDF_INSTALL_PATH)/plugins/zig
.PHONY: zig
$(ASDF_INSTALL_PATH)/plugins/zig:
# https://github.com/asdf-community/asdf-zig
LOG_INFO "Adding asdf plugin $(notdir $@)"
$(ASDF_CMD) plugin-add $(notdir $@) https://github.com/asdf-community/asdf-zig.git
.PHONY: $(ASDF_INSTALL_PATH)/plugins/zig