aboutsummaryrefslogtreecommitdiffstats
path: root/build-aux
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2015-11-08 21:01:14 -0200
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2015-11-08 21:01:14 -0200
commit19592a65f3e5f6600175271e4499281e66c07976 (patch)
treec4aa56769a15213b18f7759fe69b4d9c895d340b /build-aux
parentd7c5862ffe3bd071aecc533b17241c63cc59b699 (diff)
parent6d128f72380a9cb9926559e6a027a5da4ae64467 (diff)
downloadblogc-19592a65f3e5f6600175271e4499281e66c07976.tar.gz
blogc-19592a65f3e5f6600175271e4499281e66c07976.tar.bz2
blogc-19592a65f3e5f6600175271e4499281e66c07976.zip
Merge remote-tracking branch 'origin/master' into feature/directives
Diffstat (limited to 'build-aux')
-rwxr-xr-xbuild-aux/build-windows.sh54
1 files changed, 54 insertions, 0 deletions
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