From e0bca81528303045156378f97f721d760738a09b Mon Sep 17 00:00:00 2001 From: JeremyRand Date: Sat, 8 Jun 2019 06:09:56 +0000 Subject: [PATCH] Fix macOS builds --- keyring/cmake.gpg | 1 + keyring/llvm.gpg | 1 + projects/cctools | 1 + projects/cmake | 1 + projects/gopkg.in,hlandau,service.v2/config | 29 +++++++++++--- projects/gopkg.in,hlandau,svcutils.v1/config | 41 +++++++++++++++++--- projects/llvm | 1 + projects/macosx-toolchain | 1 + projects/ncdns/build | 17 ++++++-- projects/ncdns/config | 11 +++++- 10 files changed, 86 insertions(+), 18 deletions(-) create mode 120000 keyring/cmake.gpg create mode 120000 keyring/llvm.gpg create mode 120000 projects/cctools create mode 120000 projects/cmake create mode 120000 projects/llvm create mode 120000 projects/macosx-toolchain diff --git a/keyring/cmake.gpg b/keyring/cmake.gpg new file mode 120000 index 0000000..ed86f80 --- /dev/null +++ b/keyring/cmake.gpg @@ -0,0 +1 @@ +../tor-browser-build/keyring/cmake.gpg \ No newline at end of file diff --git a/keyring/llvm.gpg b/keyring/llvm.gpg new file mode 120000 index 0000000..1ef2c45 --- /dev/null +++ b/keyring/llvm.gpg @@ -0,0 +1 @@ +../tor-browser-build/keyring/llvm.gpg \ No newline at end of file diff --git a/projects/cctools b/projects/cctools new file mode 120000 index 0000000..a88535d --- /dev/null +++ b/projects/cctools @@ -0,0 +1 @@ +../tor-browser-build/projects/cctools \ No newline at end of file diff --git a/projects/cmake b/projects/cmake new file mode 120000 index 0000000..6e43969 --- /dev/null +++ b/projects/cmake @@ -0,0 +1 @@ +../tor-browser-build/projects/cmake \ No newline at end of file diff --git a/projects/gopkg.in,hlandau,service.v2/config b/projects/gopkg.in,hlandau,service.v2/config index 969ebe4..00477d7 100644 --- a/projects/gopkg.in,hlandau,service.v2/config +++ b/projects/gopkg.in,hlandau,service.v2/config @@ -13,16 +13,29 @@ var: - gopkg.in,hlandau,svcutils.v1 - gopkg.in,hlandau,easyconfig.v1 build_go_lib_pre: | - [% IF c("var/linux") %] + [% IF c("var/cgo") %] [% pc(c('var/compiler'), 'var/setup', { compiler_tarfile => c('input_files_by_name/' _ c('var/compiler')) }) %] - tar -C /var/tmp/dist -xf $rootdir/[% c('input_files_by_name/binutils') %] - export PATH="/var/tmp/dist/binutils/bin:$PATH" + [% IF c("var/linux") %] + tar -C /var/tmp/dist -xf $rootdir/[% c('input_files_by_name/binutils') %] + export PATH="/var/tmp/dist/binutils/bin:$PATH" + [% END -%] - export CGO_ENABLED=1 + [% IF c("var/osx") -%] + export CGO_CFLAGS="[% c("var/FLAGS") %] -mmacosx-version-min=10.7" + export CGO_CXXFLAGS="[% c("var/FLAGS") %] -stdlib=libc++ -mmacosx-version-min=10.7" + export CGO_LDFLAGS="[% c("var/FLAGS") %] -stdlib=libc++ -mmacosx-version-min=10.7" + export CC="$clangdir/bin/clang" + export CXX="$clangdir/bin/clang++" + [% END -%] [% END -%] + export CGO_ENABLED=[% c("var/cgo") %] + targets: + linux: + var: + cgo: 1 linux-i686: var: arch_deps: @@ -31,12 +44,16 @@ targets: var: arch_deps: - libcap-dev + osx-x86_64: + var: + cgo: 0 windows: var: go_lib_deps: - github.com,btcsuite,winsvc - gopkg.in,hlandau,svcutils.v1 - gopkg.in,hlandau,easyconfig.v1 + cgo: 0 input_files: - project: container-image @@ -44,10 +61,10 @@ input_files: project: go - name: '[% c("var/compiler") %]' project: '[% c("var/compiler") %]' - enable: '[% c("var/linux") %]' + enable: '[% c("var/cgo") %]' - name: binutils project: binutils - enable: '[% c("var/linux") %]' + enable: '[% c("var/linux") && c("var/cgo") %]' - name: github.com,btcsuite,winsvc project: github.com,btcsuite,winsvc enable: '[% c("var/windows") %]' diff --git a/projects/gopkg.in,hlandau,svcutils.v1/config b/projects/gopkg.in,hlandau,svcutils.v1/config index ff2f1da..05c6cf5 100644 --- a/projects/gopkg.in,hlandau,svcutils.v1/config +++ b/projects/gopkg.in,hlandau,svcutils.v1/config @@ -9,17 +9,40 @@ var: container: use_container: 1 go_lib: gopkg.in/hlandau/svcutils.v1 + go_lib_install: + - gopkg.in/hlandau/svcutils.v1 + - gopkg.in/hlandau/svcutils.v1/caps + - gopkg.in/hlandau/svcutils.v1/chroot + - gopkg.in/hlandau/svcutils.v1/dupfd + - gopkg.in/hlandau/svcutils.v1/exepath + - gopkg.in/hlandau/svcutils.v1/passwd + - gopkg.in/hlandau/svcutils.v1/pidfile + - gopkg.in/hlandau/svcutils.v1/setuid + - gopkg.in/hlandau/svcutils.v1/systemd build_go_lib_pre: | - [% IF c("var/linux") %] + [% IF c("var/cgo") %] [% pc(c('var/compiler'), 'var/setup', { compiler_tarfile => c('input_files_by_name/' _ c('var/compiler')) }) %] - tar -C /var/tmp/dist -xf $rootdir/[% c('input_files_by_name/binutils') %] - export PATH="/var/tmp/dist/binutils/bin:$PATH" + [% IF c("var/linux") %] + tar -C /var/tmp/dist -xf $rootdir/[% c('input_files_by_name/binutils') %] + export PATH="/var/tmp/dist/binutils/bin:$PATH" + [% END -%] - export CGO_ENABLED=1 + [% IF c("var/osx") -%] + export CGO_CFLAGS="[% c("var/FLAGS") %] -mmacosx-version-min=10.7" + export CGO_CXXFLAGS="[% c("var/FLAGS") %] -stdlib=libc++ -mmacosx-version-min=10.7" + export CGO_LDFLAGS="[% c("var/FLAGS") %] -stdlib=libc++ -mmacosx-version-min=10.7" + export CC="$clangdir/bin/clang" + export CXX="$clangdir/bin/clang++" + [% END -%] [% END -%] + export CGO_ENABLED=[% c("var/cgo") %] + targets: + linux: + var: + cgo: 1 linux-i686: var: arch_deps: @@ -28,6 +51,12 @@ targets: var: arch_deps: - libcap-dev + osx-x86_64: + var: + cgo: 0 + windows: + var: + cgo: 0 input_files: - project: container-image @@ -35,7 +64,7 @@ input_files: project: go - name: '[% c("var/compiler") %]' project: '[% c("var/compiler") %]' - enable: '[% c("var/linux") %]' + enable: '[% c("var/cgo") %]' - name: binutils project: binutils - enable: '[% c("var/linux") %]' + enable: '[% c("var/linux") && c("var/cgo") %]' diff --git a/projects/llvm b/projects/llvm new file mode 120000 index 0000000..7ab866e --- /dev/null +++ b/projects/llvm @@ -0,0 +1 @@ +../tor-browser-build/projects/llvm \ No newline at end of file diff --git a/projects/macosx-toolchain b/projects/macosx-toolchain new file mode 120000 index 0000000..bb252c7 --- /dev/null +++ b/projects/macosx-toolchain @@ -0,0 +1 @@ +../tor-browser-build/projects/macosx-toolchain \ No newline at end of file diff --git a/projects/ncdns/build b/projects/ncdns/build index 16e45c8..f264557 100644 --- a/projects/ncdns/build +++ b/projects/ncdns/build @@ -1,14 +1,23 @@ #!/bin/bash [% c("var/set_default_env") -%] [% pc('go', 'var/setup', { go_tarfile => c('input_files_by_name/go') }) %] -[% IF c("var/linux") %] +[% IF c("var/cgo") %] [% pc(c('var/compiler'), 'var/setup', { compiler_tarfile => c('input_files_by_name/' _ c('var/compiler')) }) %] - tar -C /var/tmp/dist -xf $rootdir/[% c('input_files_by_name/binutils') %] - export PATH="/var/tmp/dist/binutils/bin:$PATH" + [% IF c("var/linux") %] + tar -C /var/tmp/dist -xf $rootdir/[% c('input_files_by_name/binutils') %] + export PATH="/var/tmp/dist/binutils/bin:$PATH" + [% END -%] - export CGO_ENABLED=1 + [% IF c("var/osx") -%] + export CGO_CFLAGS="[% c("var/FLAGS") %] -mmacosx-version-min=10.7" + export CGO_CXXFLAGS="[% c("var/FLAGS") %] -stdlib=libc++ -mmacosx-version-min=10.7" + export CGO_LDFLAGS="[% c("var/FLAGS") %] -stdlib=libc++ -mmacosx-version-min=10.7" + export CC="$clangdir/bin/clang" + export CXX="$clangdir/bin/clang++" + [% END -%] [% END -%] +export CGO_ENABLED=[% c("var/cgo") %] distdir=/var/tmp/dist/[% project %] mkdir -p $distdir diff --git a/projects/ncdns/config b/projects/ncdns/config index 6363419..157c902 100644 --- a/projects/ncdns/config +++ b/projects/ncdns/config @@ -20,6 +20,9 @@ var: - golang.org,x,net targets: + linux: + var: + cgo: 1 linux-i686: var: arch_deps: @@ -28,6 +31,9 @@ targets: var: arch_deps: - libcap-dev + osx-x86_64: + var: + cgo: 0 windows: var: go_lib_deps: @@ -43,6 +49,7 @@ targets: - gopkg.in,hlandau,service.v2 - golang.org,x,net - golang.org,x,sys + cgo: 0 input_files: - project: container-image @@ -50,10 +57,10 @@ input_files: project: go - name: '[% c("var/compiler") %]' project: '[% c("var/compiler") %]' - enable: '[% c("var/linux") %]' + enable: '[% c("var/cgo") %]' - name: binutils project: binutils - enable: '[% c("var/linux") %]' + enable: '[% c("var/linux") && c("var/cgo") %]' - name: github.com,hlandau,xlog project: github.com,hlandau,xlog - name: github.com,hlandau,dexlogconfig