Skip to content

Commit 3f4bc0a

Browse files
committed
Fix static build to use my hbb fork
1 parent 26871ad commit 3f4bc0a

File tree

2 files changed

+34
-55
lines changed

2 files changed

+34
-55
lines changed

src/Makefile.static

Lines changed: 7 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
1-
GPGKEY = "E56C E72C 8060 C9F9 5F6B 5E72 0FEB 966A 205B 4780"
2-
HBB_DOCKER = docker run -t -i --rm -v $(shell pwd):/io \
3-
phusion/holy-build-box-64:latest bash
4-
5-
DEP_TARS_ = yaml-cpp.tar.gz boost.tar.bz2 libbz2.tar.gz
6-
DEP_TARS = $(foreach dep,$(DEP_TARS_),deps/$(dep))
7-
8-
VERSION = $(shell git describe)
9-
PREFIXDIR = ./libqcpp_$(VERSION)_amd64
10-
QCPP_TARS = trimit_$(VERSION)_amd64.tar.gz libqcpp_$(VERSION)_amd64.tar.gz
1+
HBB_DOCKER = docker run -t -i --rm -v $(shell pwd):/io kdmurray91/kdm-hbb-64:latest bash
2+
VERSION = $(shell git describe --match '[[:digit:]]*')
3+
PREFIXDIR = ./libqcpp_$(VERSION)_amd64
4+
QCPP_TARS = trimit_$(VERSION)_amd64.tar.gz libqcpp_$(VERSION)_amd64.tar.gz
115
QCPP_TARSUMS = $(foreach tar,$(QCPP_TARS),$(tar).sha512sums)
12-
QCPP_SIGS = $(foreach tar,$(QCPP_TARS),$(tar).asc)
6+
QCPP_SIGS = $(foreach tar,$(QCPP_TARS),$(tar).asc)
137

148
.PHONY: all clean cleandep sign
159
all: $(QCPP_TARS) $(QCPP_TARSUMS)
@@ -20,37 +14,17 @@ clean:
2014
rm -rf libqcpp_*_amd64 trimit_*_amd64
2115
rm -f libqcpp_*_amd64.tar* trimit_*_amd64.tar*
2216

23-
cleandep:
24-
rm -rf deps
25-
26-
libqcpp_$(VERSION)_amd64: src/hbb-build.sh $(DEP_TARS) .git/index
17+
libqcpp_$(VERSION)_amd64: src/hbb-build.sh .git/refs/tags
2718
$(HBB_DOCKER) /io/$< $(VERSION)
28-
29-
19+
mv static_build $@
3020

3121
%.sha512sums: %
3222
sha512sum $< >$@
3323

34-
%.asc: %
35-
gpg --armour --local-user $(GPGKEY) --detach-sign $<
36-
37-
3824
trimit_$(VERSION)_amd64.tar.gz: libqcpp_$(VERSION)_amd64
3925
mkdir -p trimit_$(VERSION)_amd64
4026
cp -r libqcpp_$(VERSION)_amd64/bin trimit_$(VERSION)_amd64/bin
4127
tar czf $@ trimit_$(VERSION)_amd64
4228

4329
libqcpp_$(VERSION)_amd64.tar.gz: libqcpp_$(VERSION)_amd64
4430
tar czf $@ --exclude=bin libqcpp_$(VERSION)_amd64
45-
46-
deps/yaml-cpp.tar.gz:
47-
mkdir -p deps
48-
wget -O $@ https://github.com/jbeder/yaml-cpp/archive/master.tar.gz
49-
50-
deps/boost.tar.bz2:
51-
mkdir -p deps
52-
wget -O $@ http://downloads.sourceforge.net/project/boost/boost/1.60.0/boost_1_60_0.tar.bz2
53-
54-
deps/libbz2.tar.gz:
55-
mkdir -p deps
56-
wget -O $@ http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz

src/hbb-build.sh

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,55 +2,60 @@
22
# SETUP #
33
#########
44
set -e
5-
source /hbb_exe_gc_hardened/activate
5+
source /hbb_exe/activate
66
set -x
77

8-
export QCPP_VER=$1
8+
QCPP_VERSION=$1
9+
10+
YAMLCPP_VER=0.5.3
911

1012
cd $(mktemp -d)
13+
export CMAKE_PREFIX_PATH=/hbb_exe
1114

1215
########
1316
# DEPS #
1417
########
1518

16-
# Install libbz2
17-
tar xf /io/deps/libbz2.tar*
18-
pushd bzip2*/
19-
make CFLAGS=-fPIC
20-
make install
21-
popd
22-
rm -rf boost*/
23-
24-
# Install boost headers only
25-
tar xf /io/deps/boost.tar* boost_1_60_0/boost/
26-
mv boost_1_*/boost /usr/local/include
27-
rm -rf boost*/
28-
2919
# Compile & install yaml-cpp
30-
tar xf /io/deps/yaml-cpp.tar*
20+
curl -LSO https://github.com/jbeder/yaml-cpp/archive/yaml-cpp-${YAMLCPP_VER}.tar.gz
21+
tar xf yaml-cpp*.tar.gz
3122
pushd yaml-cpp*/
3223
mkdir build && cd build
33-
cmake .. -DYAML_CPP_BUILD_TOOLS=Off -DYAML_CPP_BUILD_CONTRIB=Off
24+
cmake .. \
25+
-DYAML_CPP_BUILD_TOOLS=Off \
26+
-DYAML_CPP_BUILD_CONTRIB=Off
3427
make -j4
3528
make install
3629
popd
37-
rm -rf yaml-cpp*/
30+
rm -rf yaml-cpp*
3831

32+
yum install -y git
3933

4034
#########
4135
# BUILD #
4236
#########
4337

44-
prefix=/io/libqcpp_${QCPP_VER}_amd64
38+
39+
prefix=/io/static_build
40+
rm -rf $prefix
4541
mkdir -p $prefix
42+
chown 1000:1000 -R $prefix
4643

44+
# Clone to builddir
4745
builddir=$(mktemp -d)
46+
git clone /io $builddir
4847
pushd $builddir
48+
git reset --hard HEAD
4949

50-
cmake /io -DCMAKE_INSTALL_PREFIX=$prefix
51-
make -j4
50+
mkdir build
51+
cd build
52+
53+
cmake $builddir \
54+
-DCMAKE_INSTALL_PREFIX=$prefix \
55+
-DSTATIC_BINARIES=On \
56+
-DQCPP_VERSION=$QCPP_VERSION
57+
make -j4 VERBOSE=1
5258
make test
5359
make install
54-
popd
5560

5661
chown 1000:1000 -R $prefix

0 commit comments

Comments
 (0)