Skip to content

Commit

Permalink
Feature/upgrade go 1.15.6 (#5)
Browse files Browse the repository at this point in the history
* upgrade go to 1.15.6

* add gcc-arm-linux-gnueabi, fix paths in sqlitetst

Co-authored-by: Stephan Hradek <[email protected]>
  • Loading branch information
Skeeve and Stephan Hradek authored Jan 9, 2021
1 parent 1b821ba commit b522ced
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM ubuntu:xenial

RUN apt-get update && \
apt-get install -y xz-utils build-essential libc6-i386 wget nano git && \
apt-get install -y xz-utils build-essential libc6-i386 wget nano git gcc-arm-linux-gnueabi && \
apt-get clean

# download Pocketbook SDK
Expand All @@ -14,13 +14,13 @@ ADD ./patches/* /tmp/
# download specified Go binary release that will act as a bootstrap compiler for Go toolchain
# download sources for that release and apply the patch
# build a new toolchain and remove an old one
RUN wget https://dl.google.com/go/go1.9.4.linux-amd64.tar.gz -qO /tmp/go.tar.gz && \
RUN wget https://dl.google.com/go/go1.15.6.linux-amd64.tar.gz -qO /tmp/go.tar.gz && \
tar -xf /tmp/go.tar.gz && \
rm /tmp/go.tar.gz && \
wget https://dl.google.com/go/go1.9.4.src.tar.gz -qO /tmp/go.tar.gz && \
wget https://dl.google.com/go/go1.15.6.src.tar.gz -qO /tmp/go.tar.gz && \
mkdir -p /gosrc && tar -xf /tmp/go.tar.gz -C /gosrc && \
rm /tmp/go.tar.gz && \
patch /gosrc/go/src/cmd/go/internal/work/build.go < /tmp/go-pb.patch && \
patch /gosrc/go/src/cmd/go/internal/work/exec.go < /tmp/go-pb.patch && \
patch /gosrc/go/src/net/dnsconfig_unix.go < /tmp/dns-pb.patch && \
cd /gosrc/go/src && GOROOT_BOOTSTRAP=/go ./make.bash && \
rm -r /go && mv /gosrc/go /go && rm -r /gosrc
Expand All @@ -33,12 +33,12 @@ CMD ["build"]

ADD ./* /gopath/src/github.com/dennwc/inkview/

ARG CC=arm-none-linux-gnueabi-gcc
ARG CC=arm-linux-gnueabi-gcc
ARG GOOS=linux
ARG GOARCH=arm
ARG GOARM=5
ARG GOARM=7
ARG CGO_ENABLED=1

ENV GOROOT=/go GOPATH=/gopath PATH="/go/bin:$PATH" CC=${CC} GOOS=${GOOS} GOARCH=${GOARCH} GOARM=${GOARM} CGO_ENABLED=${CGO_ENABLED}

RUN go get github.com/mattn/go-sqlite3
RUN go get github.com/mattn/go-sqlite3
10 changes: 5 additions & 5 deletions examples/sqlitetst.dir/sqlitetst.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ import (

func main() {
os.Chdir(filepath.Dir("/mnt/ext1"))
os.Remove("sqlite-database.db") // I delete the file to avoid duplicated records. SQLite is a file based database.
os.Remove("/mnt/ext1/sqlite-database.db") // I delete the file to avoid duplicated records. SQLite is a file based database.

log.Println("Creating sqlite-database.db...")
file, err := os.Create("sqlite-database.db") // Create SQLite file
file, err := os.Create("/mnt/ext1/sqlite-database.db") // Create SQLite file
if err != nil {
log.Fatal(err.Error())
}
file.Close()
log.Println("sqlite-database.db created")

sqliteDatabase, _ := sql.Open("sqlite3", "./sqlite-database.db") // Open the created SQLite File
defer sqliteDatabase.Close() // Defer Closing the database
createTable(sqliteDatabase) // Create Database Tables
sqliteDatabase, _ := sql.Open("sqlite3", "/mnt/ext1/sqlite-database.db") // Open the created SQLite File
defer sqliteDatabase.Close() // Defer Closing the database
createTable(sqliteDatabase) // Create Database Tables

// INSERT RECORDS
insertStudent(sqliteDatabase, "0001", "Liana Kim", "Bachelor")
Expand Down
6 changes: 3 additions & 3 deletions patches/go-pb.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- build.go 2018-02-10 21:34:30.152052311 +0200
+++ build.go 2018-02-10 21:37:02.217443227 +0200
@@ -3829,7 +3829,7 @@
--- exec.go 2020-12-03 18:32:44.000000000 +0100
+++ exec.go 2021-01-08 23:58:50.000000000 +0100
@@ -3073,7 +3073,7 @@
func (b *Builder) disableBuildID(ldflags []string) []string {
switch cfg.Goos {
case "android", "dragonfly", "linux", "netbsd":
Expand Down

0 comments on commit b522ced

Please sign in to comment.