Skip to content

Commit

Permalink
Make the build work
Browse files Browse the repository at this point in the history
`go get' is no longer supported outside a module. We can also not
embed the "blackterm" and "go-subcommand" libraries anymore.
  • Loading branch information
bertfrees committed Jan 20, 2023
1 parent 6765f69 commit a76252b
Show file tree
Hide file tree
Showing 28 changed files with 69 additions and 1,677 deletions.
41 changes: 7 additions & 34 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,54 +30,27 @@ clean:

build: test build-dp2

build-setup:
@export GOPATH="${GOPATH}"
@echo "Getting dependencies..."
@mkdir -p "${GOPATH}/src/github.com/daisy"
@test -d "${GOPATH}/src/github.com/daisy/pipeline-cli-go" || ln -s "${CURDIR}" "${GOPATH}/src/github.com/daisy/pipeline-cli-go"
# @${GO} get github.com/capitancambio/go-subcommand
@rm -rf "${GOPATH}/src/github.com/capitancambio/go-subcommand" && \
mkdir -p "${GOPATH}/src/github.com/capitancambio" && \
ln -s "$(CURDIR)/libs/go-subcommand" "${GOPATH}/src/github.com/capitancambio/"
# @${GO} get github.com/capitancambio/blackterm
@rm -rf "${GOPATH}/src/github.com/capitancambio/blackterm" && \
mkdir -p "${GOPATH}/src/github.com/capitancambio" && \
ln -s "$(CURDIR)/libs/blackterm" "${GOPATH}/src/github.com/capitancambio/"
@${GO} get github.com/capitancambio/chalk
@${GO} get github.com/russross/blackfriday
@${GO} get launchpad.net/goyaml
@if [ -d "$${PIPELINE_CLIENTLIB_PATH}" ]; then \
rm -rf "${GOPATH}/src/github.com/daisy/pipeline-clientlib-go" && \
ln -s "$${PIPELINE_CLIENTLIB_PATH}" "${GOPATH}/src/github.com/daisy/pipeline-clientlib-go" && \
${GO} get github.com/capitancambio/restclient; \
else \
${GO} get github.com/daisy/pipeline-clientlib-go; \
fi
@${GO} get github.com/kardianos/osext
@${GO} get golang.org/x/tools/cmd/cover

build-dp2: build-setup
build-dp2:
@echo "Building dp2..."
@${GO} install ${GOBUILD_FLAGS} github.com/daisy/pipeline-cli-go/dp2


dist: build-setup test
dist: test
@echo "Building for x-platform..."
@${GO} get github.com/mitchellh/gox
@${GO} install github.com/mitchellh/gox
#@${GOX} -build-toolchain \
#-osarch="linux/amd64 linux/386 darwin/386 darwin/amd64 windows/386 windows/amd64"
#-osarch="linux/amd64 linux/386 darwin/amd64 windows/386 windows/amd64"
@${GOX} -output="${GOPATH}/bin/{{.OS}}_{{.Arch}}/{{.Dir}}" \
-osarch="linux/amd64 linux/386 darwin/386 darwin/amd64 windows/386 windows/amd64" \
-osarch="linux/amd64 linux/386 darwin/amd64 windows/386 windows/amd64" \
./dp2/

test: build-setup
test:
@echo "Running tests..."
@${GO} test -covermode=atomic -coverprofile=${BUILDDIR}/profile.cov \
github.com/daisy/pipeline-cli-go/cli

cover-deploy: test
@${GO} get github.com/modocache/gover
@${GO} get github.com/mattn/goveralls
@${GO} install github.com/mattn/goveralls
@${GOVERALLS} \
-coverprofile=${BUILDDIR}/profile.cov \
-service=travis-ci
31 changes: 3 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,17 @@ Command-Line Interface for the DAISY Pipeline 2 (Golang)
How to build
------------
1. Install golang from the [official site](http://golang.org/doc/install). If you'll be creating distributions of the cli please install from the [sources](http://golang.org/doc/install/source)
2. Create a go source directory:

```
$ mkdir ~/src/golibs/
$ cd ~/src/golibs/
$ export GOPATH=~/src/golibs:$GOPATH
```

3. Install dependencies:
2. Run `make`. The building process will an executable named "dp2" in the build/bin/ folder.

3. Copy the default configuration file to the same directory as the binary:

go get github.com/capitancambio/go-subcommand
go get launchpad.net/goyaml
go get github.com/daisy-consortium/pipeline-clientlib-go
go get bitbucket.org/kardianos/osext
go get github.com/daisy-consortium/pipeline-cli-go
4. The building process will create two executables, dp2 and dp2admin in the bin/ folder:


go install github.com/daisy-consortium/pipeline-cli-go/dp2
go install github.com/daisy-consortium/pipeline-cli-go/dp2admin
5. Copy the default configuration file to the same directory as the binaries:


cp src/github.com/daisy-consortium/pipeline-cli-go/dp2/config.yml bin/
cp dp2/config.yml build/bin/

How to build and distribute using maven
---------------------------------------
In order to allow the go client play nice with the rest of the pipeline ecosystem a maven build process is provided, although right now it only works on linux and mac systems ( You should be able to make it work using cygwin though).

Follow the previous instructions till step 2. installing go from the sources.

cd src/github.com/daisy-consortium/pipeline-cli-go/
mvn clean install

You can find in the target/bin directory all the binaries from windows,mac and linux platforms.
Expand Down
4 changes: 2 additions & 2 deletions cli/admin.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package cli

import (
//"github.com/capitancambio/go-subcommand"
//"github.com/bertfrees/go-subcommand"
"fmt"
"text/template"

"github.com/capitancambio/go-subcommand"
"github.com/bertfrees/go-subcommand"
"github.com/daisy/pipeline-clientlib-go"
)

Expand Down
2 changes: 1 addition & 1 deletion cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"text/template"
"regexp"

"github.com/capitancambio/go-subcommand"
"github.com/bertfrees/go-subcommand"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion cli/cli.go.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"text/template"
"regexp"

"github.com/capitancambio/go-subcommand"
"github.com/bertfrees/go-subcommand"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion cli/cli_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cli

import (
//"github.com/capitancambio/go-subcommand"
//"github.com/bertfrees/go-subcommand"
"io/ioutil"
"os"
"strconv"
Expand Down
2 changes: 1 addition & 1 deletion cli/command_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"text/template"

"github.com/capitancambio/go-subcommand"
"github.com/bertfrees/go-subcommand"
)

//Convinience interface for building commands
Expand Down
4 changes: 2 additions & 2 deletions cli/scripts.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (
"regexp"
"strconv"

"github.com/capitancambio/blackterm"
"github.com/bertfrees/blackterm"
"github.com/capitancambio/chalk"
"github.com/capitancambio/go-subcommand"
"github.com/bertfrees/go-subcommand"
"github.com/daisy/pipeline-clientlib-go"
)

Expand Down
4 changes: 2 additions & 2 deletions cli/scripts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package cli
import (
"fmt"

"github.com/capitancambio/go-subcommand"
//"github.com/capitancambio/go-subcommand"
"github.com/bertfrees/go-subcommand"
//"github.com/bertfrees/go-subcommand"
//"github.com/daisy-consortium/pipeline-clientlib-go"
"io/ioutil"
"log"
Expand Down
2 changes: 1 addition & 1 deletion cli/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"runtime"
"strconv"

"github.com/capitancambio/go-subcommand"
"github.com/bertfrees/go-subcommand"
)

var keyFile = "dp2key.txt"
Expand Down
20 changes: 20 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module github.com/daisy/pipeline-cli-go

go 1.19

require (
github.com/bertfrees/blackterm v0.0.0-20230119134958-9d34cff72a06
github.com/bertfrees/go-subcommand v0.0.0-20230119135135-b5e2f5321a24
github.com/capitancambio/chalk v0.0.0-20160127153406-9dc2af224a17
github.com/capitancambio/restclient v0.0.0-20150219172137-547c7b5e0857
github.com/daisy/pipeline-clientlib-go v0.0.0-20200427151931-aad11eb63a65
github.com/hashicorp/go-version v1.0.0
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0
github.com/mattn/goveralls v0.0.11
github.com/mitchellh/gox v1.0.1
github.com/mitchellh/iochan v1.0.0
github.com/russross/blackfriday v1.6.0
golang.org/x/mod v0.7.0
golang.org/x/tools v0.5.0
launchpad.net/goyaml v0.0.0-20140305200416-000000000051
)
28 changes: 28 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
github.com/bertfrees/blackterm v0.0.0-20230119134958-9d34cff72a06 h1:ZoZMkn+v1qc5xDrn7B49PcPAGdKnn4jxTRYgflIIgLE=
github.com/bertfrees/blackterm v0.0.0-20230119134958-9d34cff72a06/go.mod h1:e9j/pnJ55+THF/WHkKhkE7qvQZEWX6AaDTKdGvjxj8o=
github.com/bertfrees/go-subcommand v0.0.0-20230119135135-b5e2f5321a24 h1:9GB9YMVkLpA95j9cnZmSHfOLpCvprEnU5vXDGz8QYq4=
github.com/bertfrees/go-subcommand v0.0.0-20230119135135-b5e2f5321a24/go.mod h1:urpfG4WXsCeGCwnQ4FRHQUbNk15zDYAjMzSQFSXBRmo=
github.com/capitancambio/chalk v0.0.0-20160127153406-9dc2af224a17 h1:6S9Ay6E27jv+ZZb3VCuifzFyvxSWrrk0KCU+dejxBdU=
github.com/capitancambio/chalk v0.0.0-20160127153406-9dc2af224a17/go.mod h1:p3Kfv6pT5RQC2hvn3BsSKJuA4BoJpngqFCqhWAGM4B8=
github.com/capitancambio/restclient v0.0.0-20150219172137-547c7b5e0857 h1:JjwRXa3o5gw+dan9/1omS0Uc5zZCllXcwzoqC3Ns13A=
github.com/capitancambio/restclient v0.0.0-20150219172137-547c7b5e0857/go.mod h1:vKGyQZIyL/Ryo5QkEXw1xQIaLiJ/h/wionfFdXLc+5o=
github.com/daisy/pipeline-clientlib-go v0.0.0-20200427151931-aad11eb63a65 h1:9/5fuP+lIM7KgFs3aMInV8LABZIZH2cjn/lUr2WNxaM=
github.com/daisy/pipeline-clientlib-go v0.0.0-20200427151931-aad11eb63a65/go.mod h1:EqAuNzs3I84oUiMMlo787kGYRaNKozEPMfThpfj+sW8=
github.com/hashicorp/go-version v1.0.0 h1:21MVWPKDphxa7ineQQTrCU5brh7OuVVAzGOCnnCPtE8=
github.com/hashicorp/go-version v1.0.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 h1:iQTw/8FWTuc7uiaSepXwyf3o52HaUYcV+Tu66S3F5GA=
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8=
github.com/mattn/goveralls v0.0.11 h1:eJXea6R6IFlL1QMKNMzDvvHv/hwGrnvyig4N+0+XiMM=
github.com/mattn/goveralls v0.0.11/go.mod h1:gU8SyhNswsJKchEV93xRQxX6X3Ei4PJdQk/6ZHvrvRk=
github.com/mitchellh/gox v1.0.1 h1:x0jD3dcHk9a9xPSDN6YEL4xL6Qz0dvNYm8yZqui5chI=
github.com/mitchellh/gox v1.0.1/go.mod h1:ED6BioOGXMswlXa2zxfh/xdd5QhwYliBFn9V18Ap4z4=
github.com/mitchellh/iochan v1.0.0 h1:C+X3KsSTLFVBr/tK1eYN/vs4rJcvsiLU338UhYPJWeY=
github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY=
github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww=
github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY=
golang.org/x/mod v0.7.0 h1:LapD9S96VoQRhi/GrNTqeBJFrUjs5UHCAtTlgwA5oZA=
golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/tools v0.5.0 h1:+bSpV5HIeWkuvgaMfI3UmKRThoTA5ODJTUd8T17NO+4=
golang.org/x/tools v0.5.0/go.mod h1:N+Kgy78s5I24c24dU8OfWNEotWjutIs8SnJvn5IDq+k=
launchpad.net/goyaml v0.0.0-20140305200416-000000000051 h1:pgtOxpWGtZwl5VEGtXB3s+VPsO3QzsZPg4/AS0Ag9HI=
launchpad.net/goyaml v0.0.0-20140305200416-000000000051/go.mod h1:HivH2TsqnIPviNUySFrCE+pbgbJCjrnMj2QH74o4y+w=
11 changes: 0 additions & 11 deletions libs/blackterm/.gitrepo

This file was deleted.

3 changes: 0 additions & 3 deletions libs/blackterm/README.md

This file was deleted.

Loading

0 comments on commit a76252b

Please sign in to comment.