Return-Path: X-Original-To: apmail-mynewt-commits-archive@minotaur.apache.org Delivered-To: apmail-mynewt-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A4ACF1809E for ; Tue, 15 Mar 2016 02:08:53 +0000 (UTC) Received: (qmail 1282 invoked by uid 500); 15 Mar 2016 02:08:53 -0000 Delivered-To: apmail-mynewt-commits-archive@mynewt.apache.org Received: (qmail 1234 invoked by uid 500); 15 Mar 2016 02:08:53 -0000 Mailing-List: contact commits-help@mynewt.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@mynewt.incubator.apache.org Delivered-To: mailing list commits@mynewt.incubator.apache.org Received: (qmail 1091 invoked by uid 99); 15 Mar 2016 02:08:53 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Mar 2016 02:08:53 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 09368C0250 for ; Tue, 15 Mar 2016 02:08:53 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -3.549 X-Spam-Level: X-Spam-Status: No, score=-3.549 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.329] autolearn=disabled Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id CRqINiQmKHBN for ; Tue, 15 Mar 2016 02:08:50 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with SMTP id 7F7DF5FACD for ; Tue, 15 Mar 2016 02:08:49 +0000 (UTC) Received: (qmail 1002 invoked by uid 99); 15 Mar 2016 02:08:48 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Mar 2016 02:08:48 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 684A9DFC16; Tue, 15 Mar 2016 02:08:48 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: aditi@apache.org To: commits@mynewt.incubator.apache.org Date: Tue, 15 Mar 2016 02:08:49 -0000 Message-Id: <8b404452d0f14346a274062c42d87a36@git.apache.org> In-Reply-To: <8ba2b7b875d94c84958ba136d64cc26e@git.apache.org> References: <8ba2b7b875d94c84958ba136d64cc26e@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/2] incubator-mynewt-site git commit: Corrected error of missing newt install steps Corrected error of missing newt install steps Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/commit/5db3e683 Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/tree/5db3e683 Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/diff/5db3e683 Branch: refs/heads/master Commit: 5db3e68337fa33dbb3fa2436ab684ff40b06b401 Parents: 325c187 Author: aditihilbert Authored: Mon Mar 14 19:08:37 2016 -0700 Committer: aditihilbert Committed: Mon Mar 14 19:08:37 2016 -0700 ---------------------------------------------------------------------- docs/newt/tutorials/newt_mac.md | 124 +++++++++++++++++++++++++++++++++ docs/os/tutorials/arduino_zero.md | 2 +- mkdocs.yml | 1 + 3 files changed, 126 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/5db3e683/docs/newt/tutorials/newt_mac.md ---------------------------------------------------------------------- diff --git a/docs/newt/tutorials/newt_mac.md b/docs/newt/tutorials/newt_mac.md new file mode 100644 index 0000000..5abf385 --- /dev/null +++ b/docs/newt/tutorials/newt_mac.md @@ -0,0 +1,124 @@ +## Building newt tool on your Mac + +### Getting your Mac Ready + +If you want to build the *newt* tool from its source code, follow the following steps: +#### 1. Install Homebrew on your Mac OS X + +* Do you have Homebrew? If not, open a terminal on your Mac and paste the following at a Terminal prompt. It will ask you for your sudo password. + +```no-highlight + $ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" +``` + Alternatively, you can just extract (or `git clone`) Homebrew and install it to `/usr/local`. + +#### 2. Install Go, the programming language + +* Go language enviroment dictates a directory structure. Known in Go parlanace as workspace, it must contain three sibling directories with the directory names src, pkg and bin, as explained below. + + * src contains Go source files organized into packages (one package per directory), + + * pkg contains package objects, and + + * bin contains executable commands. + + The GOPATH environment variable specifies the location of your workspace. To setup this workspace environment, create a 'dev' directory and then a 'go' directory under it. Set the GOPATH environment variable to this directory where you will soon clone the *newt* tool repository. + +```no-highlight + $ cd $HOME + $ mkdir -p dev/go + $ cd dev/go + $ export GOPATH=`pwd` +``` + (Note that you need to add export statements to ~/.bash_profile to export variables permanently. Don't forget to source the file for the change to go into effect.) + +```no-highlight + $ vi ~/.bash_profile + $ source ~/.bash_profile +``` +* Next, using *brew*, install Go. When installed, Go offers you as a developer a language enviroment (to compile Go code), construct Go packages (to assemble Go packages) and import Go code (from github). In the next step, you will use the Go commands to import *newt* repo into your local Go environment. + +```no-highlight + $ brew install go + ==> + ... + ... + ==> *Summary* + 🍺 /usr/local/Cellar/go/1.5.1: 5330 files, 273M +``` + Alternatively, you can download the Go package directly from (https://golang.org/dl/) instead of brewing it. Install it in /usr/local directory. + + +#### 3. Create local repository + +* Use Go commands to copy the directory (currently the ASF incubator directory). Be patient as it may take a minute or two. Check the directories installed. + +```no-highlight + $ go get mynewt.apache.org/newt/... + +``` + +* Check that newt.go is in place. +```no-highlight + $ ls $GOPATH/src/mynewt.apache.org/newt + DISCLAIMER NOTICE newt newtvm viper + LICENSE README.md newtmgr util yaml +``` + +#### 4. Build the Newt tool + +* Use Go to run the newt.go program to build the *newt* tool. The command `go install` compiles and writes the resulting executable to an output file named `newt`, which is then installed, along with its dependencies, in $GOPATH/bin. + +```no-highlight + $ cd $GOPATH/src/mynewt.apache.org/newt/newt + $ go install + $ ls "$GOPATH"/bin/ + newt newtmgr newtvm +``` +* At this point, you can try using *newt*. For example, check for the version number by typing 'newt version'. See all the possible commands available to a user of newt by typing 'newt -h'. + + (Note: If you are going to be modifying the *newt* often and going to be compile the program every time you call it, you will want to store the command in a variable in your .bash_profile. So type in `export newt="go run $GOPATH/mynewt.apache.org/newt/newt/newt.go"` in your .bash_profile and execute it by calling `$newt` at the prompt instead of `newt`. Essentially, `$newt` calls `go run` which runs the compiled binary directly without producing an executable. Don't forget to reload the updated bash profile by typing `source ~/.bash_profile` at the prompt! ) + +```no-highlight + $ newt version + Newt version: 1.0 + $ newt -h + Newt allows you to create your own embedded project based on the Mynewt + operating system. Newt provides both build and package management in a + single tool, which allows you to compose an embedded workspace, and set + of projects, and then build the necessary artifacts from those projects. + For more information on the Mynewt operating system, please visit + https://www.github.com/mynewt/documentation. + + Please use the newt help command, and specify the name of the command + you want help for, for help on how to use a specific command + + Usage: + newt [flags] + newt [command] + + Examples: + newt + newt help [] + For help on . If not specified, print this message. + + + Available Commands: + version Display the Newt version number. + target Set and view target information + egg Commands to list and inspect eggs on a nest + nest Commands to manage nests & clutches (remote egg repositories) + help Help about any command + + Flags: + -h, --help=false: help for newt + -l, --loglevel="WARN": Log level, defaults to WARN. + -q, --quiet=false: Be quiet; only display error output. + -s, --silent=false: Be silent; don't output anything. + -v, --verbose=false: Enable verbose output when executing commands. + + + Use "newt help [command]" for more information about a command. +``` +* Without creating a project repository, you can't do a whole lot with the *newt tool. So you'll have to wait till you have downloaded an app to try out the tool. + http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/5db3e683/docs/os/tutorials/arduino_zero.md ---------------------------------------------------------------------- diff --git a/docs/os/tutorials/arduino_zero.md b/docs/os/tutorials/arduino_zero.md index d6f892e..6311543 100644 --- a/docs/os/tutorials/arduino_zero.md +++ b/docs/os/tutorials/arduino_zero.md @@ -31,7 +31,7 @@ Follow these simple steps and your board will be blinking in no time! ### Install Mynewt and Newt -If you have not already done so, install Newt as shown in the [Newt install tutorial](../../newt/newt_mac.md) and cloned the Mynewt OS repository as shown in the [Get Started tutorial for Blinky](../get_started/project1.md) +If you have not already done so, install Newt as shown in the [Newt install tutorial](../../newt/tutorials/newt_mac.md) and cloned the Mynewt OS repository as shown in the [Get Started tutorial for Blinky](../get_started/project1.md) ### Fetch External Packages for Atmel SAMD21 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/5db3e683/mkdocs.yml ---------------------------------------------------------------------- diff --git a/mkdocs.yml b/mkdocs.yml index a523c5c..2c41b41 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -292,6 +292,7 @@ pages: - Newt Tool Manual: - Introduction: 'newt/newt_intro.md' - Tutorials: + - 'Install Newt on Mac': 'newt/tutorials/newt_mac.md' - 'Define a target': 'newt/tutorials/define_target.md' - Manual: - 'Command structure': 'newt/newt_ops.md'