ui尝试支持mac
parent
763a5aa59d
commit
a69116d3ad
|
|
@ -9,18 +9,23 @@ import (
|
|||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func main() {
|
||||
BuildCliBinary() // 编译二进制
|
||||
if os.Getenv("GITHUB_ACTIONS") == "" { // 正常编译
|
||||
CreateLibForQtUi(true) // 创建Qt需要使用的.a库文件
|
||||
BuildCliBinary() // 编译命令行版本
|
||||
if os.Getenv("GITHUB_ACTIONS") == "" { // 本地编译
|
||||
CreateLibForQtUi("amd64-static") // 创建Qt需要使用的.a库文件
|
||||
WriteVersionDotRc("1.5.6")
|
||||
} else { // github actions 编译
|
||||
CreateLibForQtUi(false)
|
||||
if len(os.Args)<=1 || os.Args[1] != "check-only" {
|
||||
} else { // github actions 编译
|
||||
if runtime.GOOS == "darwin" { // 编译darwin版本的dmg
|
||||
CreateLibForQtUi("amd64-shared")
|
||||
} else { // 编译windows版本的exe
|
||||
CreateLibForQtUi("386-static")
|
||||
}
|
||||
if len(os.Args) <= 1 || os.Args[1] != "check-only" {
|
||||
version := strings.TrimPrefix(os.Getenv("GITHUB_REF_NAME"), "v")
|
||||
WriteVersionDotRc(version)
|
||||
}
|
||||
|
|
@ -77,7 +82,7 @@ func BuildCliBinary() {
|
|||
}
|
||||
}
|
||||
|
||||
func CreateLibForQtUi(isAmd64 bool) {
|
||||
func CreateLibForQtUi(mode string) {
|
||||
ctx := go2cpp.NewGo2cppContext(go2cpp.NewGo2cppContext_Req{
|
||||
CppBaseName: "m3u8d",
|
||||
EnableQtClass_RunOnUiThread: true,
|
||||
|
|
@ -89,12 +94,15 @@ func CreateLibForQtUi(isAmd64 bool) {
|
|||
ctx.Generate1(m3u8d.GetWd)
|
||||
ctx.Generate1(m3u8d.ParseCurlStr)
|
||||
ctx.Generate1(m3u8d.RunDownload_Req_ToCurlStr)
|
||||
if isAmd64 {
|
||||
if mode == "amd64-static" {
|
||||
ctx.MustCreateAmd64LibraryInDir("m3u8d-qt")
|
||||
} else {
|
||||
} else if mode == "386-static" {
|
||||
ctx.MustCreate386LibraryInDir("m3u8d-qt")
|
||||
} else if mode == "amd64-shared" {
|
||||
ctx.MustCreateAmd64CSharedInDir("m3u8d-qt")
|
||||
} else {
|
||||
panic(mode)
|
||||
}
|
||||
fmt.Println("isAmd64", isAmd64)
|
||||
}
|
||||
|
||||
func WriteVersionDotRc(version string) {
|
||||
|
|
|
|||
2
go.mod
2
go.mod
|
|
@ -4,7 +4,7 @@ go 1.17
|
|||
|
||||
require (
|
||||
github.com/orestonce/cdb v0.0.0-20220528005855-d187c22240e2
|
||||
github.com/orestonce/go2cpp v0.0.0-20220730064838-feb9dd043919
|
||||
github.com/orestonce/go2cpp v0.0.0-20220802140809-b2a921a62a07
|
||||
github.com/orestonce/gopool v0.0.0-20220508090328-d7d56d45b171
|
||||
github.com/spf13/cobra v1.4.0
|
||||
github.com/yapingcat/gomedia v0.0.0-20220731053213-04782526c441
|
||||
|
|
|
|||
6
go.sum
6
go.sum
|
|
@ -3,10 +3,10 @@ github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NH
|
|||
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
|
||||
github.com/orestonce/cdb v0.0.0-20220528005855-d187c22240e2 h1:AmGkuxSIOW0gA/jetY8d1DVV0cyQ08FMCxa1arkI6HQ=
|
||||
github.com/orestonce/cdb v0.0.0-20220528005855-d187c22240e2/go.mod h1:HMNNdA1LMQFJRwobtCzVevWcInFSo9rfs1fYeVYwU+c=
|
||||
github.com/orestonce/go2cpp v0.0.0-20220704224208-2d58769247a4 h1:v6Y0pkcMIJdRgow+X9smChnYkC2v9Zqae/QjB7zzMoo=
|
||||
github.com/orestonce/go2cpp v0.0.0-20220704224208-2d58769247a4/go.mod h1:1fsOAZftk08/dOTRqlp6f/MVwaEKOhrnPUg0RtWiSdY=
|
||||
github.com/orestonce/go2cpp v0.0.0-20220730064838-feb9dd043919 h1:f8oUxbDjOgXrBhtDSaNWNAnZEPDTwrjpccdsrn4UCUs=
|
||||
github.com/orestonce/go2cpp v0.0.0-20220730064838-feb9dd043919/go.mod h1:1fsOAZftk08/dOTRqlp6f/MVwaEKOhrnPUg0RtWiSdY=
|
||||
github.com/orestonce/go2cpp v0.0.0-20220802140809-b2a921a62a07 h1:nyt0GDiskod5Y9uNVrXgK7PZHeL7Ab1uVc3LhLg7/gk=
|
||||
github.com/orestonce/go2cpp v0.0.0-20220802140809-b2a921a62a07/go.mod h1:1fsOAZftk08/dOTRqlp6f/MVwaEKOhrnPUg0RtWiSdY=
|
||||
github.com/orestonce/gopool v0.0.0-20220508090328-d7d56d45b171 h1:NnOl6HTrhrlTT7aaAybVOtq+fEztGFMoQtegckgwLdk=
|
||||
github.com/orestonce/gopool v0.0.0-20220508090328-d7d56d45b171/go.mod h1:MCQUrAPiG9/PTjHJuGqWLasKbIaG6z62KO6kfp90byM=
|
||||
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||
|
|
@ -14,8 +14,6 @@ github.com/spf13/cobra v1.4.0 h1:y+wJpx64xcgO1V+RcnwW0LEHxTKRi2ZDPSBjWnrg88Q=
|
|||
github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g=
|
||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
github.com/yapingcat/gomedia v0.0.0-20220721095559-a283c87d8a0b h1:ugQfEkchgCe+MBtP/Ih+ypTr1WhlcTHahnIDrS1GXoo=
|
||||
github.com/yapingcat/gomedia v0.0.0-20220721095559-a283c87d8a0b/go.mod h1:WSZ59bidJOO40JSJmLqlkBJrjZCtjbKKkygEMfzY/kc=
|
||||
github.com/yapingcat/gomedia v0.0.0-20220731053213-04782526c441 h1:SAohYbjWwtDtpjW9GmV6IFDou2CW4MvUXxJtz3FiuR0=
|
||||
github.com/yapingcat/gomedia v0.0.0-20220731053213-04782526c441/go.mod h1:WSZ59bidJOO40JSJmLqlkBJrjZCtjbKKkygEMfzY/kc=
|
||||
golang.org/x/net v0.0.0-20220617184016-355a448f1bc9 h1:Yqz/iviulwKwAREEeUd3nbBFn0XuyJqkoft2IlrvOhc=
|
||||
|
|
|
|||
|
|
@ -39,4 +39,10 @@ FORMS += \
|
|||
mainwindow.ui \
|
||||
curldialog.ui
|
||||
|
||||
LIBS += -L$$PWD -lm3u8d-impl
|
||||
win32{
|
||||
#静态库
|
||||
LIBS += -L$$PWD -lm3u8d-impl
|
||||
} else {
|
||||
#动态库
|
||||
LIBS += $$PWD/m3u8d-impl
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue