You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ncdns-repro/projects/winsvcwrap/build

38 lines
1.1 KiB
Bash

#!/bin/bash
[% c("var/set_default_env") -%]
[% pc('go', 'var/setup', { go_tarfile => c('input_files_by_name/go') }) %]
export CGO_ENABLED=0
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/hlandau
tar -C $GOPATH/src/github.com/hlandau -xf [% project %]-[% c('version') %].tar.gz
mv $GOPATH/src/github.com/hlandau/winsvcwrap-[% c('version') %] $GOPATH/src/github.com/hlandau/winsvcwrap
[% FOREACH inst IN c("var/go_lib_install") %]
# TODO: Remove static build ID after migrating to Go 1.13.3+
go install -ldflags '-s -buildid=' [% inst %]
[% END %]
[% IF c("var/linux-x86_64") -%]
GOPATHBIN="${GOPATH}/bin"
[% ELSE -%]
GOPATHBIN="${GOPATH}/bin/${GOOS}_${GOARCH}"
[% END -%]
ls $GOPATHBIN
for x in winsvcwrap; do
cp -a $GOPATHBIN/"$x"[% IF c("var/windows") %].exe[% END %] $distdir/
done
cd $distdir
[% c('tar', {
tar_src => [ '.' ],
tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
}) %]