Skip to content

Commit

Permalink
updated ObjcBridge
Browse files Browse the repository at this point in the history
  • Loading branch information
stevedekorte committed Jul 14, 2011
1 parent 3500d5e commit 5ee63f3
Show file tree
Hide file tree
Showing 36 changed files with 13,172 additions and 155 deletions.
40 changes: 40 additions & 0 deletions MakeBinaryRelease.io
@@ -0,0 +1,40 @@
dynlibs := Directory with("addons") directories map(f,
r := nil
try(
r = f at("_build") at("dll") files select(name endsWithSeq(".dylib")) first
)
r
) select(!= nil)

depends := dynlibs map(dllFile,
lines := SystemCall clone setCommand("otool") setArguments(list("-L", dllFile path)) run stdout readLines
//foreach(println)
lines mapInPlace(beforeSeq("(") strip)
lines removeFirst
lines selectInPlace(beginsWithSeq("/"))
lines selectInPlace(beginsWithSeq("/usr/lib/") not)
lines selectInPlace(beginsWithSeq("/usr/local/lib/io/addons/") not)
lines selectInPlace(beginsWithSeq("/System/Library/") not)
if(lines isEmpty not,
writeln("\n", dllFile name, " needs: ")
lines foreach(line, writeln(" ", line))
)
lines
) flatten

external := Directory directoryNamed("_build") createSubdirectory("external")

installScript := external fileNamed("install.sh") remove open

depends foreach(depend,
writeln("copying ", depend, " to ", external path)
installScript write("cp ", Path with(external path, depend lastPathComponent), " ", depend, "\n");
SystemCall clone setCommand("cp") setArguments(list(depend, external path)) run stdout readLines
)
installScript close
SystemCall clone setCommand("chmod") setArguments(list("ug+x", installScript path)) run

/*
/opt/local/include/ncurses
*/
5 changes: 3 additions & 2 deletions README.txt
Expand Up @@ -23,9 +23,10 @@ Note: Assuming you wish to install to an alternate location, ensure you supply a

Ensure you are at the top level of the source tree, that is where this file lives. From here, you are in the right spot to enter these commands:

mkdir build && cd build
mkdir build
cd build
cmake ..
make install
sudo make install

If you do not wish to install, just run "make" instead of "make install". Currently there is no analogue to the old "make linkInstall". However, if you have used linkInstall in previous versions of Io, you should never have to run linkInstall again, since it created symbolic links to where your Io source was at that time. The only time you would have to do this again, is if you moved the Io source from one dir to another. Most people don't.

Expand Down
4 changes: 2 additions & 2 deletions addons/CMakeLists.txt
Expand Up @@ -54,7 +54,7 @@ add_subdirectory(Blowfish)
add_subdirectory(Box)
add_subdirectory(CFFI)
add_subdirectory(CGI)
add_subdirectory(Cairo)
#add_subdirectory(Cairo) # XXX: Broken on OSX: ld: library not found for -lpng12
add_subdirectory(Clutter)
add_subdirectory(ContinuedFraction)
add_subdirectory(Curses)
Expand All @@ -81,7 +81,7 @@ add_subdirectory(MySQL)
add_subdirectory(NotificationCenter)
#add_subdirectory(Oauth) # OAuth should no longer break CMake configuration on Windows now.
#add_subdirectory(ODE) # XXX: Can't meet dependencies
#add_subdirectory(ObjcBridge) # XXX: Broken for me -- Objective-C 2.0 not supported
add_subdirectory(ObjcBridge) # XXX: Broken for me -- Objective-C 2.0 not supported
add_subdirectory(Obsidian)
add_subdirectory(Ogg)
add_subdirectory(OpenGL)
Expand Down
Binary file added addons/Cairo/samples/fillAndStroke2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions addons/ObjcBridge/CMakeLists.txt
@@ -0,0 +1,42 @@


# Builds the ObjcBridge addon

# Create the _build bundle hierarchy if needed.
make_build_bundle(_build)


# Output our dynamic library to the top-level _build hierarchy
set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/_build/dll)


# Generate the IoObjcBridgeInit.c file.
# Argument SHOULD ALWAYS be the exact name of the addon, case is important.
generate_ioinit(ObjcBridge)


# Additional include directories
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/../Box/source
)

# Our library sources.
set(SRCS
"${CMAKE_CURRENT_SOURCE_DIR}/source/Io2Objc.m"
"${CMAKE_CURRENT_SOURCE_DIR}/source/IoObjcBridge.m"
"${CMAKE_CURRENT_SOURCE_DIR}/source/IoObjcBridgeInit.m"
"${CMAKE_CURRENT_SOURCE_DIR}/source/Objc2Io.m"
"${CMAKE_CURRENT_SOURCE_DIR}/source/ObjcSubclass.m"
"${CMAKE_CURRENT_SOURCE_DIR}/source/Runtime.m"
)

set(CMAKE_EXE_LINKER_FLAGS "-framework AppKit")

# Now build the shared library
add_library(IoObjcBridge SHARED ${SRCS})
add_dependencies(IoObjcBridge iovmall Foundation IoBox)
target_link_libraries(IoObjcBridge iovmall ${ObjcBridge_LIBRARY} IoBox /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit)

# Install the addon to our global addons hierarchy.
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION lib/io/addons)
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/_build DESTINATION lib/io/addons/ObjcBridge)

This file was deleted.

0 comments on commit 5ee63f3

Please sign in to comment.