forum > Libraries installation
-
Alex Jun 08 at 06:24
Hello!
There is a library I think I would use often in my projects( https://github.com/Simn/hxop ). So I want to add it to my list of libraries in the same way as I do with the official libraries like "format". But I couldn't get how to use haxelib for it(if it's the right way at all).
So, here it the question - how one should install libraries not from the official repository?
-
Alex
You don't really need to put code in a library to use it, you can just add the location to your hxml file..
-cp /hxop
But you can manually add code to the library, on mac it can be found /usr/lib/haxe/lib/ so you would just move the library to /usr/lib/haxe/lib/hxop
Now if you want to do this, but want to stored details about the library you can install a 'test' haxelib, not sure if the license (BSD?) is correct not a big git user so could not find that.
<project name="hxop" url="https://github.com/Simn/hxop/g" license="BSD"> <user name="Alex"/> <tag v=""/> <tag v=""/> <description>Overload Operator</description> <version name="test">Github version of hxop</version> </project>
save this as haxelib.xml next to the hxop folder and then zip the folder containing them both ( zip -r hxopTest.zip /hxopTestFolder )
from terminal you can then ask haxelib to put this test library in the library.haxelib test hxopTest.zipThen you can use hxop in the normal way from you hxml code.
-lib hxop
More details of this process are explained here
http://haxe.org/doc/haxelib/using_haxelib
Another approach maybe to use haxelib dev, but I am unsure if that works when there is no original library defined?
-
Alex Jun 22 at 00:48
Thanks for the detailed explanation! And sorry for a big delay with this answer.