Skip to content

Commit acce13f

Browse files
committed
First series of changes for iOS. Compiles, but not fully thread local
yet
1 parent 757bd2e commit acce13f

38 files changed

+12877
-16
lines changed

basic_Info.plist

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>BuildMachineOSBuild</key>
6+
<string>18C54</string>
7+
<key>CFBundleDevelopmentRegion</key>
8+
<string>en</string>
9+
<key>CFBundleExecutable</key>
10+
<string>pythonA-kiwisolver</string>
11+
<key>CFBundleIdentifier</key>
12+
<string>Nicolas-Holzschuch.pythonA-kiwisolver</string>
13+
<key>CFBundleInfoDictionaryVersion</key>
14+
<string>6.0</string>
15+
<key>CFBundleName</key>
16+
<string>pythonA-kiwisolver</string>
17+
<key>CFBundlePackageType</key>
18+
<string>FMWK</string>
19+
<key>CFBundleShortVersionString</key>
20+
<string>1.0</string>
21+
<key>CFBundleSupportedPlatforms</key>
22+
<array>
23+
<string>iPhoneOS</string>
24+
</array>
25+
<key>CFBundleVersion</key>
26+
<string>1</string>
27+
<key>DTCompiler</key>
28+
<string>com.apple.compilers.llvm.clang.1_0</string>
29+
<key>DTPlatformBuild</key>
30+
<string>16B91</string>
31+
<key>DTPlatformName</key>
32+
<string>iphoneos</string>
33+
<key>DTPlatformVersion</key>
34+
<string>11.0</string>
35+
<key>DTSDKBuild</key>
36+
<string>16B91</string>
37+
<key>DTSDKName</key>
38+
<string>iphoneos11.0</string>
39+
<key>DTXcode</key>
40+
<string>1010</string>
41+
<key>DTXcodeBuild</key>
42+
<string>10B61</string>
43+
<key>MinimumOSVersion</key>
44+
<string>11.0</string>
45+
<key>UIDeviceFamily</key>
46+
<array>
47+
<integer>1</integer>
48+
<integer>2</integer>
49+
</array>
50+
<key>UIRequiredDeviceCapabilities</key>
51+
<array>
52+
<string>arm64</string>
53+
</array>
54+
</dict>
55+
</plist>

