Skip to content

Instantly share code, notes, and snippets.

Patch to cross compile to android with net/http support

Installation instructions

We need to patch Go's source code to allow cgo when cross-compiling and make Android-specific changes since it sometimes differs from linux (e.g.: it doesn't use /etc/resolv.conf for DNS config)

  1. Clone the go source: hg clone -u release https://code.google.com/p/go
  2. Enter the go source directory: cd go
  3. Apply the patch in this gist: patch -p1 < /path/to/patch/go_android.patch
  4. Enter the go/src directory: cd src
@akavel
akavel / build
Created May 21, 2014 18:26 — forked from elimisteve/build
#!/bin/bash
# This is a simple build script and will be executed on your CI system if
# available. Otherwise it will execute while your application is stopped
# before the deploy step. This script gets executed directly, so it
# could be python, php, ruby, etc.
tarball="https://go.googlecode.com/files/go1.0.3.linux-amd64.tar.gz"
# Set GOROOT since we don't use GOROOT_FINAL
mkdir -p $OPENSHIFT_HOMEDIR/app-root/data/go
@akavel
akavel / bootstrap.sh
Last active June 8, 2016 00:05 — forked from anonymous/gist:23d6abf21bc8f8aa6e6fcb1703348fbc
Bootstrap declarative home dir in Nix
nix-env -i -f https://github.com/akavel/multigit/archive/3.6.1-nix.tar.gz
@akavel
akavel / dualboot.md
Created March 21, 2017 16:47
Instructions for Genode / NixOS dual-and-a-half-boot

Genode/NixOS dual-and-a-half-boot

If you've never used Genode or NixOS, or installed Gentoo, stop and consider what you are about to do.

The goal is too create a NixOS installation and a Genode installation, with the option of booting into NixOS, booting into Genode, and booting into Genode then booting the same NixOS install again in a virtual machine.

@akavel
akavel / dump.lua
Created February 19, 2018 20:57 — forked from leegao/dump.lua
local function dump(list)
local str = "{"
local seen = {}
for _,v in ipairs(list) do
if type(v) ~= "table" then
str = str .. tostring(v) .. ", "
else
str = str .. dump(v) .. ", "
end
seen[_] = true
@akavel
akavel / Arcan.nix
Created August 29, 2020 20:55 — forked from egasimus/Arcan.nix
Building Arcan on NixOS, 2020 version
({ lib, newScope, stdenv, pkgs }: let
# nicer aliases
derive = stdenv.mkDerivation;
concat = builtins.concatStringsSep " ";
# vendored libuvc: don't build, just make sources available
libuvc-src = derive {
name = "libuvc-src";
# using fetchgit instead fetchFromGitHub because