Merge branch 'cocotron'

This commit is contained in:
Sergey Bugaev 2017-07-22 19:34:34 +03:00
commit 32aefdd7dd
20 changed files with 68 additions and 191 deletions

9
.gitmodules vendored
View File

@ -79,9 +79,6 @@
[submodule "src/external/adv_cmds"]
path = src/external/adv_cmds
url = ../darling-adv_cmds.git
[submodule "src/external/AppKit"]
path = src/external/AppKit
url = ../darling-appkit.git
[submodule "src/external/nano"]
path = src/external/nano
url = ../darling-nano.git
@ -190,9 +187,6 @@
[submodule "src/external/configd"]
path = src/external/configd
url = ../darling-configd.git
[submodule "src/external/coregraphics"]
path = src/external/coregraphics
url = ../darling-coregraphics.git
[submodule "src/external/IONetworkingFamily"]
path = src/external/IONetworkingFamily
url = ../darling-IONetworkingFamily.git
@ -242,6 +236,9 @@
[submodule "src/external/Heimdal"]
path = src/external/Heimdal
url = ../darling-Heimdal.git
[submodule "src/external/cocotron"]
path = src/external/cocotron
url = ../darling-cocotron.git
[submodule "src/external/libtelnet"]
path = src/external/libtelnet
url = ../darling-libtelnet.git

View File

@ -3,7 +3,7 @@ include(darling_lib)
include(InstallSymlink)
function(add_framework name)
cmake_parse_arguments(FRAMEWORK "CURRENT_VERSION;FAT;PRIVATE" "VERSION;LINK_FLAGS" "SOURCES;DEPENDENCIES" ${ARGN})
cmake_parse_arguments(FRAMEWORK "CURRENT_VERSION;FAT;PRIVATE" "VERSION;LINK_FLAGS" "SOURCES;DEPENDENCIES;CIRCULAR_DEPENDENCIES" ${ARGN})
if (FRAMEWORK_CURRENT_VERSION)
set(my_name "${name}")
else (FRAMEWORK_CURRENT_VERSION)
@ -17,7 +17,28 @@ function(add_framework name)
endif (FRAMEWORK_PRIVATE)
set(DYLIB_INSTALL_NAME "/System/Library/${dir_name}/${name}.framework/Versions/${FRAMEWORK_VERSION}/${name}")
add_darling_library(${my_name} SHARED ${FRAMEWORK_SOURCES})
if (FRAMEWORK_CIRCULAR_DEPENDENCIES)
if (FRAMEWORK_FAT)
set (FRAMEWORK_FAT_ARG FAT)
else (FRAMEWORK_FAT)
set (FRAMEWORK_FAT_ARG)
endif (FRAMEWORK_FAT)
add_circular(${my_name}
${FRAMEWORK_FAT_ARG}
SOURCES ${FRAMEWORK_SOURCES}
SIBLINGS ${FRAMEWORK_CIRCULAR_DEPENDENCIES})
else (FRAMEWORK_CIRCULAR_DEPENDENCIES)
add_darling_library(${my_name} SHARED ${FRAMEWORK_SOURCES})
if (FRAMEWORK_FAT)
make_fat(${my_name})
endif (FRAMEWORK_FAT)
endif (FRAMEWORK_CIRCULAR_DEPENDENCIES)
if (FRAMEWORK_CURRENT_VERSION)
add_library("${name}_${FRAMEWORK_VERSION}" ALIAS "${name}")
@ -32,10 +53,6 @@ function(add_framework name)
target_link_libraries(${my_name} PRIVATE ${FRAMEWORK_DEPENDENCIES})
endif (FRAMEWORK_DEPENDENCIES)
if (FRAMEWORK_FAT)
make_fat(${my_name})
endif (FRAMEWORK_FAT)
if (FRAMEWORK_LINK_FLAGS)
set_property(TARGET ${my_name} APPEND_STRING PROPERTY LINK_FLAGS " ${FRAMEWORK_LINK_FLAGS}")
endif (FRAMEWORK_LINK_FLAGS)

View File

