Skip to content
This repository has been archived by the owner on Jul 20, 2021. It is now read-only.

Commit

Permalink
Update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
richardwilkes committed Feb 22, 2019
1 parent 26a1f38 commit f01aa6f
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 27 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/richardwilkes/cef

require github.com/richardwilkes/toolbox v1.1.6
require github.com/richardwilkes/toolbox v1.1.8
9 changes: 4 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@ github.com/pkg/term v0.0.0-20190109203006-aa71e9d9e942 h1:A7GG7zcGjl3jqAqGPmcNjd
github.com/pkg/term v0.0.0-20190109203006-aa71e9d9e942/go.mod h1:eCbImbZ95eXtAUIbLAuAVnBnwf83mjf6QIVH8SHYwqQ=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/richardwilkes/toolbox v1.1.6 h1:PB6UljMWRB4bxM5bCbblOX+ybnpcjnV6qY5zcAheRUQ=
github.com/richardwilkes/toolbox v1.1.6/go.mod h1:edL6Olij9w158Mdr9kkoRGGAokwDrlMPjIJ+jkRmdG4=
github.com/richardwilkes/toolbox v1.1.8 h1:9f0OzdJJjNx0nMBP91kVCiZ4J4atd88RcGnDj/WTamA=
github.com/richardwilkes/toolbox v1.1.8/go.mod h1:tbqTOR46bZXq5O2tuKWEELRsSBUXaWHGfPm9yDLXpOU=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190220154126-629670e5acc5 h1:3Nsfe5Xa1wTt01QxlAFIY5j9ycDtS+d7mhvI8ZY5bn0=
golang.org/x/sys v0.0.0-20190220154126-629670e5acc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190221222158-ec7b60b042fd h1:JYgmSAJhrvxjUInD1uG+wLPAFAG7TmIJLOgZLI210A8=
golang.org/x/sys v0.0.0-20190221222158-ec7b60b042fd/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
17 changes: 9 additions & 8 deletions internal/cmd/dist.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"strconv"
"time"

"github.com/richardwilkes/toolbox"
"github.com/richardwilkes/toolbox/atexit"
"github.com/richardwilkes/toolbox/cmdline"
"github.com/richardwilkes/toolbox/xio/fs"
Expand Down Expand Up @@ -40,7 +41,7 @@ func NewDist() cmdline.Cmd {
copyrightOwner: "Unknown",
}
switch runtime.GOOS {
case MacOS:
case toolbox.MacOS:
d.root = path.Join(d.root, "macos")
d.icon = "AppIcon.icns"
default:
Expand Down Expand Up @@ -74,11 +75,11 @@ func (d *dist) Run(cl *cmdline.CmdLine, args []string) error {
fmt.Println(err)
atexit.Exit(1)
}
createDir(d.root, 0755)
createDir(d.root, 0755) //nolint:gocritic
switch runtime.GOOS {
case MacOS:
case toolbox.MacOS:
d.distMacOS()
case LinuxOS, WindowsOS:
case toolbox.LinuxOS, toolbox.WindowsOS:
d.distNotMacOS()
default:
return fmt.Errorf("Unhandled OS: %s", runtime.GOOS)
Expand All @@ -88,14 +89,14 @@ func (d *dist) Run(cl *cmdline.CmdLine, args []string) error {

func (d *dist) distMacOS() {
appBundleContentsDir := path.Join(d.root, d.bundleName+".app", "Contents")
createDir(path.Join(appBundleContentsDir, "MacOS"), 0755)
createDir(path.Join(appBundleContentsDir, "MacOS"), 0755) //nolint:gocritic
appBundleResourcesDir := path.Join(appBundleContentsDir, "Resources")
createDir(appBundleResourcesDir, 0755)
createDir(appBundleResourcesDir, 0755) //nolint:gocritic
appFrameworksDir := path.Join(appBundleContentsDir, "Frameworks")
helperAppBundleContentsDir := path.Join(appFrameworksDir, d.exeName+" Helper.app", "Contents")
helperAppBundleMacOSDir := path.Join(helperAppBundleContentsDir, "MacOS")
createDir(helperAppBundleMacOSDir, 0755)
createDir(path.Join(helperAppBundleContentsDir, "Frameworks"), 0755)
createDir(helperAppBundleMacOSDir, 0755) //nolint:gocritic
createDir(path.Join(helperAppBundleContentsDir, "Frameworks"), 0755) //nolint:gocritic
releaseDir := path.Join(installPrefix, "Release")
cc := exec.Command("cc", "-I", installPrefix, path.Join(installPrefix, "helper", "helper.c"), "-F", releaseDir, "-framework", "Chromium Embedded Framework", "-o", path.Join(helperAppBundleMacOSDir, d.exeName+" Helper"))
if result, err := cc.CombinedOutput(); err != nil {
Expand Down
7 changes: 4 additions & 3 deletions internal/cmd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"strings"
"time"

"github.com/richardwilkes/toolbox"
"github.com/richardwilkes/toolbox/atexit"
"github.com/richardwilkes/toolbox/cmdline"
"github.com/richardwilkes/toolbox/xio"
Expand Down Expand Up @@ -70,7 +71,7 @@ func (c *install) Run(cl *cmdline.CmdLine, args []string) error {
fmt.Println("You may need to run the 'cef' tool as root.")
atexit.Exit(1)
}
createDir(path.Join(installPrefix, "helper"), 0755)
createDir(path.Join(installPrefix, "helper"), 0755) //nolint:gocritic
name := path.Join(installPrefix, "helper", "helper.c")
checkFileError(ioutil.WriteFile(name, []byte(`#include <stdlib.h>
#include "include/capi/cef_app_capi.h"
Expand All @@ -83,9 +84,9 @@ int main(int argc, char **argv) {
}
`), 0644), "write", name)
c.untar(bytes.NewBuffer(c.downloadAndUncompressArchive()))
if runtime.GOOS == WindowsOS {
if runtime.GOOS == toolbox.WindowsOS {
dir := path.Join(path.Dir(os.Getenv("MINGW_PREFIX")), "lib/pkgconfig")
createDir(dir, 0755)
createDir(dir, 0755) //nolint:gocritic
name = path.Join(dir, "cef.pc")
f, err := os.Create(name)
checkFileError(err, "create", name)
Expand Down
14 changes: 4 additions & 10 deletions internal/cmd/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,22 @@ import (
"path"
"runtime"

"github.com/richardwilkes/toolbox"
"github.com/richardwilkes/toolbox/atexit"
)

// Constants for comparison to runtime.GOOS
const (
MacOS = "darwin"
WindowsOS = "windows"
LinuxOS = "linux"
)

var (
installPrefix = "/usr/local/cef"
cefPlatform string
)

func checkPlatform() {
switch runtime.GOOS {
case MacOS:
case toolbox.MacOS:
cefPlatform = "macosx64"
case LinuxOS:
case toolbox.LinuxOS:
cefPlatform = "linux64"
case WindowsOS:
case toolbox.WindowsOS:
if os.Getenv("MSYSTEM") != "MINGW64" {
fmt.Println("Windows is only supported through the use of MINGW64")
atexit.Exit(1)
Expand Down

0 comments on commit f01aa6f

Please sign in to comment.