diff --git a/build/build-darwin32-GUI.sh b/build/build-darwin32-GUI.sh index 09db4e7..c9b8383 100644 --- a/build/build-darwin32-GUI.sh +++ b/build/build-darwin32-GUI.sh @@ -2,6 +2,7 @@ echo Compiling 32-bit rproxy GUI... # 根据你的实际情况修改这里 export GOROOT=$HOME/godev/go +export GOPATH=$HOME/godev/gosrc export PATH=$GOROOT/bin:$PATH export GOARCH=386 diff --git a/build/build-darwin32.sh b/build/build-darwin32.sh index 73fc628..8ae9b19 100644 --- a/build/build-darwin32.sh +++ b/build/build-darwin32.sh @@ -2,6 +2,7 @@ echo Compiling 32-bit rproxy... # 根据你的实际情况修改这里 export GOROOT=$HOME/godev/go +export GOPATH=$HOME/godev/gosrc export PATH=$GOROOT/bin:$PATH export GOARCH=386 diff --git a/build/build-darwin64-GUI.sh b/build/build-darwin64-GUI.sh index c331e83..d6c610a 100644 --- a/build/build-darwin64-GUI.sh +++ b/build/build-darwin64-GUI.sh @@ -2,6 +2,7 @@ echo Compiling 64-bit rproxy GUI... # 根据你的实际情况修改这里 export GOROOT=$HOME/godev/go +export GOPATH=$HOME/godev/gosrc export PATH=$GOROOT/bin:$PATH export GOARCH=amd64 diff --git a/build/build-darwin64.sh b/build/build-darwin64.sh index e7412ef..cfa1863 100644 --- a/build/build-darwin64.sh +++ b/build/build-darwin64.sh @@ -2,6 +2,7 @@ echo Compiling 64-bit rproxy... # 根据你的实际情况修改这里 export GOROOT=$HOME/godev/go +export GOPATH=$HOME/godev/gosrc export PATH=$GOROOT/bin:$PATH export GOARCH=amd64 diff --git a/build/rpbuild.go b/build/rpbuild.go index f5a7c1f..fc1a3dc 100644 --- a/build/rpbuild.go +++ b/build/rpbuild.go @@ -88,15 +88,15 @@ func darwinPkg() { fmt.Println("编译rproxy-darwin64") if executeBash("build-darwin64.sh") == nil { - fmt.Println("打包rproxy-darwin") - createZipFile("rproxy-darwin.zip", false) + fmt.Println("打包rproxy-darwin64") + createZipFile("rproxy-darwin64.zip", false) } fmt.Println("------------------------------") fmt.Println("编译rproxy-darwin32-GUI") if executeBash("build-darwin32-GUI.sh") == nil { fmt.Println("打包rproxy-darwin32-GUI") - createZipFile("rproxy-win32-GUI.zip", true) + createZipFile("rproxy-darwin32-GUI.zip", true, true) } fmt.Println("------------------------------") @@ -125,7 +125,7 @@ func executeBash(fileName string) error { return err } -func createZipFile(zipFileName string, isGUI bool) error { +func createZipFile(zipFileName string, isGUI bool, isDarwin32 ...bool) error { f, err := os.Create(zipFileName) if err != nil { return err @@ -179,7 +179,11 @@ func createZipFile(zipFileName string, isGUI bool) error { if isGUI { fnSuffix = "_GUI" } - compressFile("../rproxy"+fnSuffix+exeExt, "rproxy"+exeExt) + + if len(isDarwin32) == 0 { + compressFile("../rproxy"+fnSuffix+exeExt, "rproxy"+exeExt) + } + // 复制动态链接库 if isGUI { switch runtime.GOOS { @@ -195,15 +199,16 @@ func createZipFile(zipFileName string, isGUI bool) error { compressFile("/usr/lib/liblcl.so", "") } case "darwin": - if runtime.GOARCH == "386" { - // 产生一个app - pkgMacOSApp("../rproxy_GUI") - compressFile("./rproxy.app/Contents/PkgInfo", "rproxy.app/Contents/PkgInfo") - compressFile("./rproxy.app/Contents/Info.plist", "rproxy.app/Contents/Info.plist") - compressFile("./rproxy.app/Contents/Resources/rproxy.icns", "rproxy.app/Contents/Resources/rproxy.icns") - compressFile("./rproxy.app/Contents/MacOS/rproxy", "rproxy.app/Contents/MacOS/rproxy") - compressFile("./rproxy.app/Contents/MacOS/liblcl.dylib", "rproxy.app/Contents/MacOS/liblcl.dylib") - } + + // 产生一个app + pkgMacOSApp("../rproxy_GUI") + + compressFile("./rproxy.app/Contents/PkgInfo", "rproxy.app/Contents/PkgInfo") + compressFile("./rproxy.app/Contents/Info.plist", "rproxy.app/Contents/Info.plist") + compressFile("./rproxy.app/Contents/Resources/rproxy.icns", "rproxy.app/Contents/Resources/rproxy.icns") + compressFile("./rproxy.app/Contents/MacOS/rproxy", "rproxy.app/Contents/MacOS/rproxy") + compressFile("./rproxy.app/Contents/MacOS/liblcl.dylib", "rproxy.app/Contents/MacOS/liblcl.dylib") + } } @@ -348,6 +353,7 @@ func pkgMacOSApp(exeFileName string) error { } copyFile(exeFileName, execFile) + os.Chmod(execFile, 0755) return nil } diff --git a/defaultRes_windows_gui.syso b/defaultRes_windows.syso similarity index 100% rename from defaultRes_windows_gui.syso rename to defaultRes_windows.syso diff --git a/imgs/rproxy.icns b/imgs/rproxy.icns index c8507e3..0e59b42 100644 Binary files a/imgs/rproxy.icns and b/imgs/rproxy.icns differ diff --git a/imgs/rproxy.png b/imgs/rproxy.png new file mode 100644 index 0000000..1f0a10d Binary files /dev/null and b/imgs/rproxy.png differ diff --git a/main_gui.go b/main_gui.go index 8106668..6640d2b 100644 --- a/main_gui.go +++ b/main_gui.go @@ -4,13 +4,13 @@ package main import ( "github.com/ying32/govcl/vcl" - "github.com/ying32/govcl/vcl/exts/tools" + //"github.com/ying32/govcl/vcl/exts/tools" ) // GUI模式下暂时只能是客户端,服务端依然使用命令行。 // 另外如果更新了MainForm.go或者MainFormImpl.go需要在前面补充自定义标题 // +build gui func main() { - tools.RunWithMacOSApp() + //tools.RunWithMacOSApp() vcl.Application.SetFormScaled(true) vcl.Application.Initialize() vcl.Application.SetMainFormOnTaskBar(true)