swiftplot icon indicating copy to clipboard operation
swiftplot copied to clipboard

Fails to import with swift package management in xcode

Open sedurCode opened this issue 6 years ago • 7 comments

When creating a swift application in Xcode 11 for macOS, a package.swift file is not created and linked with the project. As such I am not sure how to follow the documentation for how to include this package in my project.

As per this doc: https://developer.apple.com/documentation/xcode/adding_package_dependencies_to_your_app It would appear apple are very keen for users to use their tool for dependency management, but as someone new to swift it obscures work-arounds.

This package repository is not accepted as a 'swift packages' dependency using the method in the article, due to the dependency on CFreeType: image

Is there a way to add this package to my project given this state of affairs?

Thanks

sedurCode avatar Nov 20 '19 15:11 sedurCode

@sedurCode thanks for pointing out this issue! I'm not sure how we could resolve this at the moment. I use Swift on Linux and am new to XCode. I'll try to look into it and revert back.

KarthikRIyer avatar Nov 25 '19 17:11 KarthikRIyer

@sedurCode #42 might solve this issue. Can you try importing from master?

KarthikRIyer avatar Nov 27 '19 12:11 KarthikRIyer

Successfully imported from exemplary of karwa's branch. will now try from master of this branch

sedurCode avatar Nov 27 '19 22:11 sedurCode

Successfully imported from master of this repo. Now need to get the package working. Thank you for addressing this :) 👍

sedurCode avatar Nov 27 '19 22:11 sedurCode

Although I can import and compile a program that uses example code from the README, I now get the error: dyld: Library not loaded: /usr/local/opt/freetype/lib/libfreetype.6.dylib Referenced from: ..... Reason: no suitable image found. Did find: /usr/local/opt/freetype/lib/libfreetype.6.dylib: code signature in (/usr/local/opt/freetype/lib/libfreetype.6.dylib) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed. /usr/local/lib/libfreetype.6.dylib: code signature in (/usr/local/lib/libfreetype.6.dylib) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed. /usr/local/Cellar/freetype/2.10.0/lib/libfreetype.6.dylib: code signature in (/usr/local/Cellar/freetype/2.10.0/lib/libfreetype.6.dylib) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.

sedurCode avatar Nov 28 '19 10:11 sedurCode

@sedurCode do you have freetype installed on your system? If not could you try again after installing it? In case you're unable to install it using homebrew you can also install it from the source that you'll find here: https://www.freetype.org/download.html

KarthikRIyer avatar Nov 29 '19 18:11 KarthikRIyer

I only have it installed with homebrew, so I will try and alternative source

sedurCode avatar Nov 30 '19 17:11 sedurCode