build_vim.sh

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#! /bin/sh
2+
# vim_cv_terminfo = ?? yes or no ?? If yes, will have to set it
3+
# vim_cv_stat_ignores_slash = unknown. Test with yes, rerun with no
4+
# All stuff with tgetent / terminfo will have to be hardcoded
5+
# tty_group too.
6+
# vim_cv_memmove_handles_overlap = set to no for safety
7+
# vim_cv_memcpy_handles_overlap = same
8+
9+
# -g2 for debugging
10+
11+
# 1) configure
12+
./configure vim_cv_toupper_broken=no vim_cv_terminfo=no vim_cv_tgetent=zero vim_cv_memmove_handles_overlap=no vim_cv_memcpy_handles_overlap=no vim_cv_bcopy_handles_overlap=no vim_cv_tty_group=world vim_cv_stat_ignores_slash=yes vim_cv_getcwd_broken=no LUA_PREFIX=${PWD} vi_cv_path_plain_lua=/usr/bin/lua vi_cv_version_plain_lua=5.3.4 --with-tlib=ncurses --with-features=big --enable-terminal --enable-luainterp --enable-python3interp --with-python3-command=python3 CC=clang CXX=clang++ CFLAGS="-DEXITFREE -arch arm64 -g2 -miphoneos-version-min=11.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/ -fembed-bitcode" CPPFLAGS="-DEXITFREE -arch arm64 -g2 -miphoneos-version-min=11.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/" CXXFLAGS="-DEXITFREE -arch arm64 -g2 -miphoneos-version-min=11.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/ -fembed-bitcode" LDFLAGS="-shared -arch arm64 -g2 -miphoneos-version-min=11.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/ " --build=x86_64-apple-darwin --host=armv7-apple-darwin
13+
14+
# 2) make. This creates ./src/vim, a Mach-O 64-bit dynamically linked shared library for arm64.
15+
make
16+
17+
# 3)
18+
echo "Creating: " Frameworks/vim.framework
19+
framework=vim
20+
libraryFile=src/vim
21+
rm -rf Frameworks/$framework.framework
22+
mkdir -p Frameworks/$framework.framework
23+
cp $libraryFile Frameworks/$framework.framework/$framework
24+
cp basic_Info.plist Frameworks/$framework.framework/Info.plist
25+
plutil -replace CFBundleExecutable -string $framework Frameworks/$framework.framework/Info.plist
26+
plutil -replace CFBundleName -string $framework Frameworks/$framework.framework/Info.plist
27+
# underscore is not allowed in CFBundleIdentifier:
28+
signature=${framework//_/-}
29+
plutil -replace CFBundleIdentifier -string Nicolas-Holzschuch.$signature Frameworks/$framework.framework/Info.plist
30+
install_name_tool -id @rpath/$framework.framework/$framework Frameworks/$framework.framework/$framework
31+
32+
33+
# DONE: add LDFLAGS
34+
# DONE: compile as dylib, not executable
35+
# DONE: add ios_system
36+
# DONE: test inside a-shell
37+
# DONE: forward input
38+
# DONE: remove -g2
39+
# DONE: replace fork with ios_fork, wait for streams.
40+
# DONE: provide missing termcap functions, from hterm POV
41+
# DONE: see termlib.c for help
42+
# TODO: add Python & Lua support (FEAT_PYTHON, FEAT_LUA...)
43+
# DONE: remove /bin/sh from shell commands

build_vim_simulator.sh

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#! /bin/sh
2+
# vim_cv_terminfo = ?? yes or no ?? If yes, will have to set it
3+
# vim_cv_stat_ignores_slash = unknown. Test with yes, rerun with no
4+
# All stuff with tgetent / terminfo will have to be hardcoded
5+
# tty_group too.
6+
# vim_cv_memmove_handles_overlap = set to no for safety
7+
# vim_cv_memcpy_handles_overlap = same
8+
9+
# 1) configure
10+
./configure vim_cv_toupper_broken=no vim_cv_terminfo=no vim_cv_tgetent=zero vim_cv_memmove_handles_overlap=no vim_cv_memcpy_handles_overlap=no vim_cv_bcopy_handles_overlap=no vim_cv_tty_group=world vim_cv_stat_ignores_slash=yes vim_cv_getcwd_broken=no --with-tlib=ncurses --with-features=big --enable-terminal CC=clang CXX=clang++ CFLAGS="-DEXITFREE -g2 -mios-simulator-version-min=11.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/ -fembed-bitcode" CPPFLAGS="-DEXITFREE -g2 -mios-simulator-version-min=11.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/" CXXFLAGS="-DEXITFREE -g2 -mios-simulator-version-min=11.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/ -fembed-bitcode" LDFLAGS="-g2 -shared -mios-simulator-version-min=11.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/ -fembed-bitcode" --build=x86_64-apple-darwin --host=armv7-apple-darwin
11+
12+
# 2) make. This creates ./src/vim, a Mach-O 64-bit dynamically linked shared library for arm64.
13+
make
14+
15+
# 3)
16+
echo "Creating: " Frameworks/vim.framework
17+
framework=vim
18+
libraryFile=src/vim
19+
rm -rf Frameworks/$framework.framework
20+
mkdir -p Frameworks/$framework.framework
21+
cp $libraryFile Frameworks/$framework.framework/$framework
22+
cp basic_Info.plist Frameworks/$framework.framework/Info.plist
23+
plutil -replace CFBundleExecutable -string $framework Frameworks/$framework.framework/Info.plist
24+
plutil -replace CFBundleName -string $framework Frameworks/$framework.framework/Info.plist
25+
# underscore is not allowed in CFBundleIdentifier:
26+
signature=${framework//_/-}
27+
plutil -replace CFBundleIdentifier -string Nicolas-Holzschuch.$signature Frameworks/$framework.framework/Info.plist
28+
install_name_tool -id @rpath/$framework.framework/$framework Frameworks/$framework.framework/$framework
29+
30+
31+
# DONE: add LDFLAGS
32+
# DONE: compile as dylib, not executable
33+
# DONE: add ios_system
34+
# DONE: test inside a-shell
35+
# DONE: forward input
36+
# DONE: memory issues (again)
37+
# DONE: remove tgetstr, tputs, etc;
38+
# DONE: replace fork with ios_fork, wait for streams.
39+
# DONE: provide missing termcap functions, from hterm POV
40+
# DONE: see termlib.c for help
41+
# TODO: add Python & Lua support (FEAT_PYTHON, FEAT_LUA...)
42+
# DONE: remove /bin/sh from shell commands
43+
# DONE: send resize events to vim, one way or another
44+
# TODO: avoid compose events in command mode. HOW? (sucks for everyone, though)
45+
# TODO: visual bell
46+
47+
# a-shell:
48+
# DONE: remove insert mode in hterm.html, always in overwrite
49+
# TODO: empjis need multiple characters. CJK works here, why not emojis?
50+
# TODO: move javascript out of hterm.html, into myown.js
51+
# Check that toolbar stays on always (?)
52+

include/lapi.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
** $Id: lapi.h,v 2.9 2015/03/06 19:49:50 roberto Exp $
3+
** Auxiliary functions from Lua API
4+
** See Copyright Notice in lua.h
5+
*/
6+
7+
#ifndef lapi_h
8+
#define lapi_h
9+
10+
11+
#include "llimits.h"
12+
#include "lstate.h"
13+
14+
#define api_incr_top(L) {L->top++; api_check(L, L->top <= L->ci->top, \
15+
"stack overflow");}
16+
17+
#define adjustresults(L,nres) \
18+
{ if ((nres) == LUA_MULTRET && L->ci->top < L->top) L->ci->top = L->top; }
19+
20+
#define api_checknelems(L,n) api_check(L, (n) < (L->top - L->ci->func), \
21+
"not enough elements in the stack")
22+
23+
24+
#endif

0 commit comments

Comments
 (0)