@ -122,13 +122,13 @@ include_directories(AFTER
${CMAKE_CURRENT_SOURCE_DIR}/libnotify/include
${CMAKE_CURRENT_SOURCE_DIR}/opendirectory/include
${CMAKE_CURRENT_SOURCE_DIR}/external/commoncrypto/include
${CMAKE_CURRENT_SOURCE_DIR}/external/coregraphics/Headers
${CMAKE_CURRENT_SOURCE_DIR}/quarantine/include
${CMAKE_CURRENT_SOURCE_DIR}/copyfile/include
${CMAKE_CURRENT_SOURCE_DIR}/external/zlib/include
${CMAKE_CURRENT_SOURCE_DIR}/xar/include
${CMAKE_CURRENT_SOURCE_DIR}/external/DirectoryService/include
${CMAKE_CURRENT_SOURCE_DIR}/DiskImages/include
${CMAKE_CURRENT_SOURCE_DIR}/external/cocotron
)
add_subdirectory(external/libkqueue)
@ -215,6 +215,8 @@ add_subdirectory(DiskImages)
add_subdirectory(PackageKit)
#add_subdirectory(Cocoa)
add_subdirectory(native)
add_subdirectory(external/file/file)
add_subdirectory(external/libxpc)
add_subdirectory(external/openssl_certificates)
@ -284,3 +286,11 @@ add_subdirectory(external/libcxx)
add_subdirectory(external/cctools)
add_subdirectory(lkm)
add_subdirectory(external/cocotron/CoreGraphics)
add_subdirectory(external/cocotron/Onyx2D)
add_subdirectory(external/cocotron/AppKit)
add_subdirectory(external/cocotron/CoreText)
add_subdirectory(external/cocotron/QuartzCore)
add_subdirectory(external/cocotron/OpenGL)
add_subdirectory(external/cocotron/CoreData)

View File

@ -33,7 +33,7 @@ extern "C" {
#define FSRef_MAX_DEPTH (80 / sizeof(ino_t))
struct FSRef
typedef struct FSRef
{
union
{
@ -46,7 +46,7 @@ struct FSRef
// sequence 1,2,0: [dir with inode 1]/[dir or file with inode 2]
ino_t inodes[FSRef_MAX_DEPTH];
};
};
} FSRef;
typedef struct FSRef* FSRefPtr;
typedef struct FSRef FSRef;

View File

@ -37,7 +37,7 @@ enum
kLSLaunchHasUntrustedContents = 0x00400000
};
struct LSApplicationParameters
typedef struct LSApplicationParameters
{
CFIndex version;
LSLaunchFlags flags;
@ -46,8 +46,7 @@ struct LSApplicationParameters
CFDictionaryRef environment;
CFArrayRef argv;
AppleEvent * initialEvent;
};
typedef struct LSApplicationParameters LSApplicationParameters;
} LSApplicationParameters;
OSStatus LSInit(LSInitializeFlags flags);
OSStatus LSTerm(void);

View File

@ -1,9 +1,9 @@
#ifndef CVBASE_H
#define CVBASE_H
#include <stdint.h>
#include <CoreServices/MacTypes.h>
#include <MacTypes.h>
struct CVSMPTETime
typedef struct CVSMPTETime
{
SInt16 subframes;
SInt16 subframeDivisor;
@ -14,10 +14,10 @@ struct CVSMPTETime
SInt16 minutes;
SInt16 seconds;
SInt16 frames;
};
} CVSMPTETime;
struct CVTimeStamp
typedef struct CVTimeStamp
{
uint32_t version;
int32_t videoTimeScale;
@ -28,7 +28,7 @@ struct CVTimeStamp
CVSMPTETime smpteTime;
uint64_t flags;
uint64_t reserved;
};
} CVTimeStamp;
#endif

View File

