this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Start work on Darling Command Line Tools

Goal for now is to be able to use these Command Line Tools to do
everything that Homebrew needs to do with them, namely git and clang.

+56 -1
+2
src/CMakeLists.txt
··· 445 445 add_subdirectory(opendirectory) 446 446 add_subdirectory(MetalKit) 447 447 448 + add_subdirectory(clt) 449 + 448 450 # Just a stub 449 451 add_subdirectory(WebKit) 450 452 add_subdirectory(OpenGL)
+11
src/clt/CMakeLists.txt
··· 1 + project(clt) 2 + 3 + set(CLT_ROOT libexec/darling/Library/Developer/DarlingCLT) 4 + 5 + install(DIRECTORY DESTINATION ${CLT_ROOT}) 6 + 7 + add_definitions(-DDEBUG) 8 + 9 + add_darling_executable(xcrun_clt xcrun.c) 10 + set_target_properties(xcrun_clt PROPERTIES OUTPUT_NAME xcrun) 11 + install(TARGETS xcrun_clt DESTINATION ${CLT_ROOT}/usr/bin)
+33
src/clt/xcrun.c
··· 1 + #include <stdio.h> 2 + #include <string.h> 3 + #include <stdlib.h> 4 + #include <unistd.h> 5 + 6 + int main(int argc, char** argv) 7 + { 8 + #if DEBUG 9 + printf("Invoked with:"); 10 + for (int i = 0; i < argc; i++) 11 + { 12 + printf(" %s", argv[i]); 13 + } 14 + printf("\n"); 15 + #endif 16 + const int prefixLength = strlen(argv[0])-strlen("xcrun"); 17 + char *toolPath = calloc(prefixLength+strlen(argv[1]), sizeof(char)); 18 + strncpy(toolPath, argv[0], prefixLength); 19 + strcpy(toolPath+prefixLength, argv[1]); 20 + 21 + #if DEBUG 22 + printf("Executing %s\n", toolPath); 23 + #endif 24 + 25 + argv++; 26 + argv[0] = toolPath; 27 + 28 + execvp(argv[0], argv); 29 + 30 + printf("Failed to execute program %s\n", argv[0]); 31 + 32 + return 1; 33 + }
+10 -1
src/xcselect/xcselect.c
··· 174 174 p = "/Library/Developer/CommandLineTools"; 175 175 goto have_path; 176 176 } 177 + else if (dir_exists("/Library/Developer/DarlingCLT")) 178 + { 179 + p = "/Library/Developer/DarlingCLT"; 180 + *is_cmd_line = true; 181 + goto have_path; 182 + } 177 183 178 184 return false; 179 185 ··· 209 215 } 210 216 211 217 strcpy(buf, dev_dir); 212 - strcat(buf, "/"); 218 + if (buf[strlen(buf) - 1] != '/') 219 + { 220 + strcat(buf, "/"); 221 + } 213 222 length = strlen(buf); 214 223 215 224 strcat(buf, "usr/lib/libxcrun.dylib");