aboutsummaryrefslogtreecommitdiff
path: root/contrib/gitian-descriptors/protobuf-win.yml
blob: 7fcac72fea5969ebeeb70f16626d78c51f37f8f7 (plain)
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
---
name: "protobuf-win32"
suites:
- "precise"
architectures:
- "amd64"
packages:
- "mingw-w64"
- "g++-mingw-w64"
- "zip"
- "faketime"
reference_datetime: "2013-04-15 00:00:00"
remotes: []
files:
- "protobuf-2.5.0.tar.bz2"
script: |
  #
  export TZ=UTC
  INDIR=$HOME/build
  OPTFLAGS="-O2"
  # Integrity Check
  echo "13bfc5ae543cf3aa180ac2485c0bc89495e3ae711fc6fab4f8ffe90dfb4bb677  protobuf-2.5.0.tar.bz2" | sha256sum -c

  for BITS in 32 64; do # for architectures
    #
    INSTALLPREFIX=$HOME/staging${BITS}
    BUILDDIR=$HOME/build${BITS}
    if [ "$BITS" == "32" ]; then
      HOST=i686-w64-mingw32
    else
      HOST=x86_64-w64-mingw32
    fi
    #
    mkdir -p $INSTALLPREFIX $BUILDDIR
    cd $BUILDDIR
    #
    tar xjf $INDIR/protobuf-2.5.0.tar.bz2
    cd protobuf-2.5.0
    # First: build a native (linux) protoc
    ./configure --enable-shared=no --disable-dependency-tracking
    make
    mkdir -p $INSTALLPREFIX/host/bin
    cp src/protoc $INSTALLPREFIX/host/bin
    # Now recompile with the mingw cross-compiler:
    make distclean
    ./configure --prefix=$INSTALLPREFIX --enable-shared=no --disable-dependency-tracking --with-protoc=$INSTALLPREFIX/host/bin/protoc --host=$HOST CXXFLAGS="-frandom-seed=11 ${OPTFLAGS}"
    make
    make install
    #
    cd $INSTALLPREFIX
    export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
    export FAKETIME=$REFERENCE_DATETIME
    zip -r $OUTDIR/protobuf-win$BITS-2.5.0-gitian-r4.zip include lib host
    unset LD_PRELOAD
    unset FAKETIME
  done # for BITS in