-
Notifications
You must be signed in to change notification settings - Fork 68
/
make-release
executable file
·125 lines (115 loc) · 2.54 KB
/
make-release
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#!/bin/bash
# Copyright 2012-2013 Luke Dashjr
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 3 of the License, or (at your option)
# any later version. See COPYING for more details.
set -e
set -x
tag="$1"; shift
[ -n "$tag" ] || exit 1
sw="$1"; shift || true
[ -n "$sw" ] || sw="$tag"
test -n "$DEBUG_RELEASE" || DEBUG_RELEASE=1
builds=(win32 win64)
win32_machine='i686-pc-mingw32'
win32_CFLAGS='-march=i686'
win64_machine='x86_64-w64-mingw32'
win64_CFLAGS=''
IDIR="$PWD"
OUTDIR="$PWD"
TMPROOT="$PWD/make-release-tmp"
TMPDIR="${TMPROOT}/${sw}-tmp"
mkdir -vp "$TMPDIR"
# Source release
git branch TMP "$tag"
git clone . "$TMPDIR" -b TMP --depth 1
git branch -D TMP
cd "$TMPDIR"
git submodule update --init
{
git archive --prefix "$sw"/ --format tar "$tag"
git submodule --quiet foreach --recursive 'git archive --prefix "'"$sw"'/$path/" --format tar HEAD'
} | tar -xivp
cd "$sw"
NOSUBMODULES=1 \
NOCONFIGURE=1 \
./autogen.sh
cd ..
zip -r "$OUTDIR/${sw}.zip" "$sw"
tar cjvpf "$OUTDIR/${sw}.tbz2" "$sw"
SRCDIR="$TMPDIR/$sw"
dlls='
backtrace.dll
pdcurses.dll
libcurl-4.dll
pthreadGC2.dll
libusb-1.0.dll
zlib1.dll
'
docs='
AUTHORS
COPYING
NEWS
README
API-README
FPGA-README
SCRYPT-README
'
for build in "${builds[@]}"; do
PKGNAME="${sw}-${build}"
PKGDIR="$TMPDIR/$PKGNAME"
cd "$TMPDIR"
mkdir -vp "$PKGDIR"
for v in machine CFLAGS; do
eval "${v}"="'$(eval echo "\${${build}_${v}}")'"
done
if test "x$DEBUG_RELEASE" = "x1"; then
CFLAGS="${CFLAGS} -g"
fi
libdir="/usr/$machine/usr/bin/$dll"
for dll in $dlls; do
libdir="/usr/$machine/usr/lib"
[ -e "$libdir/$dll" ] ||
libdir="/usr/$machine/usr/bin"
cp -v -L "$libdir/$dll" "$PKGDIR"
"$machine"-strip "$PKGDIR/$dll"
done
for doc in $docs; do
sed 's/$/\r/' <"$doc" >"$PKGDIR/${doc}.txt"
done
cp -av "bitstreams" "$PKGDIR/"
NOCONFIGURE=1 \
./autogen.sh
./configure \
--prefix='C:\\Program Files\\nsgminer\\' \
CFLAGS="${CFLAGS} -Wall" \
--disable-cpumining \
--enable-opencl \
--enable-adl \
--enable-bitforce \
--enable-icarus \
--enable-modminer \
--enable-ztex \
--enable-scrypt \
--host="$machine"
make $MAKEOPTS
if test "x$DEBUG_RELEASE" != "x1"; then
"$machine"-strip \
libblkmaker/.libs/*.dll \
*.exe
fi
cp -v \
*.exe \
libblkmaker/.libs/*.dll \
*.cl \
example.conf \
windows-build.txt \
miner.php \
"$PKGDIR/"
make clean
cd "$PKGDIR/.."
zip -r "$OUTDIR/$PKGNAME.zip" "$PKGNAME"
done
cd "$IDIR"