Repository navigation
Expand file tree
/
Copy pathEarthfile
More file actions
177 lines (138 loc) · 6.14 KB
/
Copy pathEarthfile
File metadata and controls
177 lines (138 loc) · 6.14 KB
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
VERSION 0.8
# Target base con toolchain y dependencias
base-system:
FROM ubuntu:22.04
RUN rm -f /etc/apt/apt.conf.d/docker-clean && \
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
ENV DEBIAN_FRONTEND=noninteractive
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update
the-base:
FROM +base-system
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
cmake \
git \
libzip-dev \
pkg-config \
libasound2-dev \
libjack-jackd2-dev \
ladspa-sdk \
libx11-dev \
libxcomposite-dev \
libxcursor-dev \
libxext-dev \
libxinerama-dev \
libxrandr-dev \
libxrender-dev \
libfontconfig1-dev \
libfreetype6-dev \
libglu1-mesa-dev \
mesa-common-dev \
libgl1-mesa-dev \
libssl-dev \
libcurl4-openssl-dev \
libfluidsynth-dev \
libwebkit2gtk-4.1-dev \
libgtk-3-dev \
libopencv-dev
WORKDIR /opt/soundtable
COPY reacTIVision ./reacTIVision
COPY JUCE ./JUCE
COPY external ./external
COPY CMakeLists.txt ./
COPY resources ./resources
COPY core ./core
COPY tracker ./tracker
COPY tests ./tests
COPY research ./research
# Stage auxiliar: calcula la versión por defecto a partir de git
version-info:
FROM +the-base
WORKDIR /opt/soundtable
# Copiamos metadatos de git para poder obtener la versión del repositorio
COPY .git ./.git
RUN set -eux; \
VERSION="$(git describe --tags --always || echo dev)"; \
VERSION="${VERSION#v}"; \
printf '%s\n' "${VERSION}" > version.txt
SAVE ARTIFACT version.txt
# Target principal: compila soundtable-core (JUCE) y soundtable-tracker (OpenCV)
build:
FROM +the-base
RUN mkdir -p build && cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
cmake --build . --config Release -- -j$(nproc)
# Exportamos los binarios al host como artefactos locales.
SAVE ARTIFACT build/core/soundtable-core_artefacts/Release/Soundtable AS LOCAL build/Soundtable
SAVE ARTIFACT build/soundtable-tracker AS LOCAL build/soundtable-tracker
# Target AppImage: genera un AppImage con todas las dependencias necesarias
appimage:
FROM +base-system
# Herramientas adicionales necesarias para crear AppImage (incluye ImageMagick para redimensionar el icono)
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update && \
apt-get install -y --no-install-recommends \
curl \
file \
ca-certificates \
libzip4 \
libfluidsynth3 \
libopencv-core4.5d \
libopencv-highgui4.5d \
libopencv-videoio4.5d \
appstream
# Descargamos linuxdeploy y appimagetool como AppImages
RUN curl -L https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage -o /usr/local/bin/linuxdeploy && \
chmod +x /usr/local/bin/linuxdeploy && \
curl -L https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -o /usr/local/bin/appimagetool && \
chmod +x /usr/local/bin/appimagetool
RUN mkdir -p \
/AppDir/resources \
/AppDir/usr/bin \
/AppDir/usr/share/applications \
/AppDir/usr/share/icons/hicolor/256x256/apps \
/AppDir/usr/share/metainfo \
/AppDir/usr/share/mime/packages
COPY --if-exists resources/reactableresources.zip /AppDir/resources/
COPY resources/reactable-logo.png /AppDir/usr/share/icons/hicolor/256x256/apps/Soundtable.png
# Copia/symlink en la raíz del AppDir para que appimagetool/linuxdeploy lo detecten como icono de AppImage
RUN ln -sf usr/share/icons/hicolor/256x256/apps/Soundtable.png /AppDir/Soundtable.png && \
ln -sf Soundtable.png /AppDir/.DirIcon
COPY resources/app.desktop /AppDir/usr/share/applications/Soundtable.desktop
#COPY resources/appstream.xml /AppDir/usr/share/metainfo/Soundtable.appdata.xml
COPY resources/soundtable-rtz.xml /AppDir/usr/share/mime/packages/soundtable-rtz.xml
ENV APPIMAGE_EXTRACT_AND_RUN=1
ENV ARCH=x86_64
# appimagetool/AppImageUpdate
ARG APP_VERSION
ARG APPIMAGE_UPDATE_INFORMATION="gh-releases-zsync|duhow|soundtable|latest|Soundtable-*-x86_64.AppImage.zsync"
COPY +build/Soundtable /AppDir/usr/bin/Soundtable
COPY +build/soundtable-tracker /AppDir/usr/bin/soundtable-tracker
COPY +version-info/version.txt /tmp/version.txt
# linuxdeploy analiza los binarios, registra el .desktop y el icono, y copia dependencias compartidas
RUN /usr/local/bin/linuxdeploy \
--appdir /AppDir \
--executable /AppDir/usr/bin/Soundtable \
--executable /AppDir/usr/bin/soundtable-tracker \
--desktop-file /AppDir/usr/share/applications/Soundtable.desktop \
--icon-file /AppDir/usr/share/icons/hicolor/256x256/apps/Soundtable.png
RUN set -eux; \
DEFAULT_VERSION="$(cat /tmp/version.txt 2>/dev/null || echo dev)"; \
VERSION="${APP_VERSION:-${DEFAULT_VERSION}}"; \
UPDATE_INFORMATION="${APPIMAGE_UPDATE_INFORMATION}"; \
VERSION="${VERSION}" /usr/local/bin/appimagetool -u "${UPDATE_INFORMATION}" /AppDir Soundtable-x86_64.AppImage
# Exportamos el AppImage como artefacto local
SAVE ARTIFACT Soundtable-x86_64.AppImage AS LOCAL build/Soundtable-x86_64.AppImage
# Target de tests: construye y ejecuta CTest
test:
FROM +the-base
RUN mkdir -p build && cd build && \
cmake -DCMAKE_BUILD_TYPE=Debug -DSOUNDTABLE_BUILD_TESTS=ON .. && \
cmake --build . --config Debug -- -j$(nproc) && \
ctest --output-on-failure