@ -1,18 +1,20 @@
#ifndef COREVIDEO_H
#define COREVIDEO_H
#include <CoreServices/MacTypes.h>
#include <MacTypes.h>
#include "CVBase.h"
#include <OpenGL/CGLTypes.h>
#include "CVReturn.h"
class CVDisplayLink;
struct CVDisplayLink;
typedef CVDisplayLink* CVDisplayLinkRef;
typedef struct CVDisplayLink* CVDisplayLinkRef;
typedef UInt32 CVOptionFlags;
typedef CVReturn (*CVDisplayLinkOutputCallback)(CVDisplayLinkRef displayLink, const CVTimeStamp *inNow, const CVTimeStamp *inOutputTime, CVOptionFlags flagsIn, CVOptionFlags *flagsOut, void *displayLinkContext);
#ifdef __cplusplus
extern "C" {
#endif
CVReturn CVDisplayLinkCreateWithActiveCGDisplays(CVDisplayLinkRef* displayLinkOut);
@ -25,7 +27,9 @@ void CVDisplayLinkRelease(CVDisplayLinkRef displayLink);
CVReturn CVDisplayLinkSetOutputCallback(CVDisplayLinkRef displayLink, CVDisplayLinkOutputCallback callback, void *userInfo);
CVReturn CVDisplayLinkSetCurrentCGDisplayFromOpenGLContext(CVDisplayLinkRef displayLink, CGLContextObj cglContext, CGLPixelFormatObj cglPixelFormat);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,16 +0,0 @@
#ifndef CGLCONTEXT_H
#define CGLCONTEXT_H
class CGLContextImpl;
struct CGLContext
{
void* rend;
void* disp;
CGLContextImpl* priv;
void* stak;
};
#endif

View File

@ -1,27 +0,0 @@
#include "CGLContextImpl.h"
CGLContextImpl::CGLContextImpl()
{
pthread_mutexattr_t mta;
pthread_mutexattr_init(&mta);
pthread_mutexattr_settype(&mta, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init(&m_lock, &mta);
}
CGLContextImpl::~CGLContextImpl()
{
pthread_mutex_destroy(&m_lock);
}
void CGLContextImpl::lock()
{
pthread_mutex_lock(&m_lock);
}
void CGLContextImpl::unlock()
{
pthread_mutex_unlock(&m_lock);
}

View File

@ -1,18 +0,0 @@
#ifndef CGLCONTEXTIMPL_H
#define CGLCONTEXTIMPL_H
#include <pthread.h>
class CGLContextImpl
{
public:
CGLContextImpl();
virtual ~CGLContextImpl();
void lock();
void unlock();
private:
pthread_mutex_t m_lock;
};
#endif

View File

@ -1,33 +0,0 @@
#ifndef CGLTYPES_H
#define CGLTYPES_H
#include "CGLContext.h"
typedef CGLContext* CGLContextObj;
typedef struct CGLPixelFormat* CGLPixelFormatObj;
enum CGLError
{
kCGLNoError = 0,
kCGLBadAttribute = 10000,
kCGLBadProperty = 10001,
kCGLBadPixelFormat = 10002,
kCGLBadRendererInfo = 10003,
kCGLBadContext = 10004,
kCGLBadDrawable = 10005,
kCGLBadDisplay = 10006,
kCGLBadState = 10007,
kCGLBadValue = 10008,
kCGLBadMatch = 10009,
kCGLBadEnumeration = 10010,
kCGLBadOffScreen = 10011,
kCGLBadFullScreen = 10012,
kCGLBadWindow = 10013,
kCGLBadAddress = 10014,
kCGLBadCodeModule = 10015,
kCGLBadAlloc = 10016,
kCGLBadConnection = 10017
};
#endif

View File

@ -1,29 +0,0 @@
project(OpenGL)
cmake_minimum_required(VERSION 2.4.0)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
#configure_file(config.h.in config.h)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../util)
set(OpenGL_SRCS
CGLContextImpl.cpp
OpenGL.cpp
)
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/darling")
#SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--enable-new-dtags")
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
add_library(OpenGL SHARED ${OpenGL_SRCS})
target_link_libraries(OpenGL util -lGL)
install(TARGETS OpenGL DESTINATION "${CMAKE_INSTALL_LIBDIR}/darling")

View File

@ -1,24 +0,0 @@
#include "CGLTypes.h"
#include "CGLContext.h"
#include "CGLContextImpl.h"
CGLError CGLLockContext(CGLContextObj context)
{
if (!context)
return kCGLBadContext;
context->priv->lock();
return kCGLNoError;
}
CGLError CGLUnlockContext(CGLContextObj context)
{
if (!context)
return kCGLBadContext;
context->priv->unlock();
return kCGLNoError;
}

View File

@ -1,14 +0,0 @@
#ifndef OPENGL_H
#define OPENGL_H
#include "CGLContext.h"
#include "CGLTypes.h"
extern "C" {
CGLError CGLLockContext(CGLContextObj context);
CGLError CGLUnlockContext(CGLContextObj context);
}
#endif

1
src/external/AppKit vendored

@ -1 +0,0 @@
Subproject commit 630cbd2151f8d3ac715bca27ce71c5e7625b9647

1
src/external/cocotron vendored Submodule

@ -0,0 +1 @@
Subproject commit 0e8e8c38dac893be5d7ee5204e4218e59dc2009c

@ -1 +1 @@
Subproject commit 9de0090c8ed5255fd0b46b48608334b1dd27aad9
Subproject commit 6e42b5d43c10608a522388f9dba455d542107565

@ -1 +0,0 @@
Subproject commit 4fdbcaf767745c95ca528b7e96a66b9bf29303ac

@ -1 +1 @@
Subproject commit 5588dbde41e88182fdc3759764403e3b3331619f
Subproject commit 5900405a501919fb2157c5cfc6591a0e32e3d590

12
src/native/CMakeLists.txt Normal file
View File

@ -0,0 +1,12 @@
project(native)
include(wrap_elf)
wrap_elf(FreeType libfreetype.so)
wrap_elf(jpeg libjpeg.so)
wrap_elf(png libpng.so)
wrap_elf(tiff libtiff.so)
wrap_elf(X11 libX11.so)
wrap_elf(cairo libcairo.so)
wrap_elf(GL libGL.so)
wrap_elf(fontconfig libfontconfig.so)