karalabe / xgo

Go CGO cross compiler
MIT License
2.14k stars 280 forks source link

pkg-config --cflags -- gtk+-3.0 webkit2gtk-4.0 #165

Open viney opened 5 years ago

viney commented 5 years ago

exec: xgo --targets=linux/arm-7 ./

console:

Checking docker installation... Client: Docker Engine - Community Version: 19.03.1 API version: 1.40 Go version: go1.12.5 Git commit: 74b1e89 Built: Thu Jul 25 21:21:05 2019 OS/Arch: linux/amd64 Experimental: false

Server: Docker Engine - Community Engine: Version: 19.03.1 API version: 1.40 (minimum version 1.12) Go version: go1.12.5 Git commit: 74b1e89 Built: Thu Jul 25 21:19:41 2019 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.2.6 GitCommit: 894b81a4b802e4eb2a91d1ce216b8817763c29fb runc: Version: 1.0.0-rc8 GitCommit: 425e105d5a03fabd737a126ad93d62a9eeede87f docker-init: Version: 0.18.0 GitCommit: fec3683

Checking for required docker image karalabe/xgo-latest... found. Cross compiling github.com/zserge/webview/examples/demo... Building locally github.com/zserge/webview/examples/demo... Bootstrapping linux/arm-7... Compiling for linux/arm-7...

pkg-config --cflags -- gtk+-3.0 webkit2gtk-4.0

Package gtk+-3.0 was not found in the pkg-config search path. Perhaps you should add the directory containing gtk+-3.0.pc' to the PKG_CONFIG_PATH environment variable No package 'gtk+-3.0' found Package webkit2gtk-4.0 was not found in the pkg-config search path. Perhaps you should add the directory containingwebkit2gtk-4.0.pc' to the PKG_CONFIG_PATH environment variable No package 'webkit2gtk-4.0' found pkg-config: exit status 1 2019/08/07 17:38:11 Failed to cross compile package: exit status 2.

but exec: sudo apt-get install libgtk-3-dev libwebkit2gtk-4.0-dev

has been already install!!!

Reading package lists... Done Building dependency tree
Reading state information... Done libgtk-3-dev is already the newest version (3.22.30-1ubuntu4). libwebkit2gtk-4.0-dev is already the newest version (2.24.2-0ubuntu0.18.04.1). 0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

koddr commented 4 years ago

Same error at macOS 10.14.6, while I want to compile to Linux/amd64 binary.

My main.go is:

package main

import "github.com/zserge/webview"

func main() {
    // Webview options:
    //  - name: Yandex.Music Desktop
    name := "Yandex.Music Desktop"
    //  - URL to login screen: https://passport.yandex.com/auth?...
    url := "https://passport.yandex.com/auth?origin=music_button-header&retpath=https%3A%2F%2Fmusic.yandex.com%2Fhome"
    //  - sizes: 800x800 px
    width := 800
    height := 800
    //  - resizable: true
    resizable := true

    // Let's open window app with options:
    webview.Open(name, url, width, height, resizable)
}

System:

$ uname -a

Darwin Vic-MBP.local 18.7.0 Darwin Kernel Version 18.7.0: Sat Oct 12 00:02:19 PDT 2019; root:xnu-4903.278.12~1/RELEASE_X86_64 x86_64

Golang:

$ go version

go version go1.13.4 darwin/amd64

Makefile:

$ cat Makefile

build-linux:
        rm -rf ./build/Linux/ \
        && mkdir -p ./build/Linux/ \
        && xgo -out ./build/Linux/yamusic_desktop --targets=linux/amd64 \
        github.com/koddr/yandex-music-desktop

Error:

$ make build-linux

Checking docker installation...
Client: Docker Engine - Community
 Version:           19.03.5
 API version:       1.40
 Go version:        go1.12.12
 Git commit:        633a0ea
 Built:             Wed Nov 13 07:22:34 2019
 OS/Arch:           darwin/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.5
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.12
  Git commit:       633a0ea
  Built:            Wed Nov 13 07:29:19 2019
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.2.10
  GitCommit:        b34a5c8af56e510852c35414db4c1f4fa6172339
 runc:
  Version:          1.0.0-rc8+dev
  GitCommit:        3e425f80a8c931f88e6d94a8c831b9d5aa481657
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

Checking for required docker image karalabe/xgo-latest... found.
Cross compiling github.com/koddr/yandex-music-desktop...
Fetching main repository github.com/koddr/yandex-music-desktop...
github.com/koddr/yandex-music-desktop (download)
github.com/zserge/webview (download)
Compiling for linux/amd64...
go: downloading github.com/zserge/webview v0.0.0-20191103184548-1a9ebffc2601
go: extracting github.com/zserge/webview v0.0.0-20191103184548-1a9ebffc2601
go: finding github.com/zserge/webview v0.0.0-20191103184548-1a9ebffc2601

# pkg-config --cflags  -- gtk+-3.0 webkit2gtk-4.0
Package gtk+-3.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-3.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk+-3.0' found
Package webkit2gtk-4.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `webkit2gtk-4.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'webkit2gtk-4.0' found
pkg-config: exit status 1
2019/12/29 16:04:48 Failed to cross compile package: exit status 2.

make: *** [build-linux] Error 1

What I miss? Please help to understand.