{"id":2180,"date":"2015-12-15T22:18:22","date_gmt":"2015-12-16T04:18:22","guid":{"rendered":"http:\/\/dev.iachieved.it\/iachievedit\/?p=2180"},"modified":"2016-02-07T10:00:38","modified_gmt":"2016-02-07T16:00:38","slug":"ubuntu-packages-for-open-source-swift","status":"publish","type":"post","link":"https:\/\/dev.iachieved.it\/iachievedit\/ubuntu-packages-for-open-source-swift\/","title":{"rendered":"Ubuntu Packages for Open Source Swift"},"content":{"rendered":"<p><a href=\"https:\/\/swift.org\/\"><img decoding=\"async\" src=\"https:\/\/img.shields.io\/badge\/Swift-2.2-orange.svg?style=flat\" alt=\"Swift 2.2\" \/><\/a><br \/>\nQuick and easy instructions for installing Open Source Swift 2.2 on Ubuntu 14.04 or 15.10 using <code>apt-get<\/code>.<\/p>\n<p><b>1.  Add the repository key<\/b><\/p>\n<pre class=\"crayon:false\">\nwget -qO- http:\/\/dev.iachieved.it\/iachievedit.gpg.key | sudo apt-key add -\n<\/pre>\n<p><b>2.  Add the appropriate repository to <code>sources.list<\/code><\/b><\/p>\n<p><b>Ubuntu 14.04<\/b><\/p>\n<pre class=\"crayon:false\">\necho \"deb http:\/\/iachievedit-repos.s3.amazonaws.com\/ trusty main\" | sudo tee --append \/etc\/apt\/sources.list\n<\/pre>\n<p><b>Ubuntu 15.10<\/b><\/p>\n<pre class=\"crayon:false\">\necho \"deb http:\/\/iachievedit-repos.s3.amazonaws.com\/ wily main\" | sudo tee --append \/etc\/apt\/sources.list\n<\/pre>\n<p><b>3.  Run <code>apt-get update<\/code><\/b><\/p>\n<pre class=\"crayon:false\">\nsudo apt-get update\n<\/pre>\n<p><b>4.  Install swift-2.2!<\/b><\/p>\n<pre class=\"crayon:false\">\napt-get install swift-2.2\n<\/pre>\n<p>I am currently serving this package off of Amazon S3 so it may take a bit to download.  I am looking at whether or not I can afford utilizing CloudFront.<\/p>\n<p><b>5.  Try it out<\/b><\/p>\n<pre class=\"crayon:false\">\ngit clone https:\/\/github.com\/apple\/example-package-dealer\ncd example-packager-dealer\nswift build\nCompiling Swift Module 'FisherYates' (1 sources)\nLinking Library:  .build\/debug\/FisherYates.a\nCompiling Swift Module 'PlayingCard' (3 sources)\nLinking Library:  .build\/debug\/PlayingCard.a\nCompiling Swift Module 'DeckOfPlayingCards' (1 sources)\nLinking Library:  .build\/debug\/DeckOfPlayingCards.a\nCompiling Swift Module 'Dealer' (1 sources)\nLinking Executable:  .build\/debug\/Dealer\n<\/pre>\n<p>Run it!<\/p>\n<pre class=\"crayon:false\">\n.build\/debug\/Dealer\n<\/pre>\n<h2>FAQ<\/h2>\n<p><b>Q.<\/b>  Did Apple build these binaries?<br \/>\n<b>A.<\/b>  No, I built them on my personal server using the instructions I posted <a href=\"http:\/\/dev.iachieved.it\/iachievedit\/keeping-up-with-open-source-swift\/\">here<\/a>.<\/p>\n<p><b>Q.<\/b>  What git revisions are included in the build?<br \/>\n<b>A.<\/b>  You can use <code>apt-cache show swift-2.2<\/code> to see this information.  For example:<\/p>\n<pre class=\"crayon:false\">\n# apt-cache show swift-2.2\nPackage: swift-2.2\nVersion: 1:2.2-0ubuntu4~trusty1\nArchitecture: amd64\nMaintainer: iachievedit (support@iachieved.it)\nDepends: clang-3.6, libicu-dev\nHomepage: http:\/\/dev.iachieved.it\/iachievedit\/swift\nPriority: optional\nSection: development\nFilename: pool\/main\/s\/swift-2.2\/swift-2.2_2.2-0ubuntu4~trusty1_amd64.deb\nSize: 60218098\nSHA256: 69d5c38c97fd748af7829cb4c00d51539d0e6c21de9740754d2fa0da71c1bb8e\nSHA1: 5872fb2a9c06cc4461d4a26eb9c4350e3b89ac1a\nMD5sum: 87e12231e38a75e9126855b803daa4fd\nDescription: Open Source Swift\n This is a packaged version of Open Source Swift 2.2 built from\n the following git revisions of the Apple Github repositories:\n       Clang:  f66c5bb67b\n        LLVM:  7bae82deaa\n       Swift:  23366f2001\n  Foundation:  0b6479b664\nDescription-md5: 1c037ae5d6761bd55f026676773e5e30\n\n<\/pre>\n<p>The source tree is <i>untouched<\/i> for each build.<\/p>\n<p><b>Q.<\/b>  Do you test the binaries before you upload them?<br \/>\n<b>A.<\/b>  The Swift build process tests the resulting binaries, and I then do run some basic tests and compile my own applications, but there is currently no separate exhaustive test suite.<\/p>\n<p><b>Q.<\/b>  Are you releasing builds on a set schedule?<br \/>\n<b>A.<\/b>  Not really, though I may try to stay in sync with the releases from Apple.  The idea was to get something out for folks to experiment with and start coding Swift on Linux.<\/p>\n<p><b>Q.<\/b>  Where is everything installed?<br \/>\n<b>A.<\/b>  Everything gets put in <code>\/usr<\/code>, just like installing <code>clang<\/code>, <code>gcc<\/code>, etc.<\/p>\n<p><b>Q.<\/b>  How do I decipher the package version number?<br \/>\n<b>A.<\/b>  This was my first take on what I thought should be an appropriate package version number.  Breaking it down, <code>2.2-0ubuntu3~trusty1<\/code> should be:<\/p>\n<ul>\n<li>2.2 is the version of Swift that is packaged\n<li>-0ubuntu3 indicates that this is the 3rd package for Ubuntu, with the 0 indicating that there is no upstream Debian package upon which this package was based\n<li>~trusty1 indicates that this package is for Trusty Tahr\n<\/ul>\n<p>Wily packages do not contain anything like <code>~wiley1<\/code> in their version number such that an upgrade from Trusty to Wiley would automatically upgrade your <code>swift-2.2<\/code> package correctly.<\/p>\n<p>I <i>think<\/i> I got that right, but if you feel otherwise please do drop me a line at <code>support@iachieved.it<\/code>.<\/p>\n<h2>How Does This Work?<\/h2>\n<p>I used <a href=\"http:\/\/xn.pinkhamster.net\/blog\/tech\/host-a-debian-repository-on-s3.html\">these awesome instructions<\/a> on how to host a Debian package repository on Amazon S3.  I tried to set up a Launchpad PPA, but quite frankly, got tired of trying to wade through all the metadata required to put together a simple package.  I&#8217;m sure for hosting distribution repositories it&#8217;s all required, but for this it felt like overkill.  The folks that develop <a href=\"https:\/\/github.com\/jordansissel\/fpm\">fpm<\/a> also have some choice things to say about it.<\/p>\n<p>In addition I&#8217;ll be submitting the other bits on how to package and upload to Github.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Quick and easy instructions for installing Open Source Swift 2.2 on Ubuntu 14.04 or 15.10 using apt-get. 1. Add the repository key wget -qO- http:\/\/dev.iachieved.it\/iachievedit.gpg.key | sudo apt-key add &#8211; 2. Add the appropriate repository to sources.list Ubuntu 14.04 echo &#8220;deb http:\/\/iachievedit-repos.s3.amazonaws.com\/ trusty main&#8221; | sudo tee &#8211;append \/etc\/apt\/sources.list Ubuntu 15.10 echo &#8220;deb http:\/\/iachievedit-repos.s3.amazonaws.com\/ wily [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,19,5],"tags":[],"class_list":["post-2180","post","type-post","status-publish","format-standard","hentry","category-apple","category-linux","category-swift"],"_links":{"self":[{"href":"https:\/\/dev.iachieved.it\/iachievedit\/wp-json\/wp\/v2\/posts\/2180"}],"collection":[{"href":"https:\/\/dev.iachieved.it\/iachievedit\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dev.iachieved.it\/iachievedit\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dev.iachieved.it\/iachievedit\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dev.iachieved.it\/iachievedit\/wp-json\/wp\/v2\/comments?post=2180"}],"version-history":[{"count":7,"href":"https:\/\/dev.iachieved.it\/iachievedit\/wp-json\/wp\/v2\/posts\/2180\/revisions"}],"predecessor-version":[{"id":2656,"href":"https:\/\/dev.iachieved.it\/iachievedit\/wp-json\/wp\/v2\/posts\/2180\/revisions\/2656"}],"wp:attachment":[{"href":"https:\/\/dev.iachieved.it\/iachievedit\/wp-json\/wp\/v2\/media?parent=2180"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev.iachieved.it\/iachievedit\/wp-json\/wp\/v2\/categories?post=2180"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev.iachieved.it\/iachievedit\/wp-json\/wp\/v2\/tags?post=2180"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}