summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Nicholson <dbn.lists@gmail.com>2010-06-09 19:00:14 -0700
committerDan Nicholson <dbn.lists@gmail.com>2012-04-10 06:27:06 -0700
commit3b0461d05456b75ab1baf4dd0da8692e0fb2a7da (patch)
tree21400cc86875d3df017e9f1d2726d9560ad3f64b
parentb93f7958488ba99e3e81ea97a81c474a5e90b570 (diff)
glib: Add a script to take a snapshot of glib-2.0
Grab a snapshot of a tag from a local glib checkout, remove a bunch of files and apply some patches. The idea is to make the snapshot of glib be repeatable.
-rw-r--r--glib-patches/README15
-rw-r--r--glib-patches/patchlist0
-rwxr-xr-xglib-patches/update-glib.sh111
3 files changed, 126 insertions, 0 deletions
diff --git a/glib-patches/README b/glib-patches/README
new file mode 100644
index 0000000..d7d777a
--- /dev/null
+++ b/glib-patches/README
@@ -0,0 +1,15 @@
+To update the glib snapshot, first clone a copy of the glib repo.
+
+ $ git clone git://git.gnome.org/glib
+
+Use the update-glib.sh script to grab a checkout from your local repo.
+
+ $ ./glib-patches/update-glib.sh ../glib
+
+If you've updated to a new glib version, add a new patch (or refresh
+the current patches) in glib-patches, update the default tag value in
+update-glib.sh and commit the changes.
+
+The idea is that all changes are committed and you can build directly
+from the pkg-config repo without manipulating the glib snapshot
+anymore.
diff --git a/glib-patches/patchlist b/glib-patches/patchlist
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/glib-patches/patchlist
diff --git a/glib-patches/update-glib.sh b/glib-patches/update-glib.sh
new file mode 100755
index 0000000..5edca8f
--- /dev/null
+++ b/glib-patches/update-glib.sh
@@ -0,0 +1,111 @@
+#!/bin/sh
+
+GIT=${GIT-git}
+PATCH=${PATCH-patch}
+SED=${SED-sed}
+repo=
+tag=2.32.0
+commit=n
+
+usage()
+{
+ cat << EOF
+Usage:
+ $0 [OPTIONS] REPO [TAG]
+Fetch archive of TAGged version of glib from local checkout at REPO
+
+Options:
+ -c, --commit commit snapshot after each change
+ -h, --help display this help and exit
+
+If TAG is not specified, $tag is used
+EOF
+}
+
+while [ -n "$1" ]; do
+ case "$1" in
+ -c|--commit)
+ commit=y
+ ;;
+ -h|--help)
+ usage
+ exit
+ ;;
+ -*)
+ echo "$0: unrecognized option '$1'" >&2
+ echo "Try '$0 --help' for more information." >&2
+ exit 1
+ ;;
+ *)
+ # end of options
+ break
+ ;;
+ esac
+ shift
+done
+
+repo=$1
+[ -z "$2" ] || tag=$2
+
+# Remove previous snapshot
+if [ -d glib ]; then
+ echo "removing previous glib snapshot"
+ rm -rf glib
+fi
+
+# Create new snapshot
+echo "creating new snapshot of $repo tag $tag"
+(cd "$repo" && $GIT archive --format=tar --prefix=glib/ "$tag") | \
+ tar -xf - || exit $?
+if [ $commit = y ]; then
+ $GIT add glib
+ $GIT commit -q \
+ -m "glib: creating new snapshot of $repo tag $tag" -- glib
+fi
+
+# Prune parts we don't want
+echo "removing unneeded directories and files"
+rm -rf \
+ glib/debian \
+ glib/docs \
+ glib/po \
+ glib/tests \
+ glib/glib/tests \
+ glib/build \
+ glib/gmodule \
+ glib/gthread \
+ glib/gobject \
+ glib/gio \
+ glib/glib/pcre \
+ glib/glib/update-pcre
+rm -f \
+ glib/autogen.sh \
+ glib/INSTALL.in \
+ glib/README.commits \
+ glib/HACKING \
+ glib/NEWS.pre-1-3 \
+ glib/README.win32 \
+ glib/config.h.win32.in \
+ glib/glib-zip.in \
+ glib/sanity_check \
+ glib/glib/glib.stp \
+ glib/glib/glib_probes.d \
+ glib/glib/glibconfig.h.win32.in \
+ glib/msvc_recommended_pragmas.h \
+ glib/win32-fixup.pl
+find glib -name 'makefile.msc*' | xargs rm -f
+find glib -name 'ChangeLog*' | xargs rm -f
+find glib -name '*.pc.in' | xargs rm -f
+[ $commit = y ] && $GIT commit -q \
+ -m "glib: removing unneeded directories and files" -- glib
+
+# Apply patches
+patches=`grep '^[^#]' glib-patches/patchlist 2>/dev/null`
+for p in $patches; do
+ echo "applying patch glib-patches/$p"
+ $PATCH -p1 -i glib-patches/$p || exit $?
+ [ $commit = y ] && $GIT commit -q \
+ -m "glib: applying patch glib-patches/$p" -- glib
+done
+
+echo "snapshot successfully updated"