-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathos-tools-linux-apt.mk
200 lines (173 loc) · 5.42 KB
/
os-tools-linux-apt.mk
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
ifndef _MK_OS_TOOLS_LINUX_APT_MK_
_MK_OS_TOOLS_LINUX_APT_MK_ := 1
ifeq ($(IS_LINUX_WITH_APT),1)
ifndef GIT_ROOT
GIT_ROOT := $(shell git rev-parse --show-toplevel 2>/dev/null)
endif
ifndef MK_DIR
MK_DIR := $(GIT_ROOT)/.make
endif
ifeq ($(UNAME_O),Cygwin)
#$(info We're running under Cygwin)
APT_GET := /usr/bin/apt-cyg
else
APT_GET := sudo apt-get
endif
APT_INSTALL := $(APT_GET) install -y -qq
SED_BIN := /usr/bin/sed
.PHONY: apt-update
ifeq ($(RUNNING_IN_DOCKER),1)
apt-update:
@echo "apt-update: Skipping apt-get update in Docker"
else
apt-update:
@$(APT_GET) update -y -qq
endif
.PHONY: _linux-tool-musl
ifeq ($(RUNNING_IN_DOCKER),1)
_linux-tool-musl:
@echo "_linux-tool-musl: Skipping installation of musl tools in Docker"
else
_linux-tool-musl: apt-update
@echo "Installing musl tools:"
@dpkg -s musl >/dev/null 2>&1 || \
$(APT_INSTALL) musl
@dpkg -s musl-dev >/dev/null 2>&1 || \
$(APT_INSTALL) musl-dev
@dpkg -s musl-tools >/dev/null 2>&1 || \
$(APT_INSTALL) musl-tools
# set -x ; which musl-gcc || true
# set -x ; musl-gcc --version 2>/dev/null || true
# set -x ; x86_64-linux-musl-gcc --version 2>/dev/null || true
# set -x ; /usr/local/bin/x86_64-linux-musl-gcc --version 2>/dev/null || true
# set -x ; find / -name x86_64-linux-musl-gcc 2>/dev/null || true
# set -x ; ln -fvs "/usr/bin/g++" "/usr/bin/musl-g++" || true
# set -x ; ln -fvs "/usr/local/bin/g++" "/usr/local/bin/musl-g++" || true
endif
.PHONY: _linux-tool-pkg-config
_linux-tool-pkg-config: apt-update
@dpkg -s pkg-config >/dev/null 2>&1 || \
$(APT_INSTALL) pkg-config
.PHONY: _linux-tool-pango
_linux-tool-pango: apt-update
@dpkg -s libsdl-pango-dev >/dev/null 2>&1 || \
$(APT_INSTALL) libsdl-pango-dev
.PHONY: _linux-tool-gtk
_linux-tool-gtk: apt-update
@dpkg -s libgtk-3-dev >/dev/null 2>&1 || \
$(APT_INSTALL) libgtk-3-dev
@dpkg -s webkit2gtk-4.0 >/dev/null 2>&1 || \
$(APT_INSTALL) webkit2gtk-4.0
.PHONY: _linux-tool-atk
_linux-tool-atk: apt-update
-@dpkg -s librust-atk-dev >/dev/null 2>&1 || \
$(APT_INSTALL) librust-atk-dev
-@dpkg -s librust-atk-sys-dev >/dev/null 2>&1 || \
$(APT_INSTALL) librust-atk-sys-dev
.PHONY: _linux-tool-ayatana
_linux-tool-ayatana: apt-update
-@dpkg -s libayatana-appindicator3-dev >/dev/null 2>&1 || \
$(APT_INSTALL) libayatana-appindicator3-dev
.PHONY: _linux-tool-svg
_linux-tool-svg: apt-update
@dpkg -s librsvg2-dev >/dev/null 2>&1 || \
$(APT_INSTALL) librsvg2-dev
.PHONY: _linux-tool-elf
_linux-tool-elf: apt-update
@dpkg -s patchelf >/dev/null 2>&1 || \
$(APT_INSTALL) patchelf
# Required for LaTeX support (tectonic) etc
.PHONY: _linux-tool-fontconfig1
_linux-tool-fontconfig1: apt-update
@dpkg -s libfontconfig1-dev >/dev/null 2>&1 || \
$(APT_INSTALL) libfontconfig1-dev
# Required for LaTeX support (tectonic) etc
.PHONY: _linux-tool-freetype6
_linux-tool-freetype6: apt-update
@dpkg -s libfreetype6-dev >/dev/null 2>&1 || \
$(APT_INSTALL) libfreetype6-dev
# Required for LaTeX support (tectonic) etc
.PHONY: _linux-tool-graphite2
_linux-tool-graphite2: apt-update
@dpkg -s libgraphite2-dev >/dev/null 2>&1 || \
$(APT_INSTALL) libgraphite2-dev
# Required for LaTeX support (tectonic) etc
.PHONY: _linux-tool-icu
_linux-tool-icu: apt-update
@dpkg -s libicu-dev >/dev/null 2>&1 || \
$(APT_INSTALL) libicu-dev
# Required for LaTeX support (tectonic) etc
.PHONY: _linux-tool-ssl
_linux-tool-ssl: apt-update
@dpkg -s libssl-dev >/dev/null 2>&1 || \
$(APT_INSTALL) libssl-dev
# Required for Playwright support etc
.PHONY: _linux-tool-libnss3
_linux-tool-libnss3: apt-update
@dpkg -s libnss3 >/dev/null 2>&1 || \
$(APT_INSTALL) libnss3
# Required for Playwright support etc
.PHONY: _linux-tool-libnspr4
_linux-tool-libnspr4: apt-update
@dpkg -s libnspr4 >/dev/null 2>&1 || \
$(APT_INSTALL) libnspr4
# Required for Playwright support etc
.PHONY: _linux-tool-libgtk-3-0
_linux-tool-libgtk-3-0: apt-update
@dpkg -s libgtk-3-0 >/dev/null 2>&1 || \
$(APT_INSTALL) libgtk-3-0
# Required for Playwright support etc
.PHONY: _linux-tool-libasound2
_linux-tool-libasound2: apt-update
-@dpkg -s libasound2 >/dev/null 2>&1 || \
$(APT_INSTALL) libasound2
# Required for Playwright support etc
.PHONY: _linux-tool-libgbm-dev
_linux-tool-libgbm-dev: apt-update
@dpkg -s libgbm-dev >/dev/null 2>&1 || \
$(APT_INSTALL) libgbm-dev
.PHONY: _linux-tool-appstream
_linux-tool-appstream: apt-update
@dpkg -s appstream >/dev/null 2>&1 || \
$(APT_INSTALL) appstream
.PHONY: _linux-tool-bsdtar
_linux-tool-bsdtar: apt-update
@dpkg -s libarchive-tools >/dev/null 2>&1 || \
$(APT_INSTALL) libarchive-tools
.PHONY: _linux-tools-install-info
_linux-tools-install-info:
@echo "Installing linux tools (primarily via apt)"
@sudo apt --yes autoremove
.PHONY: linux-tools-install
ifeq ($(RUNNING_IN_DOCKER),1)
linux-tools-install:
@echo "linux-tools-install: Skipping installation of linux tools in Docker"
else
linux-tools-install: _linux-tools-install-info \
gcc-install \
llvm-install-with-brew \
_linux-tool-musl \
_linux-tool-pkg-config \
_linux-tool-pango \
_linux-tool-gtk \
_linux-tool-atk \
_linux-tool-ayatana \
_linux-tool-svg \
_linux-tool-elf \
_linux-tool-icu \
_linux-tool-ssl \
_linux-tool-appstream \
_linux-tool-bsdtar \
_linux-tool-fontconfig1 \
_linux-tool-freetype6 \
_linux-tool-graphite2 \
_linux-tool-libnss3 \
_linux-tool-libnspr4 \
_linux-tool-libgtk-3-0 \
_linux-tool-libasound2 \
_linux-tool-libgbm-dev \
sops-check
@echo "Linux tools have been installed"
endif
endif # ifeq ($(IS_LINUX_WITH_APT),1)
endif # _MK_OS_TOOLS_LINUX_APT_MK_