This repository was archived by the owner on Oct 14, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 141
Expand file tree
/
Copy pathobjc.docker
More file actions
204 lines (194 loc) · 6.51 KB
/
Copy pathobjc.docker
File metadata and controls
204 lines (194 loc) · 6.51 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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
FROM codewars/base-runner
RUN set -ex; \
apt-get update; \
apt-get install -y --no-install-recommends software-properties-common; \
add-apt-repository ppa:ubuntu-toolchain-r/test; \
add-apt-repository 'deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-3.9 main'; \
wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -; \
apt-key update; \
apt-get update; \
# Install pre-requisities
apt-get install -y --no-install-recommends \
cmake \
clang-3.9 \
lldb-3.9 \
llvm \
build-essential \
gobjc \
gobjc++ \
libblocksruntime-dev \
libkqueue-dev \
libpthread-workqueue-dev \
libxml2-dev \
libjpeg-dev \
libtiff-dev \
libpng12-dev \
libcups2-dev \
libfreetype6-dev \
libcairo2-dev \
libxt-dev \
libgl1-mesa-dev \
libdispatch-dev \
git \
libxslt1-dev \
libffi-dev \
libssl-dev \
libgnutls-dev \
libgmp3-dev \
libjpeg-dev \
libtiff-dev \
libpng-dev \
libgif-dev \
libx11-dev \
libcairo2-dev \
libxft-dev \
libxmu-dev \
libsqlite3-dev; \
rm -rf /var/lib/apt/lists/*; \
ln -s /usr/bin/clang-3.9 /usr/bin/clang; \
ln -s /usr/bin/clang++-3.9 /usr/bin/clang++;
# Set clang as compiler
ENV CC=clang CXX=clang++
# Install dependencies
RUN set -ex; \
mkdir /source; \
# Install ICU
cd /source; \
mkdir icu; \
wget -qO- http://download.icu-project.org/files/icu4c/56.1/icu4c-56_1-src.tgz | tar xz -C icu --strip-components=1; \
cd /source/icu/source; \
./configure; \
make; \
make install; \
rm -rf /source/icu; \
# Install gnustep-makefile
cd /source; \
mkdir make; \
wget -qO- ftp://ftp.gnustep.org/pub/gnustep/core/gnustep-make-2.6.7.tar.gz | tar xz -C make --strip-components=1; \
cd /source/make; \
./configure --enable-debug-by-default --with-layout=gnustep --enable-objc-nonfragile-abi --enable-objc-arc; \
make; \
make install; \
# Install libobjc2
cd /source; \
mkdir libobjc2; \
wget -qO- https://github.com/gnustep/libobjc2/archive/v1.8.1.tar.gz | tar xz -C libobjc2 --strip-components=1; \
cd /source/libobjc2; \
. /usr/GNUstep/System/Library/Makefiles/GNUstep.sh; \
cmake . -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_INSTALL_LIBDIR=/usr/lib -DCMAKE_ASM_COMPILER=clang -DTESTS=OFF; \
. /usr/GNUstep/System/Library/Makefiles/GNUstep.sh; \
make -f Makefile; \
. /usr/GNUstep/System/Library/Makefiles/GNUstep.sh; \
make -f Makefile install; \
rm -rf /source/libobjc2; \
# Install libdispatch
cd /source; \
git clone https://github.com/nickhutchinson/libdispatch; \
cd libdispatch; \
git checkout bd1808980b04830cbbd79c959b8bc554085e38a1; \
git clean -dfx; \
cd /source/libdispatch; \
./configure; \
make; \
make install; \
rm -rf /source/libdispatch; \
# add /usr/local/lib to libs search paths
echo "/usr/local/lib" > /etc/ld.so.conf.d/my.conf; \
ldconfig; \
export LDFLAGS="-L/usr/local/lib -ldispatch"; \
export OBJCFLAGS="-fblocks -fobjc-runtime=gnustep-1.8.1"; \
# Install gnustep-makefile again
cd /source/make; \
. /usr/GNUstep/System/Library/Makefiles/GNUstep.sh; \
./configure --enable-debug-by-default --with-layout=gnustep --enable-objc-nonfragile-abi --enable-objc-arc; \
. /usr/GNUstep/System/Library/Makefiles/GNUstep.sh; \
make; \
make install; \
rm -rf /source/make; \
# Install gnustep-base
cd /source; \
mkdir base; \
wget -qO- ftp://ftp.gnustep.org/pub/gnustep/core/gnustep-base-1.24.9.tar.gz | tar xz -C base --strip-components=1; \
cd /source/base; \
. /usr/GNUstep/System/Library/Makefiles/GNUstep.sh; \
./configure --disable-mixedabi; \
make; \
make install; \
rm -rf /source/base; \
# Install gnustep-gui
cd /source; \
mkdir gui; \
wget -qO- ftp://ftp.gnustep.org/pub/gnustep/core/gnustep-gui-0.25.0.tar.gz | tar xz -C gui --strip-components=1; \
cd /source/gui; \
. /usr/GNUstep/System/Library/Makefiles/GNUstep.sh; \
./configure; \
make; \
make install; \
rm -rf /source/gui; \
# Install gnustep-backend
cd /source; \
mkdir back; \
wget -qO- ftp://ftp.gnustep.org/pub/gnustep/core/gnustep-back-0.25.0.tar.gz | tar xz -C back --strip-components=1; \
cd /source/back; \
. /usr/GNUstep/System/Library/Makefiles/GNUstep.sh; \
./configure; \
make; \
make install; \
rm -rf /source/back; \
# Install UnitKit
cd /source; \
git clone https://github.com/etoile/UnitKit; \
cd UnitKit; \
git clean -dfx; \
cd /source/UnitKit; \
wget -q https://raw.githubusercontent.com/etoile/Etoile/master/etoile.make; \
. /usr/GNUstep/System/Library/Makefiles/GNUstep.sh; \
make; \
make install; \
make test=yes; \
ukrun -q TestSource/TestUnitKit/TestUnitKit.bundle; \
rm -rf /source/UnitKit /source;
RUN ln -s /home/codewarrior /workspace
ENV NPM_CONFIG_LOGLEVEL=warn
WORKDIR /runner
COPY package.json package.json
RUN set -ex; \
npm install --production; \
rm -rf /tmp/npm-*;
COPY *.js ./
COPY lib/*.js lib/
COPY lib/*.sh lib/
COPY lib/utils lib/utils
COPY lib/runners/objc.js lib/runners/
COPY examples/objc.yml examples/
COPY test/runner.js test/
COPY test/runners/objc_spec.js test/runners/
COPY frameworks/objc /usr/local/include
COPY entrypoint.sh entrypoint.sh
RUN chmod +x entrypoint.sh
USER codewarrior
# Set environment variables
ENV USER=codewarrior \
HOME=/home/codewarrior \
\
GNUSTEP_FLATTENED=yes \
GNUSTEP_HOST=x86_64-unknown-linux-gnu \
GNUSTEP_HOST_CPU=x86_64 \
GNUSTEP_HOST_OS=linux-gnu \
GNUSTEP_HOST_VENDOR=unknown \
GNUSTEP_IS_FLATTENED=yes \
GNUSTEP_SYSTEM_ROOT=/usr/GNUstep/System \
GNUSTEP_NETWORK_ROOT=/usr/GNUstep/Network \
GNUSTEP_LOCAL_ROOT=/usr/GNUstep/Local \
GNUSTEP_MAKEFILES=/usr/GNUstep/System/Library/Makefiles \
GNUSTEP_PATHLIST=/usr/GNUstep/System:/usr/GNUstep/Network:/usr/GNUstep/Local \
GNUSTEP_USER_ROOT=/home/codewarrior/GNUstep \
\
GUILE_LOAD_PATH=/usr/GNUstep/Local/Library/Libraries/Guile:/usr/GNUstep/System/Library/Libraries/Guile \
LDFLAGS="-L/usr/local/lib -ldispatch" \
LD_LIBRARY_PATH=/usr/GNUstep/Local/Library/Libraries:/usr/GNUstep/System/Library/Libraries \
LIBRARY_COMBO=gnu-gnu-gnu \
OBJCFLAGS="-fblocks -fobjc-runtime=gnustep-1.8.1" \
PATH=/usr/GNUstep/Local/Tools:/usr/GNUstep/System/Tools:$PATH
RUN mocha -t 5000 test/runners/objc_spec.js
ENTRYPOINT ["./entrypoint.sh"]