Browse Source

Add x86_64 libs for MacOS. Setup subpackage. More output when copying.

Steven Schveighoffer 3 years ago
parent
commit
08bcb3cd52

+ 4 - 1
dub.json

@@ -16,5 +16,8 @@
         ],
 	"copyright": "Copyright (c) Ramon Santamaria (@raysan5), Petro Romanovych (@onroundit), Jan Hoenig (@m3m0ry), Steven Schveighoffer (@schveiguy)",
         "excludedSourceFiles": ["source/rlgl.d", "source/raymath.d", "source/easings.d", "source/raygui.d", "source/raymathext.d", "source/raylib_types.d"],
-	"targetType": "sourceLibrary"
+	"targetType": "sourceLibrary",
+        "subPackages" : [
+            "install"
+        ]
 }

+ 1 - 2
install/dub.json

@@ -4,10 +4,9 @@
 	],
 	"copyright": "Copyright © 2022, Steven Schveighoffer",
 	"dependencies": {
-		"argparse": "~>1.1.1",
 		"jsoniopipe": "~>0.1.4"
 	},
 	"description": "Install raylib binary files",
 	"license": "boost-1.0",
 	"name": "install"
-}
+}

BIN
install/lib/osx/x86_64/llvm/libraylib.4.2.0.dylib


+ 1 - 0
install/lib/osx/x86_64/llvm/libraylib.420.dylib

@@ -0,0 +1 @@
+libraylib.4.2.0.dylib

+ 1 - 0
install/lib/osx/x86_64/llvm/libraylib.dylib

@@ -0,0 +1 @@
+libraylib.4.2.0.dylib

+ 16 - 10
install/source/app.d

@@ -5,7 +5,6 @@ import std.compiler;
 import std.system;
 import std.format;
 import std.conv;
-import argparse;
 import std.process;
 import iopipe.json.serialize;
 import iopipe.json.parser;
@@ -32,15 +31,10 @@ else version(CppRuntime_Clang)
 	enum CRT="llvm";
 else
 	static assert(false, "Unsupported runtime");
-@(Command("install").Description("Install the raylib-d binary C libraries to a location that can be used for linking"))
-struct Args {
-	@(NamedArgument().Description("Copy libraries to the local directory"))
-	bool local;
-}
 
 enum baseDir = buildPath("install", "lib", os.to!string, arch.to!string, CRT.to!string);
 
-int realMain(Args args)
+int main()
 {
     writeln("raylib-d library installation");
     // look at the dub.selections.json file
@@ -81,9 +75,23 @@ int realMain(Args args)
     try {
         auto path = getRaylibPath(dubConfig.output.dup);
         auto libpath = buildPath(path, baseDir);
+        writeln("Copying library files from ", libpath);
         foreach(ent; dirEntries(libpath, SpanMode.shallow))
         {
-            copy(ent.name, buildPath(".", ent.name.baseName));
+            auto newLoc = buildPath(".", ent.name.baseName);
+            version(Posix)
+            {
+                if(ent.isSymlink)
+                {
+                    // recreate the symlink
+                    auto origln = readLink(ent.name);
+                    writefln("Creating symlink %s -> %s", newLoc, origln);
+                    symlink(origln, newLoc);
+                    continue;
+                }
+            }
+            writeln("Installing library file ", newLoc);
+            copy(ent.name, newLoc, PreserveAttributes.yes);
         }
     } catch(Exception ex) {
         stderr.writeln("Error: ", ex.msg);
@@ -91,5 +99,3 @@ int realMain(Args args)
     }
     return 0;
 }
-
-mixin CLI!Args.main!realMain;