summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorVolker Grabsch <vog@notjusthosting.com>2012-04-12 15:23:12 (GMT)
committerVolker Grabsch <vog@notjusthosting.com>2012-04-12 15:23:12 (GMT)
commit1f86817ee82b162a1a5bd495886183ca81a68ba7 (patch)
tree3116df65f83174295af8c6315a36583f460fe9e0 /tools
parent0f01e5e88f720fe5073c88f5cf1803d5c283904d (diff)
parente513258770cdc39c0d6a904437f191aa61b3175c (diff)
downloadmxe-2.22.zip
mxe-2.22.tar.gz
mxe-2.22.tar.bz2
Merge all well-tested changes into the stable branchv2.22
Diffstat (limited to 'tools')
-rwxr-xr-xtools/create-screenshot-for-doc32
-rwxr-xr-xtools/patch-tool-mxe (renamed from tools/patch-tool-mingw)31
2 files changed, 48 insertions, 15 deletions
diff --git a/tools/create-screenshot-for-doc b/tools/create-screenshot-for-doc
new file mode 100755
index 0000000..e361670
--- /dev/null
+++ b/tools/create-screenshot-for-doc
@@ -0,0 +1,32 @@
+#!/usr/bin/env bash
+set -eu
+
+if [ "$#" -ne 2 ]; then
+ echo
+ echo "Syntax: $0 [IMAGE.png] [NAME]"
+ echo
+ echo 'IMAGE.png -> screenshot-NAME.png + screenshot-NAME-small.png'
+ echo
+ exit 1
+fi
+
+set -v
+
+IMAGE_FILE="$1"
+NAME="$2"
+
+cat "$IMAGE_FILE" \
+| pngtopnm \
+| pnmtopng -compression 9 \
+> "screenshot-$NAME.png"
+
+cat "screenshot-$NAME.png" \
+| pngtopnm \
+| pnmscale -ysize 128 \
+> "screenshot-$NAME-small.pnm"
+
+pnmquant 256 "screenshot-$NAME-small.pnm" \
+| pnmtopng -compression 9 \
+> "screenshot-$NAME-small.png"
+
+rm -f "screenshot-$NAME-small.pnm"
diff --git a/tools/patch-tool-mingw b/tools/patch-tool-mxe
index 304e1b7..c130fae 100755
--- a/tools/patch-tool-mingw
+++ b/tools/patch-tool-mxe
@@ -1,13 +1,13 @@
-#!/bin/bash
+#!/usr/bin/env bash
-# Tool for converting between mingw-cross-env patch files and git repos
+# Tool for converting between MXE patch files and git repos
# Imports and exports patch files in "git format-patch" format.
cmd=$1
pkg=$2
-# mingw-cross-env directory
-mcedir=~/mingw-cross-env
+# MXE directory
+mxedir=~/mxe
# directory for unpacked tarballs/git repos
gitsdir=~/gits
@@ -16,18 +16,18 @@ gitsdir=~/gits
# John Doe <John Doe@acme.org>
author=`git var GIT_AUTHOR_IDENT | sed 's/^\(.* [<].*[>]\).*$/\1/'`
-pkg_version=`grep '^$(PKG)_VERSION' $mcedir/src/$pkg.mk | \
+pkg_version=`grep '^$(PKG)_VERSION' $mxedir/src/$pkg.mk | \
sed 's/.*:= \(.*\)/\1/'`
pkg_short_version=`echo $pkg_version | sed s/'\(.*\)\.[^.]*$'/'\1'/`
-pkg_subdir=`grep '^$(PKG)_SUBDIR' $mcedir/src/$pkg.mk | \
+pkg_subdir=`grep '^$(PKG)_SUBDIR' $mxedir/src/$pkg.mk | \
sed 's/.*:= \(.*\)/\1/' | \
sed s/'$($(PKG)_VERSION)'/$pkg_version/ | \
sed s/'$(call SHORT_PKG_VERSION,$(PKG))'/$pkg_short_version/ | \
sed s/'$(PKG)'/$pkg/;`
-pkg_file=`grep '^$(PKG)_FILE' $mcedir/src/$pkg.mk | \
+pkg_file=`grep '^$(PKG)_FILE' $mxedir/src/$pkg.mk | \
sed 's/.*:= \(.*\)/\1/' | \
sed s/'$($(PKG)_VERSION)'/$pkg_version/ | \
sed s/'$(call SHORT_PKG_VERSION,$(PKG))'/$pkg_short_version/ | \
@@ -42,9 +42,10 @@ pkg_file=`grep '^$(PKG)_FILE' $mcedir/src/$pkg.mk | \
# init
function init_git {
cd $gitsdir
- echo $pkg_file | grep "\.tar\.gz" >> /dev/null && tar xf $mcedir/pkg/$pkg_file
- echo $pkg_file | grep "\.tar\.bz2" >> /dev/null && tar xf $mcedir/pkg/$pkg_file
- echo $pkg_file | grep "\.zip" >> /dev/null && unzip $mcedir/pkg/$pkg_file >> /dev/null
+ echo $pkg_file | grep "\.tar\.gz" >> /dev/null && tar xf $mxedir/pkg/$pkg_file
+ echo $pkg_file | grep "\.tar\.bz2" >> /dev/null && tar xf $mxedir/pkg/$pkg_file
+ echo $pkg_file | grep "\.tar\.xz" >> /dev/null && xz -dc $mxedir/pkg/$pkg_file | tar xf -
+ echo $pkg_file | grep "\.zip" >> /dev/null && unzip $mxedir/pkg/$pkg_file >> /dev/null
cd $gitsdir/$pkg_subdir && \
(git init; git add -A; git commit -m "init") > /dev/null
git tag dist
@@ -53,19 +54,19 @@ function init_git {
function export_patch {
cd $gitsdir/$pkg_subdir && \
(
- echo 'This file is part of mingw-cross-env.'
- echo 'See doc/index.html for further information.'
+ echo 'This file is part of MXE.'
+ echo 'See index.html for further information.'
echo ''
echo 'Contains ad hoc patches for cross building.'
echo ''
git format-patch -p --stdout dist..HEAD | \
- sed 's/^From: .*/From: mingw-cross-env/g;'
- ) > $mcedir/src/$pkg-1-fixes.patch
+ sed 's/^From: .*/From: MXE/g;'
+ ) > $mxedir/src/$pkg-1-fixes.patch
}
function import_patch {
cd $gitsdir/$pkg_subdir && \
- cat $mcedir/src/$pkg-1-fixes.patch | \
+ cat $mxedir/src/$pkg-1-fixes.patch | \
sed '/^From/,$ !d' | \
sed s/'^From: .*'/"From: $author"/'g;' | \
git am --keep-cr