From 31c1afa6ce8d4f19fafccdae36c7863f8e79ea6e Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Mon, 24 Apr 2017 22:35:11 +0300 Subject: [PATCH 01/18] Add Cocotron, remove old AppKit, CoreGraphics and OpenGL --- .gitmodules | 9 +++------ src/OpenGL/CGLContext.h | 16 ---------------- src/OpenGL/CGLContextImpl.cpp | 27 --------------------------- src/OpenGL/CGLContextImpl.h | 18 ------------------ src/OpenGL/CGLTypes.h | 33 --------------------------------- src/OpenGL/CMakeLists.txt | 29 ----------------------------- src/OpenGL/OpenGL.cpp | 24 ------------------------ src/OpenGL/OpenGL.h | 14 -------------- src/external/AppKit | 1 - src/external/cocotron | 1 + src/external/coregraphics | 1 - 11 files changed, 4 insertions(+), 169 deletions(-) delete mode 100644 src/OpenGL/CGLContext.h delete mode 100644 src/OpenGL/CGLContextImpl.cpp delete mode 100644 src/OpenGL/CGLContextImpl.h delete mode 100644 src/OpenGL/CGLTypes.h delete mode 100644 src/OpenGL/CMakeLists.txt delete mode 100644 src/OpenGL/OpenGL.cpp delete mode 100644 src/OpenGL/OpenGL.h delete mode 160000 src/external/AppKit create mode 160000 src/external/cocotron delete mode 160000 src/external/coregraphics diff --git a/.gitmodules b/.gitmodules index 01a03b914..f8904c7b6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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,3 +236,6 @@ [submodule "src/external/Heimdal"] path = src/external/Heimdal url = ../darling-Heimdal.git +[submodule "src/external/cocotron"] + path = src/external/cocotron + url = ../darling-cocotron.git diff --git a/src/OpenGL/CGLContext.h b/src/OpenGL/CGLContext.h deleted file mode 100644 index 8b5997adc..000000000 --- a/src/OpenGL/CGLContext.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef CGLCONTEXT_H -#define CGLCONTEXT_H - -class CGLContextImpl; - -struct CGLContext -{ - void* rend; - void* disp; - CGLContextImpl* priv; - void* stak; -}; - - -#endif - diff --git a/src/OpenGL/CGLContextImpl.cpp b/src/OpenGL/CGLContextImpl.cpp deleted file mode 100644 index fc7a82b38..000000000 --- a/src/OpenGL/CGLContextImpl.cpp +++ /dev/null @@ -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); -} - diff --git a/src/OpenGL/CGLContextImpl.h b/src/OpenGL/CGLContextImpl.h deleted file mode 100644 index 9325578a6..000000000 --- a/src/OpenGL/CGLContextImpl.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef CGLCONTEXTIMPL_H -#define CGLCONTEXTIMPL_H -#include - -class CGLContextImpl -{ -public: - CGLContextImpl(); - virtual ~CGLContextImpl(); - - void lock(); - void unlock(); -private: - pthread_mutex_t m_lock; -}; - -#endif - diff --git a/src/OpenGL/CGLTypes.h b/src/OpenGL/CGLTypes.h deleted file mode 100644 index 785b1cec6..000000000 --- a/src/OpenGL/CGLTypes.h +++ /dev/null @@ -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 - diff --git a/src/OpenGL/CMakeLists.txt b/src/OpenGL/CMakeLists.txt deleted file mode 100644 index b0a4751c7..000000000 --- a/src/OpenGL/CMakeLists.txt +++ /dev/null @@ -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") - diff --git a/src/OpenGL/OpenGL.cpp b/src/OpenGL/OpenGL.cpp deleted file mode 100644 index e302066e1..000000000 --- a/src/OpenGL/OpenGL.cpp +++ /dev/null @@ -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; -} - diff --git a/src/OpenGL/OpenGL.h b/src/OpenGL/OpenGL.h deleted file mode 100644 index f102b53ac..000000000 --- a/src/OpenGL/OpenGL.h +++ /dev/null @@ -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 - diff --git a/src/external/AppKit b/src/external/AppKit deleted file mode 160000 index 630cbd215..000000000 --- a/src/external/AppKit +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 630cbd2151f8d3ac715bca27ce71c5e7625b9647 diff --git a/src/external/cocotron b/src/external/cocotron new file mode 160000 index 000000000..581eb57ca --- /dev/null +++ b/src/external/cocotron @@ -0,0 +1 @@ +Subproject commit 581eb57caddc72e2421795380ca8af9b8c09bb2f diff --git a/src/external/coregraphics b/src/external/coregraphics deleted file mode 160000 index 4fdbcaf76..000000000 --- a/src/external/coregraphics +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4fdbcaf767745c95ca528b7e96a66b9bf29303ac From 880891f2c6cb0b2042d109282149b38495fa6108 Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Mon, 24 Apr 2017 22:40:22 +0300 Subject: [PATCH 02/18] CoreServices fixes --- src/CoreServices/Components.h | 4 ++-- src/CoreServices/FileManager.h | 4 ++-- src/CoreServices/LaunchServices.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/CoreServices/Components.h b/src/CoreServices/Components.h index df89d30c8..c1d4ac0ba 100644 --- a/src/CoreServices/Components.h +++ b/src/CoreServices/Components.h @@ -6,9 +6,9 @@ class CarbonComponent; #else struct __CarbonComponent; -typedef CarbonComponent struct __CarbonComponent; +typedef struct __CarbonComponent CarbonComponent; #endif -struct ComponentDescription; +typedef struct ComponentDescription ComponentDescription; typedef CarbonComponent* ComponentInstance; typedef void* Component; diff --git a/src/CoreServices/FileManager.h b/src/CoreServices/FileManager.h index 8ccbc85bf..1d86e773a 100644 --- a/src/CoreServices/FileManager.h +++ b/src/CoreServices/FileManager.h @@ -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; struct HFSUniStr255 diff --git a/src/CoreServices/LaunchServices.h b/src/CoreServices/LaunchServices.h index 698db85d9..5def88d67 100644 --- a/src/CoreServices/LaunchServices.h +++ b/src/CoreServices/LaunchServices.h @@ -37,7 +37,7 @@ enum kLSLaunchHasUntrustedContents = 0x00400000 }; -struct LSApplicationParameters +typedef struct LSApplicationParameters { CFIndex version; LSLaunchFlags flags; @@ -46,7 +46,7 @@ struct LSApplicationParameters CFDictionaryRef environment; CFArrayRef argv; AppleEvent * initialEvent; -}; +} LSApplicationParameters; OSStatus LSInit(LSInitializeFlags flags); OSStatus LSTerm(void); From eeae63569b4466648f5fdc72bca48466e87628a2 Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Mon, 24 Apr 2017 22:41:43 +0300 Subject: [PATCH 03/18] Work on building CoreGraphics --- platform-include/CoreGraphics | 2 +- src/CMakeLists.txt | 1 + src/external/corefoundation | 2 +- src/external/foundation | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/platform-include/CoreGraphics b/platform-include/CoreGraphics index f51e7c668..0cb637935 120000 --- a/platform-include/CoreGraphics +++ b/platform-include/CoreGraphics @@ -1 +1 @@ -../src/external/coregraphics/Headers/CoreGraphics/ \ No newline at end of file +../src/external/cocotron/CoreGraphics \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 90f0e69e7..fb7562175 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -201,4 +201,5 @@ add_subdirectory(external/libcxxabi) add_subdirectory(external/libcxx) add_subdirectory(lkm) +add_subdirectory(external/cocotron/CoreGraphics) diff --git a/src/external/corefoundation b/src/external/corefoundation index 9f7c99bb2..ac9c584e9 160000 --- a/src/external/corefoundation +++ b/src/external/corefoundation @@ -1 +1 @@ -Subproject commit 9f7c99bb2ba8d585b3eef72f322d39554b507c29 +Subproject commit ac9c584e97b17360d2711640c63e88aa0b12b7f4 diff --git a/src/external/foundation b/src/external/foundation index b3b4649f7..94a649b0f 160000 --- a/src/external/foundation +++ b/src/external/foundation @@ -1 +1 @@ -Subproject commit b3b4649f7af68e58cc71c61b946bfe34a59353d5 +Subproject commit 94a649b0f1d812ea7fc7772fcdc1e9dafc8a0250 From 4027c77ddb44ebc445baec7c3f935756943635df Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Tue, 25 Apr 2017 12:03:01 +0300 Subject: [PATCH 04/18] Create a subdirectory for wrapped native libraries --- src/CMakeLists.txt | 2 ++ src/native/CMakeLists.txt | 8 ++++++++ 2 files changed, 10 insertions(+) create mode 100644 src/native/CMakeLists.txt diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fb7562175..ad52249c4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -153,6 +153,8 @@ add_subdirectory(sandbox) add_subdirectory(xcselect) #add_subdirectory(Cocoa) +add_subdirectory(native) + add_subdirectory(external/file/file) add_subdirectory(external/libxpc) add_subdirectory(external/openssl_certificates) diff --git a/src/native/CMakeLists.txt b/src/native/CMakeLists.txt new file mode 100644 index 000000000..b703de537 --- /dev/null +++ b/src/native/CMakeLists.txt @@ -0,0 +1,8 @@ +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) From 8ac24b9feb639fff0b6d02bdfa82d562e470ab3c Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Tue, 25 Apr 2017 12:14:36 +0300 Subject: [PATCH 05/18] Onyx2D buils (but does not link yet) --- src/CMakeLists.txt | 2 +- src/external/cocotron | 2 +- src/external/foundation | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ad52249c4..1f528b5c8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -204,4 +204,4 @@ add_subdirectory(external/libcxx) add_subdirectory(lkm) add_subdirectory(external/cocotron/CoreGraphics) - +add_subdirectory(external/cocotron/Onyx2D) diff --git a/src/external/cocotron b/src/external/cocotron index 581eb57ca..2851c0148 160000 --- a/src/external/cocotron +++ b/src/external/cocotron @@ -1 +1 @@ -Subproject commit 581eb57caddc72e2421795380ca8af9b8c09bb2f +Subproject commit 2851c01488fd8548a9a18213114f43ee3d282b85 diff --git a/src/external/foundation b/src/external/foundation index 94a649b0f..918b7d677 160000 --- a/src/external/foundation +++ b/src/external/foundation @@ -1 +1 @@ -Subproject commit 94a649b0f1d812ea7fc7772fcdc1e9dafc8a0250 +Subproject commit 918b7d677274a8163d13c4ced6e8238bfaa957c9 From eb242d2bd05b1873519b15e4e9abbae793b0758c Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Sat, 29 Apr 2017 20:02:24 +0300 Subject: [PATCH 06/18] CoreGraphics and Onyx2D both linking --- src/external/cocotron | 2 +- src/external/foundation | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/external/cocotron b/src/external/cocotron index 2851c0148..b3c5dc0b6 160000 --- a/src/external/cocotron +++ b/src/external/cocotron @@ -1 +1 @@ -Subproject commit 2851c01488fd8548a9a18213114f43ee3d282b85 +Subproject commit b3c5dc0b6aae10c52bdb083227ca28e4f5ddbf05 diff --git a/src/external/foundation b/src/external/foundation index 918b7d677..999f3cc92 160000 --- a/src/external/foundation +++ b/src/external/foundation @@ -1 +1 @@ -Subproject commit 918b7d677274a8163d13c4ced6e8238bfaa957c9 +Subproject commit 999f3cc92f10c151ab8ebfd2d3554938081d81c9 From 0a9663b0db8292f83102e3563cbb1f012a809f1f Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Sun, 9 Jul 2017 12:39:19 +0300 Subject: [PATCH 07/18] Add cocotron to includes --- platform-include/CoreGraphics | 1 - src/CMakeLists.txt | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) delete mode 120000 platform-include/CoreGraphics diff --git a/platform-include/CoreGraphics b/platform-include/CoreGraphics deleted file mode 120000 index 0cb637935..000000000 --- a/platform-include/CoreGraphics +++ /dev/null @@ -1 +0,0 @@ -../src/external/cocotron/CoreGraphics \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d3aac4ef0..a97ced6a6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -120,12 +120,12 @@ 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}/external/cocotron ) add_subdirectory(external/libkqueue) From 5723dcb58d9dcb262cc01962b9738bbf0b0d445e Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Sun, 9 Jul 2017 14:36:32 +0300 Subject: [PATCH 08/18] Work on building AppKit --- src/CMakeLists.txt | 1 + src/external/cocotron | 2 +- src/external/foundation | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a97ced6a6..6d1970e75 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -285,3 +285,4 @@ add_subdirectory(lkm) add_subdirectory(external/cocotron/CoreGraphics) add_subdirectory(external/cocotron/Onyx2D) +add_subdirectory(external/cocotron/AppKit) diff --git a/src/external/cocotron b/src/external/cocotron index b3c5dc0b6..f3a48d7aa 160000 --- a/src/external/cocotron +++ b/src/external/cocotron @@ -1 +1 @@ -Subproject commit b3c5dc0b6aae10c52bdb083227ca28e4f5ddbf05 +Subproject commit f3a48d7aa3da8e935cbc7f470ea42052fdfd6b01 diff --git a/src/external/foundation b/src/external/foundation index 53ad1bded..c259e1d98 160000 --- a/src/external/foundation +++ b/src/external/foundation @@ -1 +1 @@ -Subproject commit 53ad1bdede8c8a473938adc9d1b6c5a718e713d5 +Subproject commit c259e1d98edd5144914d707769c3fae0d180cd93 From dccbe394d14f7c6483bb14bc5510f93232f7f527 Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Sun, 9 Jul 2017 21:22:36 +0300 Subject: [PATCH 09/18] More work on AppKit --- src/external/cocotron | 2 +- src/external/foundation | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/external/cocotron b/src/external/cocotron index f3a48d7aa..4b245db06 160000 --- a/src/external/cocotron +++ b/src/external/cocotron @@ -1 +1 @@ -Subproject commit f3a48d7aa3da8e935cbc7f470ea42052fdfd6b01 +Subproject commit 4b245db06f157e418e559f9ff426a8d3c5f615e9 diff --git a/src/external/foundation b/src/external/foundation index c259e1d98..fe8ea1145 160000 --- a/src/external/foundation +++ b/src/external/foundation @@ -1 +1 @@ -Subproject commit c259e1d98edd5144914d707769c3fae0d180cd93 +Subproject commit fe8ea11454b4cc494d9eefe2f358b512ec12177b From 11b18dd96df40faee8b2b999c41063a0d74d029a Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Tue, 11 Jul 2017 00:42:12 +0300 Subject: [PATCH 10/18] AppKit building, but not linking yet --- src/CoreVideo/CVBase.h | 10 +++++----- src/CoreVideo/CoreVideo.h | 10 +++++++--- src/external/cocotron | 2 +- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/CoreVideo/CVBase.h b/src/CoreVideo/CVBase.h index 229b13cc1..2c9911f38 100644 --- a/src/CoreVideo/CVBase.h +++ b/src/CoreVideo/CVBase.h @@ -1,9 +1,9 @@ #ifndef CVBASE_H #define CVBASE_H #include -#include +#include -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 diff --git a/src/CoreVideo/CoreVideo.h b/src/CoreVideo/CoreVideo.h index 99085f8b5..8151a1aac 100644 --- a/src/CoreVideo/CoreVideo.h +++ b/src/CoreVideo/CoreVideo.h @@ -1,18 +1,20 @@ #ifndef COREVIDEO_H #define COREVIDEO_H -#include +#include #include "CVBase.h" #include #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 diff --git a/src/external/cocotron b/src/external/cocotron index 4b245db06..b658debcd 160000 --- a/src/external/cocotron +++ b/src/external/cocotron @@ -1 +1 @@ -Subproject commit 4b245db06f157e418e559f9ff426a8d3c5f615e9 +Subproject commit b658debcd649491a834e1c28de82773d285496fa From fd465043772e137838e738f9a0c619429f8e4c52 Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Tue, 11 Jul 2017 01:15:08 +0300 Subject: [PATCH 11/18] Add a few dependencies to the AppKit --- src/external/cocotron | 2 +- src/native/CMakeLists.txt | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/external/cocotron b/src/external/cocotron index b658debcd..07e6148d3 160000 --- a/src/external/cocotron +++ b/src/external/cocotron @@ -1 +1 @@ -Subproject commit b658debcd649491a834e1c28de82773d285496fa +Subproject commit 07e6148d30d97cd962d9fb2743b1eb4a6351289a diff --git a/src/native/CMakeLists.txt b/src/native/CMakeLists.txt index b703de537..18e04e41e 100644 --- a/src/native/CMakeLists.txt +++ b/src/native/CMakeLists.txt @@ -6,3 +6,6 @@ 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) From 694e16d47dcfc469675dc16fc770afde0285dd7f Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Thu, 13 Jul 2017 00:47:22 +0300 Subject: [PATCH 12/18] QuartzCore building, CoreText building and linking --- src/CMakeLists.txt | 2 ++ src/external/cocotron | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6d1970e75..9aec681b5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -286,3 +286,5 @@ 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) diff --git a/src/external/cocotron b/src/external/cocotron index 07e6148d3..934f06791 160000 --- a/src/external/cocotron +++ b/src/external/cocotron @@ -1 +1 @@ -Subproject commit 07e6148d30d97cd962d9fb2743b1eb4a6351289a +Subproject commit 934f06791312e933fa037daf7b37151227913e81 From 3572130c07db23df43d55b3c8a734d6e60d66498 Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Thu, 13 Jul 2017 01:07:49 +0300 Subject: [PATCH 13/18] Actually wrap libfontconfig --- src/native/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/native/CMakeLists.txt b/src/native/CMakeLists.txt index 18e04e41e..c8a8ef2b0 100644 --- a/src/native/CMakeLists.txt +++ b/src/native/CMakeLists.txt @@ -9,3 +9,4 @@ 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) From 79bd5266509951fa1cb3dbf9d4066e3c311a8232 Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Fri, 14 Jul 2017 00:39:29 +0300 Subject: [PATCH 14/18] Support circular dependencies between frameworks --- cmake/darling_framework.cmake | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/cmake/darling_framework.cmake b/cmake/darling_framework.cmake index 4c9d5020e..d0005f9c8 100644 --- a/cmake/darling_framework.cmake +++ b/cmake/darling_framework.cmake @@ -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) From 4ccfa67c64da128ef92c627d019cd67e629c7f51 Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Fri, 14 Jul 2017 00:40:14 +0300 Subject: [PATCH 15/18] Build OpenGL & other improvements in Cocotron --- src/CMakeLists.txt | 1 + src/external/cocotron | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9aec681b5..2ada6769c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -288,3 +288,4 @@ 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) diff --git a/src/external/cocotron b/src/external/cocotron index 934f06791..74900145c 160000 --- a/src/external/cocotron +++ b/src/external/cocotron @@ -1 +1 @@ -Subproject commit 934f06791312e933fa037daf7b37151227913e81 +Subproject commit 74900145cc2620d4d61811262469e348df1494b9 From 16f274f77adb60fd67e39df7fd44a86711ee6547 Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Fri, 21 Jul 2017 21:30:03 +0300 Subject: [PATCH 16/18] Build CoreData --- src/CMakeLists.txt | 1 + src/external/cocotron | 2 +- src/external/foundation | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2ada6769c..496767740 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -289,3 +289,4 @@ 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) diff --git a/src/external/cocotron b/src/external/cocotron index 74900145c..eedc7cb84 160000 --- a/src/external/cocotron +++ b/src/external/cocotron @@ -1 +1 @@ -Subproject commit 74900145cc2620d4d61811262469e348df1494b9 +Subproject commit eedc7cb844811ac05c00f98a2d833cd67f4584f3 diff --git a/src/external/foundation b/src/external/foundation index fe8ea1145..402875b97 160000 --- a/src/external/foundation +++ b/src/external/foundation @@ -1 +1 @@ -Subproject commit fe8ea11454b4cc494d9eefe2f358b512ec12177b +Subproject commit 402875b97ed98fa8f51d46b75b4651b8be8cca42 From a88a6757a02b2cf69eb9c69a889c54f657ab3a4b Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Sat, 22 Jul 2017 11:08:30 +0300 Subject: [PATCH 17/18] Integrate Cocotron's NSPlatform and NSThread additions to Foundation, build NSOpenGLContext --- src/external/cocotron | 2 +- src/external/foundation | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/external/cocotron b/src/external/cocotron index eedc7cb84..ba44d6160 160000 --- a/src/external/cocotron +++ b/src/external/cocotron @@ -1 +1 @@ -Subproject commit eedc7cb844811ac05c00f98a2d833cd67f4584f3 +Subproject commit ba44d616012ba68deb606a4e48b6a6587835b25a diff --git a/src/external/foundation b/src/external/foundation index 402875b97..fc219b1f8 160000 --- a/src/external/foundation +++ b/src/external/foundation @@ -1 +1 @@ -Subproject commit 402875b97ed98fa8f51d46b75b4651b8be8cca42 +Subproject commit fc219b1f8cde5bbf156c49edc668e766110e2736 From 8808cfe4477636f2df11d5a9e9fee48a22882bcf Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Sat, 22 Jul 2017 13:01:27 +0300 Subject: [PATCH 18/18] AppKit fully building and linking --- src/external/cocotron | 2 +- src/external/foundation | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/external/cocotron b/src/external/cocotron index ba44d6160..0e8e8c38d 160000 --- a/src/external/cocotron +++ b/src/external/cocotron @@ -1 +1 @@ -Subproject commit ba44d616012ba68deb606a4e48b6a6587835b25a +Subproject commit 0e8e8c38dac893be5d7ee5204e4218e59dc2009c diff --git a/src/external/foundation b/src/external/foundation index fc219b1f8..6e6652dcd 160000 --- a/src/external/foundation +++ b/src/external/foundation @@ -1 +1 @@ -Subproject commit fc219b1f8cde5bbf156c49edc668e766110e2736 +Subproject commit 6e6652dcd250fe6f73abbb96370438cd2c303a4d