Merge #28: Add ncp11 project and its dependencies
pull/47/heada503c1b
Add ncp11 project (JeremyRand)6f34bbd
Add namecoin/pkcs11mod project (JeremyRand)0ee2b0e
Add miekg/pkcs11 project (JeremyRand) Pull request description: Fixes https://github.com/namecoin/ncdns-repro/issues/10 . Fixes https://github.com/namecoin/ncdns-repro/issues/16 . ~~Only tested on GNU/Linux targets. Windows definitely won't work yet due to an ncp11/pkcs11mod bug that's out of scope for this PR.~~ GNU/Linux and Windows now both work. macOS is untested. TODO: - [x] Merge https://github.com/namecoin/ncdns-repro/pull/23 first (this PR will then need a rebase). - [x] Finalize the commits marked (WIP).
commit
732585f87e
@ -0,0 +1,42 @@
|
||||
version: '[% c("abbrev") %]'
|
||||
git_url: https://github.com/miekg/pkcs11.git
|
||||
git_hash: '[% config.var_p.id.${"github.com/miekg/pkcs11"} %]'
|
||||
filename: '[% project %]-[% c("version") %]-[% c("var/osname") %]-[% c("var/build_id") %].tar.gz'
|
||||
|
||||
build: '[% c("projects/go/var/build_go_lib") %]'
|
||||
|
||||
var:
|
||||
container:
|
||||
use_container: 1
|
||||
go_lib: github.com/miekg/pkcs11
|
||||
cgo: 1
|
||||
build_go_lib_pre: |
|
||||
[% IF c("var/cgo") %]
|
||||
[% pc(c('var/compiler'), 'var/setup', { compiler_tarfile => c('input_files_by_name/' _ c('var/compiler')) }) %]
|
||||
|
||||
[% 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 -%]
|
||||
|
||||
[% 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") %]
|
||||
|
||||
input_files:
|
||||
- project: container-image
|
||||
- name: go
|
||||
project: go
|
||||
- name: '[% c("var/compiler") %]'
|
||||
project: '[% c("var/compiler") %]'
|
||||
enable: '[% c("var/cgo") %]'
|
||||
- name: binutils
|
||||
project: binutils
|
||||
enable: '[% c("var/linux") && c("var/cgo") %]'
|
@ -0,0 +1,56 @@
|
||||
version: '[% c("abbrev") %]'
|
||||
git_url: https://github.com/namecoin/pkcs11mod.git
|
||||
git_hash: '[% config.var_p.id.${"github.com/namecoin/pkcs11mod"} %]'
|
||||
filename: '[% project %]-[% c("version") %]-[% c("var/osname") %]-[% c("var/build_id") %].tar.gz'
|
||||
|
||||
build: '[% c("projects/go/var/build_go_lib") %]'
|
||||
|
||||
var:
|
||||
container:
|
||||
use_container: 1
|
||||
go_lib: github.com/namecoin/pkcs11mod
|
||||
go_lib_deps:
|
||||
- github.com,miekg,pkcs11
|
||||
cgo: 1
|
||||
build_go_lib_pre: |
|
||||
[% IF c("var/cgo") %]
|
||||
[% pc(c('var/compiler'), 'var/setup', { compiler_tarfile => c('input_files_by_name/' _ c('var/compiler')) }) %]
|
||||
|
||||
[% 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"
|
||||
|
||||
# The pkcs11mod Makefile wants to see CC
|
||||
export CC="$(go env CC)"
|
||||
[% END -%]
|
||||
|
||||
[% 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 -%]
|
||||
|
||||
[% IF c("var/windows") %]
|
||||
# The pkcs11mod Makefile wants to see CC
|
||||
export CC="$(go env CC)"
|
||||
[% END -%]
|
||||
[% END -%]
|
||||
|
||||
export CGO_ENABLED=[% c("var/cgo") %]
|
||||
|
||||
go generate [% c("var/go_lib") %]
|
||||
|
||||
input_files:
|
||||
- project: container-image
|
||||
- name: go
|
||||
project: go
|
||||
- name: '[% c("var/compiler") %]'
|
||||
project: '[% c("var/compiler") %]'
|
||||
enable: '[% c("var/cgo") %]'
|
||||
- name: binutils
|
||||
project: binutils
|
||||
enable: '[% c("var/linux") && c("var/cgo") %]'
|
||||
- name: github.com,miekg,pkcs11
|
||||
project: github.com,miekg,pkcs11
|
@ -0,0 +1,70 @@
|
||||
#!/bin/bash
|
||||
[% c("var/set_default_env") -%]
|
||||
[% pc('go', 'var/setup', { go_tarfile => c('input_files_by_name/go') }) %]
|
||||
[% IF c("var/cgo") %]
|
||||
[% pc(c('var/compiler'), 'var/setup', { compiler_tarfile => c('input_files_by_name/' _ c('var/compiler')) }) %]
|
||||
|
||||
[% 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 -%]
|
||||
|
||||
[% 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
|
||||
|
||||
[% FOREACH dep = c("var/go_lib_deps") -%]
|
||||
tar -C /var/tmp/dist -xf [% c('input_files_by_name/' _ dep) %]
|
||||
[% END -%]
|
||||
|
||||
mkdir -p $GOPATH/src/github.com/namecoin
|
||||
tar -C $GOPATH/src/github.com/namecoin -xf [% project %]-[% c('version') %].tar.gz
|
||||
mv $GOPATH/src/github.com/namecoin/ncp11-[% c('version') %] $GOPATH/src/github.com/namecoin/ncp11
|
||||
|
||||
go install -ldflags '-s' -buildmode c-shared github.com/namecoin/ncp11
|
||||
|
||||
#mkdir -p /var/tmp/build
|
||||
#tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz
|
||||
#cd /var/tmp/build/[% project %]-[% c('version') %]
|
||||
|
||||
#mkdir -p "$GOPATH/src/github.com/namecoin"
|
||||
#ln -sf "$PWD" "$GOPATH/src/github.com/namecoin/ncdns"
|
||||
|
||||
#mkdir -p out
|
||||
#cd out
|
||||
#for x in .. ../ncdumpzone ../generate_nmc_cert; do
|
||||
# go build -ldflags '-s' "$x"
|
||||
#done
|
||||
|
||||
[% IF c("var/linux") %]
|
||||
BUILTPATH=${GOPATH}/pkg/${GOOS}_${GOARCH}_shared/github.com/namecoin/ncp11.a
|
||||
[% ELSE -%]
|
||||
BUILTPATH=${GOPATH}/pkg/${GOOS}_${GOARCH}/github.com/namecoin/ncp11.a
|
||||
[% END -%]
|
||||
|
||||
[% IF c("var/linux") %]
|
||||
OUTFILE=libncp11.so
|
||||
[% ELSIF c("var/osx") -%]
|
||||
OUTFILE=libncp11.dylib
|
||||
[% ELSIF c("var/windows") -%]
|
||||
OUTFILE=ncp11.dll
|
||||
[% ELSE -%]
|
||||
echo "Unsupported OS; this might not work properly"
|
||||
OUTFILE=libncp11.so
|
||||
[% END -%]
|
||||
|
||||
cp -a ${BUILTPATH} $distdir/$OUTFILE
|
||||
|
||||
cd $distdir
|
||||
[% c('tar', {
|
||||
tar_src => [ '.' ],
|
||||
tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
|
||||
}) %]
|
@ -0,0 +1,27 @@
|
||||
version: '[% c("abbrev") %]'
|
||||
git_url: https://github.com/namecoin/ncp11.git
|
||||
git_hash: f060446368cc5d754da04a5663982b2098705a4a
|
||||
filename: '[% project %]-[% c("version") %]-[% c("var/osname") %]-[% c("var/build_id") %].tar.gz'
|
||||
|
||||
var:
|
||||
container:
|
||||
use_container: 1
|
||||
go_lib_deps:
|
||||
- github.com,miekg,pkcs11
|
||||
- github.com,namecoin,pkcs11mod
|
||||
cgo: 1
|
||||
|
||||
input_files:
|
||||
- project: container-image
|
||||
- name: go
|
||||
project: go
|
||||
- name: '[% c("var/compiler") %]'
|
||||
project: '[% c("var/compiler") %]'
|
||||
enable: '[% c("var/cgo") %]'
|
||||
- name: binutils
|
||||
project: binutils
|
||||
enable: '[% c("var/linux") && c("var/cgo") %]'
|
||||
- name: github.com,miekg,pkcs11
|
||||
project: github.com,miekg,pkcs11
|
||||
- name: github.com,namecoin,pkcs11mod
|
||||
project: github.com,namecoin,pkcs11mod
|
Loading…
Reference in New Issue