This repository was archived by the owner on May 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 103
Expand file tree
/
Copy pathobjective-c.toml
More file actions
119 lines (106 loc) · 2.24 KB
/
Copy pathobjective-c.toml
File metadata and controls
119 lines (106 loc) · 2.24 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
name = "objective-c"
entrypoint = "main.m"
extensions = [
"m",
"mm"
]
packages = [
"clang-8",
"libcairo-dev",
"autoconf",
"libblocksruntime-dev",
"libtiff-dev",
"libpthread-workqueue-dev",
"libicu-dev",
"libgnutls28-dev",
"libjpeg-dev",
"libxft-dev",
"libtool",
"libffi-dev",
"libx11-dev",
"libxml2-dev",
"libxrandr-dev",
"libxt-dev",
"libkqueue-dev",
]
setup = [
'''
export LIBOBJC2=https://codeload.github.com/gnustep/libobjc2/tar.gz/v2.0
export GNUSTEP_SOURCES=(
ftp://ftp.gnustep.org/pub/gnustep/core/gnustep-make-2.8.0.tar.gz
ftp://ftp.gnustep.org/pub/gnustep/core/gnustep-base-1.27.0.tar.gz
ftp://ftp.gnustep.org/pub/gnustep/core/gnustep-gui-0.28.0.tar.gz
ftp://ftp.gnustep.org/pub/gnustep/core/gnustep-back-0.28.0.tar.gz
)
# Create temporary directory
mkdir /tmp/gnustep-dev && cd /tmp/gnustep-dev
# Use clang
export CC=clang-8
export CXX=clang++-8
# Install libobjc2
export LIBOBJC2_NAME=libobjc2-2.0
curl --output ${LIBOBJC2_NAME}.tar.gz -ks $LIBOBJC2
tar -xz --file=${LIBOBJC2_NAME}.tar.gz
cd $LIBOBJC2_NAME
mkdir Build && cd Build
cmake ..
make
make install
cd ../..
# Install GNUStep from source
export GNUSTEP_MAKEFILES=/usr/local/share/GNUstep/Makefiles
for dl in "${GNUSTEP_SOURCES[@]}"; do
export pkg=$(basename ${dl##*/} .tar.gz)
echo '---Downloading '${pkg}'---'
(
curl -ks ${dl} | tar vzx && cd ${pkg} || exit $?
{
./configure
make
make install
ldconfig
. /usr/local/share/GNUstep/Makefiles/GNUstep.sh
}
) || exit $?
done
# Reinstall libdispatch-dev
cd /tmp/gnustep-dev
git clone https://github.com/plaurent/libdispatch.git
cd libdispatch
rm -Rf build
mkdir build && cd build
../configure --prefix=/usr
make
make install
ldconfig
# Remove temporary directory
rm -rf /tmp/gnustep-dev
cd $HOME
'''
]
[compile]
command = [
"clang-8",
"-x", "objective-c",
"`gnustep-config --base-libs`", # Add "`gnustep-config --gui-libs`" if you want to use GUI libraries in your program too.
"-o", "main",
]
[run]
command = [
"./main"
]
[tests]
[tests.hello]
code = """
#import <objc/objc.h>
#import <objc/Object.h>
#import <Foundation/Foundation.h>
int main(void) {
@autoreleasepool {
NSString* str = @"Hello from Objective-C 2.0!";
puts([str cString]);
}
return 0;
}
"""
output = "Hello from Objective-C 2.0!\n"