Skip to content

Commit

Permalink
Merge branch 'valencia' into welcome
Browse files Browse the repository at this point in the history
  • Loading branch information
Todd Blose committed Feb 23, 2015
2 parents 468ce2b + 3ebe2c1 commit 03a770e
Show file tree
Hide file tree
Showing 191 changed files with 37,633 additions and 1,157 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ Lantern.app
lantern.dmg
src/github.com/getlantern/flashlight/ui/resources.go
src/github.com/getlantern/flashlight/lantern.syso
src/github.com/getlantern/lantern-ui/dist
dmgbackground.png
dmgbackground_versioned.svg
Binary file modified Lantern.app_template/Contents/Resources/app.icns
Binary file not shown.
30 changes: 21 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ lantern).

Flashlight requires [Go 1.4.x](http://golang.org/dl/).

You will also need [npm](https://www.npmjs.com/) and gulp.

`npm install -g gulp`
You will also need [npm](https://www.npmjs.com/).

It is convenient to build flashlight for multiple platforms using
[gox](https://github.com/mitchellh/gox).
Expand Down Expand Up @@ -62,6 +60,9 @@ The script `tagandbuild.bash` tags and runs crosscompile.bash.

Note - ./crosscompile.bash omits debug symbols to keep the build smaller.

Note - tagandbuild.bash requires the BNS_CERT and BNS_CERT_PASS environment
variables to sign the windows executable. See Packaging for Windows below.

### Building on Linux

Cross-compilation targeting Linux is currently not supported, so Linux releases
Expand All @@ -72,17 +73,28 @@ See https://github.com/getlantern/lantern/issues/2235.

`sudo apt-get install libgtk-3-dev libappindicator3-dev`

### Building at Development Time

At development time, you might use `go install github.com/getlantern/flashlight`
or `go build github.com/getlantern/flashlight`. If you do this after using
`crosscompile.bash` you might get an error like this:

> ld: warning: ignoring file /var/folders/j_/9dywssj524gf3100s4q9l48w0000gp/T//go-link-LUd0tc/000000.o, file was built for unsupported file format ( 0x4C 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x2C 0xFD 0x01 0x00 0x01 0x00 0x00 0x00 ) which is not the architecture being linked (x86_64): /var/folders/j_/9dywssj524gf3100s4q9l48w0000gp/T//go-link-LUd0tc/000000.o
You can avoid this by using `CGO_ENABLED=1 go install`.

### Packaging for OS X
Lantern on OS X is packaged as the `Lantern.app` app bundle, distributed inside
of a drag-and-drop dmg installer. The app bundle and dmg can be created using
`./package_osx.bash`.

This script requires the node module `appdmg`. Assuming you have homebrew
installed, you can get it with ...
This script requires that you have [nodejs](http://nodejs.org/) installed.

The script takes a single parameter, which is the version string to display in
the installer background, for example:

```bash
brew install node
npm install -g appdmg
./package_osx.bash 2.0.0_beta1
```

`./package_osx.bash` signs the Lantern.app using the BNS code signing
Expand All @@ -95,9 +107,9 @@ app bundle won't be signed. Unsigned app bundles can be used for testing but
should never be distributed to end users.

The background image for the DMG is `dmgbackground.png` and the icon is in
`lantern.icns`.
`Lantern.app_template/Contents/Resources/app.icns`.

### Packaging on Windows
### Packaging for Windows
Lantern on Windows is currently distributed as an executable (no installer).
This executable should be signed with `./package_windows.bash` prior to
distributing it to end users.
Expand Down
9 changes: 6 additions & 3 deletions crosscompile.bash
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
# just the commit id.
VERSION="`git describe --abbrev=0 --tags --exact-match || git rev-parse --short HEAD`"
BUILD_DATE="`date -u +%Y%m%d%.%H%M%S`"
export VERSION_STRING="$VERSION ($BUILD_DATE)"
LOGGLY_TOKEN="469973d5-6eaf-445a-be71-cf27141316a1"
LDFLAGS="-w -X main.version $VERSION -X main.buildDate $BUILD_DATE -X main.logglyToken LOGGLY_TOKEN"
echo "Building flashlight version $VERSION ($BUILD_DATE)"
# gox -ldflags="-w -X main.version $VERSION -X main.buildDate $BUILD_DATE" -osarch="linux/386 linux/amd64 windows/386 darwin/amd64" github.com/getlantern/flashlight
# gox -ldflags="-w -X main.version $VERSION -X main.buildDate $BUILD_DATE -X main.logglyToken LOGGLY_TOKEN" -osarch="linux/386 linux/amd64 windows/386 darwin/amd64" github.com/getlantern/flashlight
# Compile for Mac
CGO_ENABLED=1 gox -tags="prod" -ldflags="-w -X main.version $VERSION -X main.buildDate $BUILD_DATE" -osarch="darwin/amd64" -output="lantern_{{.OS}}_{{.Arch}}" github.com/getlantern/flashlight
CGO_ENABLED=1 gox -tags="prod" -ldflags="$LDFLAGS" -osarch="darwin/amd64" -output="lantern_{{.OS}}_{{.Arch}}" github.com/getlantern/flashlight
# Compile for Windows (use -H=windowsgui ldflag to make this a Windows instead of a console app)
CGO_ENABLED=1 gox -tags="prod" -ldflags="-w -X main.version $VERSION -X main.buildDate $BUILD_DATE -H=windowsgui" -osarch="windows/386" -output="lantern_{{.OS}}_{{.Arch}}" github.com/getlantern/flashlight
CGO_ENABLED=1 gox -tags="prod" -ldflags="$LDFLAGS -H=windowsgui" -osarch="windows/386" -output="lantern_{{.OS}}_{{.Arch}}" github.com/getlantern/flashlight
Binary file removed dmgbackground.png
Binary file not shown.
Loading

0 comments on commit 03a770e

Please sign in to comment.