<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div>I followed whatever procedure had been posted on the System Modules page on the Package Manager repo at GitHub. So yes, and I tried about 3 times :-)<br>
<br>
<div class="acompli_signature">Sent from <a href="https://aka.ms/qtex0l">Outlook Mobile</a></div>
<br>
</div>
<br>
<br>
<br>
<div class="gmail_quote">On Tue, Dec 8, 2015 at 9:24 PM -0800, "Harlan Haskins" <span dir="ltr">
<<a href="mailto:harlan@harlanhaskins.com" target="_blank">harlan@harlanhaskins.com</a>></span> wrote:<br>
<br>
</div>
<div class="BodyFragment">
<div class="PlainText">Just covering all the bases here: did you commit and add Package.swift before making the tag?<br>
<br>
Sent from my iPhone<br>
<br>
> On Dec 8, 2015, at 11:08 PM, Jason Dusek via swift-users <swift-users@swift.org> wrote:<br>
> <br>
> Gage,<br>
> <br>
> For what it's worth, after running `git init` and `git tag -f 1.0.0`<br>
> in `CCairo` to get something importable, I run into this error:<br>
> <br>
> :; swift build<br>
> Cloning Packages/CCairo<br>
> <unknown>:0: error: no such file or directory:<br>
> '/Users/solidsnack/Downloads/Sources/example/Packages/CCairo/Package.swift'<br>
> <br>
> <br>
> On Tue, 8 Dec 2015 at 18:22 Gage Morgan via swift-users<br>
> <swift-users@swift.org> wrote:<br>
>> <br>
>> Okay, I've filed a report. To make it easier, the thing's code is SR-152.<br>
>> <br>
>> <a href="https://bugs.swift.org/browse/SR-152">https://bugs.swift.org/browse/SR-152</a><br>
>> <br>
>> ________________________________<br>
>> From: gagemorgan@outlook.com<br>
>> To: mawadah@apple.com; gagemorgan@outlook.com<br>
>> <br>
>> Subject: RE: [swift-users] Binding Regular C Functions (Gtk, Cairo, etc.)<br>
>> Date: Tue, 8 Dec 2015 18:11:03 -0500<br>
>> <br>
>> What I'd like to know is, what is the "link: " part of the module.modulemap for? I pasted in the cairo.so part, but this only said that after doing so. I'd honestly just like to make sure this works.<br>
>> <br>
>> ________________________________<br>
>> To: mawadah@apple.com; swift-users@swift.org<br>
>> Date: Tue, 8 Dec 2015 18:07:25 -0500<br>
>> <br>
>> Subject: Re: [swift-users] Binding Regular C Functions (Gtk, Cairo, etc.)<br>
>> From: swift-users@swift.org<br>
>> <br>
>> <br>
>> <br>
>> <br>
>> ________________________________<br>
>> From: gagemorgan@outlook.com<br>
>> To: mawadah@apple.com<br>
>> Subject: RE: [swift-users] Binding Regular C Functions (Gtk, Cairo, etc.)<br>
>> Date: Tue, 8 Dec 2015 18:03:42 -0500<br>
>> <br>
>> So...including cairo in an app returns this:<br>
>> <br>
>> Linking Executable: .build/debug/example<br>
>> /usr/bin/ld: cannot find -l/usr/lib/x86_64-linux-gnu/libcairo.so<br>
>> clang: error: linker command failed with exit code 1 (use -v to see invocation)<br>
>> <unknown>:0: error: link command failed with exit code 1 (use -v to see invocation)<br>
>> <unknown>:0: error: build had 1 command failures<br>
>> swift-build: exit(1): ["/home/mgage/Downloads/swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu15.10/usr/bin/swift-build-tool", "-f", "/home/mgage/Sources/example/.build/debug/example.o/llbuild.yaml"]<br>
>> <br>
>> What went amiss?<br>
>> <br>
>> ________________________________<br>
>> From: mawadah@apple.com<br>
>> Subject: Re: [swift-users] Binding Regular C Functions (Gtk, Cairo, etc.)<br>
>> Date: Mon, 7 Dec 2015 19:27:56 -0800<br>
>> To: gagemorgan@outlook.com<br>
>> <br>
>> Once you have followed the instructions to create a system package, your own package declares a dependency on that package. This is also covered in those steps.<br>
>> <br>
>> To use the C APIs in your code, simply import the name of the module (as defined by the modulemap entry) in your swift file. It should just work.<br>
>> <br>
>> For instance, in the example from the sysmodules doc link I sent, you just<br>
>> <br>
>> import CJPEG<br>
>> <br>
>> <br>
>> <br>
>> The C functions will have the same name in Swift as their C counterparts. The types might adjust to UnsafePointer etc.. For a list of those Swift bindings, run the REPL and import your module, then perform “:type lookup Module” to get a printout of available
APIs.<br>
>> <br>
>> - mish<br>
>> <br>
>> On Dec 7, 2015, at 6:40 PM, Gage Morgan <gagemorgan@outlook.com> wrote:<br>
>> <br>
>> I read that. What I want to know is how to bind the functions themselves after creating a system package. How to use the c functions that got imported, if you will.<br>
>> <br>
>> Sent from Outlook<br>
>> <br>
>> <br>
>> <br>
>> <br>
>> On Mon, Dec 7, 2015 at 6:39 PM -0800, "Mish Awadah" <mawadah@apple.com> wrote:<br>
>> <br>
>> Please see the reference at <a href="https://github.com/apple/swift-package-manager/blob/master/Documentation/SystemModules.md">
https://github.com/apple/swift-package-manager/blob/master/Documentation/SystemModules.md</a><br>
>> <br>
>> - mish<br>
>> <br>
>> On Dec 7, 2015, at 6:33 PM, Gage Morgan via swift-users <swift-users@swift.org> wrote:<br>
>> <br>
>> For any project: How is a C to Swift function binding created? I'd like to know how to import C functions to Swift. Once I can do this successfully, I'll be all set.<br>
>> <br>
>> Sent from Outlook<br>
>> <br>
>> _______________________________________________<br>
>> swift-users mailing list<br>
>> swift-users@swift.org<br>
>> <a href="https://lists.swift.org/mailman/listinfo/swift-users">https://lists.swift.org/mailman/listinfo/swift-users</a><br>
>> <br>
>> <br>
>> <br>
>> <br>
>> _______________________________________________ swift-users mailing list swift-users@swift.org
<a href="https://lists.swift.org/mailman/listinfo/swift-users">https://lists.swift.org/mailman/listinfo/swift-users</a><br>
>> _______________________________________________<br>
>> swift-users mailing list<br>
>> swift-users@swift.org<br>
>> <a href="https://lists.swift.org/mailman/listinfo/swift-users">https://lists.swift.org/mailman/listinfo/swift-users</a><br>
> _______________________________________________<br>
> swift-users mailing list<br>
> swift-users@swift.org<br>
> <a href="https://lists.swift.org/mailman/listinfo/swift-users">https://lists.swift.org/mailman/listinfo/swift-users</a><br>
</div>
</div>
</body>
</html>