-
Notifications
You must be signed in to change notification settings - Fork 11
build stembuild
Note: you can only build on your host OS. You cannot cross compile.
Stembuild applies a binary diff to a source vhd and creates a stemcell. The binary diff creation is dependent upon rdiff
(located in librsync). rdiff
is dependent upon (POP3) which is not supported in windows. In order to get around this, a shim has been written in go that is not dependent upon POP3.
-
ovftool
https://my.vmware.com/web/vmware/details?downloadGroup=OVFTOOL400&productId=353- Update the system path to include
ovftool
- Update the system path to include
-
librsync
https://github.com/librsync/librsync -
golang
https://golang.org/dl/ -
stembuild
https://github.com/pivotal-cf-experimental/stembuild (Usegit clone
)
-
cmake
https://cmake.org/ -
MinGW
https://sourceforge.net/projects/mingw-w64/- From within the VM, download the installer executable
- Select
x86_64
as the Architecture - Do not use the default root directory (Program Files); use something without spaces (this will save you a lifetime of pain if you decide to compile something that uses
Makefile
s) for exampleC:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1
- Add
gcc
and friends to the path (for the above install location you would addC:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin
to the system path) before the strawberrygcc
path
-
git
https://git-scm.com/download/win- USE THE DEFAULTS (WITH ONE EXCEPTION)
- install to
C:\Git
or any other path without spaces
- install to
- USE THE DEFAULTS (WITH ONE EXCEPTION)
-
Strawberry Perl
http://strawberryperl.com/- Verify the additions to the system path for strawberry perl are after the MinGW bin
CMake is used to create the necessary header files so that compilation can succeed. You should only have to generate these files once since we only care about the rdiff files.
To generate the correct files:
- open CMake
- set source folder to librsync
- set destination folder to librsync/build
- set CMAKE_INSTALL_PREFIX=librsync/install
- set CMAKE_BUILD_TYPE=release
- click configure
- select MinGW Makefiles as the generator for the project (for Windows)
- click generate (this generates the .h files)
- after generating the Makefile you can CD into the build directory and run mingw32-make and mingw32-make test to make sure things are working (also, the tests will not pass - so don't sweat it)
- copy all source and header files from
librsync/src
intostembuild/rdiff/
- copy all source and header files from
librsync/build/src
intostembuild/rdiff/
- remove
rdiff/rdiff.c
(this is because we have rewritten this in gordiff.go
) -
go install
puts the stembuild executable into$GOPATH/bin
Other environments are similar.
You can also generate the headers using cmake
from the command line. The following command will generate *.h
files under src
in your current directory:
cmake -D CMAKE_INSTALL_PREFIX=librsync/install -D CMAKE_BUILD_TYPE=release -G "MinGW Makefiles" <path-to-librsync>