-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linux support? #315
Comments
Personally I can't wait to start using the Swift Package Manager, but don't yet have it running myself on Linux. I'm sure @stephencelis would be happy to take a PR 👍 |
Yup! I'd love headway here 😄 |
Added to Feature Requests. |
@sauliusgrigaitis were you able to build the lib on Linux? |
@zmeyc, yes, I built Swift libdispatch and was able to build SQLite.swift on Linux. So next step would be to get tests running on Linux to make sure that everything works correctly. |
@sauliusgrigaitis I compiled libdispatch following the steps from IBM Kitura's README.md and almost built the SQLite.swift, but there are two errors left, probably because CSQLite module links to /usr/include/sqlite3.h which is too old on Ubuntu 14. Did you encounter this problem?
|
@sauliusgrigaitis I finally built it this way: Installed sqlite3 from source with Then in CSQLite's modulemap referenced the header from /usr/local: Then built the project with the new library version: It also works without -L, but probably links to older library version from /usr. |
@zmeyc I use Ubuntu 15.10, that's why I didn't have issues with sqlite headers. Did you get tests running? |
@sauliusgrigaitis Not yet, I'm in process of porting it to Swift 3 (DEVELOPMENT-SNAPSHOT-2016-04-12-a) on OS X. I think it makes sense to use the latest Swift build for SPM package, other projects like Zewo already switched to it. I wonder how to submit PR to @stephencelis , Swift Package Manager can't clone branches yet. It can only clone tags from master, but this needs to be a separate branch... |
@zmeyc I don't think that there will be easy way to merge your branch into @stephencelis master, because this project targets iOS Swift 2. Probably easiest would be to keep your port in your fork until Swift 3 is released. People will be able to install your fork via SPM. |
@sauliusgrigaitis @stephencelis Ported everything except FTS4 (which relies on .m file which I didn't find a way to compile) to DEVELOPMENT-SNAPSHOT-2016-04-12-a, tests also run (I only commented out FTS4). Also added sqlite3.c to not depend on system one. Didn't tried it on Linux yet, only OS X: After generating Xcode project with 'swift build -X', add "Sources/CSQLite" to Import Path in Build Settings to fix "import CSQLite - module not found" error. upd: Maybe it's possible to move Swift-3 development to master and keep the old version in 'stable' branch? I think it's possible to make the 'stable' branch the default one on Github. |
@sauliusgrigaitis @stephencelis Added build instructions to fork's README.md and fixed compilation errors on Linux. Tests won't run on Linux because 'swift test' doesn't support -X flag which is needed for libdispatch. |
@zmeyc thanks, I'll check when I have opportunity. SPM is progressing fast, so there should be way to pass flags soon. |
@zmeyc check https://github.com/Zewo/URI , this project has tests running on Linux and it also has compiled dependency. |
@sauliusgrigaitis It doesn't use libdispatch. It's trivial to add LinuxMain.swift to run the tests on Linux, but the problem is SQLite uses libdispatch which requires |
@zmeyc I'm not about LinuxMain.swift, I'm more about fact that https://github.com/Zewo/URI depends on https://github.com/Zewo/CURIParser which is C library automatically compiled during SPM build. So maybe it's possible to have same structure where SQLite.swift depends on external libdispatch package which is automatically compiled with SPM, I believe that also should solve |
@sauliusgrigaitis C modules are very limited in current version and it's not possible to compile a project which requires Makefile. Or at least I don't know how. :) |
SPM doesn't use Makefile. |
Hm... I think I saw somewhere a way to run Swift tests directly without SPM somewhere, maybe this way would allow to pass flags. |
FYI I went through the exercise of making this work properly, and seem to have succeeded (https://github.com/wadetregaskis/SQLite.swift/tree/prepare-0.11.1). Pull request #548. |
@zmeyc there's now Package manager support in master, thanks to @wadetregaskis. Maybe it would be a good moment to integrate your changes as well? |
@jberkel I think they're outdated now. Compiling libdispatch manually is no longer required as well as most compatibility fixes. |
@zmeyc Ok, good to know. I don't have Linux installed so hoping somebody will come along and submit the necessary patches. |
#594 (WIP) |
Do we have plan for supporting Linux platform? Just like this https://github.com/Zewo/PostgreSQL
The text was updated successfully, but these errors were encountered: