diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2015-11-05 00:34:54 -0200 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2015-11-05 00:34:54 -0200 |
commit | b1481dee4ee585396792f2b9d2ec09a162ec677a (patch) | |
tree | 9434e7f9710449d817706bb1edcd91d2103ca204 | |
parent | 579c1d8c1f9a6b5bfc16d9f0b02dbab2e0acb0ed (diff) | |
download | blogc-b1481dee4ee585396792f2b9d2ec09a162ec677a.tar.gz blogc-b1481dee4ee585396792f2b9d2ec09a162ec677a.tar.bz2 blogc-b1481dee4ee585396792f2b9d2ec09a162ec677a.zip |
build: added script to build windows releases
-rw-r--r-- | .gitignore | 1 | ||||
-rwxr-xr-x | build-aux/build-windows.sh | 54 |
2 files changed, 55 insertions, 0 deletions
@@ -32,6 +32,7 @@ Makefile.in /stamp-h1 .dirstamp /build-aux/* +!/build-aux/build-windows.sh # installed .m4 files /m4/*.m4 diff --git a/build-aux/build-windows.sh b/build-aux/build-windows.sh new file mode 100755 index 0000000..267a8aa --- /dev/null +++ b/build-aux/build-windows.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +# This script builds windows binaries, given a source tarball. +# It was designed to work on Fedora, and requires the following packages: +# +# mingw32-gcc mingw64-gcc zip +# +# This script must be called with the xz source tarball as argument. + + +set -ex + +[[ $# -eq 1 ]] + + +get_version() { + local a=$(basename "${1}") + a="${a%.tar.xz}" + echo "${a#blogc-}" +} + + +build() { + local version=$(get_version "${1}") + local arch=${2} + local build_dir="/tmp/blogc_build_${version}_${arch}" + local dest_dir="/tmp/blogc-${version}-w${arch}" + + rm -rf "${build_dir}" + mkdir -p "${build_dir}" + tar -xvf "${1}" -C "${build_dir}" + + pushd "${build_dir}/blogc-${version}" &> /dev/null + "mingw${arch}-configure" + make + popd &> /dev/null + + rm -rf "${dest_dir}" + mkdir -p "${dest_dir}" + cp "${build_dir}/blogc-${version}/.libs/blogc.exe" "${dest_dir}/" + cp "${build_dir}/blogc-${version}/LICENSE" "${dest_dir}/" + cp "${build_dir}/blogc-${version}/README.md" "${dest_dir}/" + + pushd "$(dirname ${dest_dir})" &> /dev/null + zip "$(basename ${dest_dir}).zip" "$(basename ${dest_dir})"/* + popd &> /dev/null + + mv "${dest_dir}.zip" . +} + + +for arch in 32 64; do + build "$1" "${arch}" +done |