Fix version number stuff to work in chroot
authorCarl Myers <cmyers@cmyers.org>
Sun, 27 Feb 2011 10:18:51 +0000 (02:18 -0800)
committerCarl Myers <cmyers@cmyers.org>
Sun, 27 Feb 2011 10:18:51 +0000 (02:18 -0800)
* added git-core to the chroot via debian backports
* updated generate-version script to be compat with old-ass git (1.5.4)
* caused generate-version script to be called in build-arcade.sh

.gitignore
build-arcade.sh
chroot-arcade.sh
generate-version [new file with mode: 0755]

index b5a0732..ed6b0e2 100644 (file)
@@ -19,3 +19,5 @@ src/config.h
 src/version.bin
 src/verstub.cpp
 src/stamp-h1
+version.h
+version.txt
index be6e789..cac7b2c 100755 (executable)
@@ -1,5 +1,8 @@
 #!/bin/sh
 
+# XXX: Move this to make land!
+./generate-version
+
 ./autogen.sh
 ./configure --with-x --with-gnu-ld --enable-itg-arcade --target=i386-pc-linux-gnu --host=i386-pc-linux-gnu
 make
index 8039f1a..bb5f2a6 100755 (executable)
@@ -1,8 +1,11 @@
 #!/bin/sh
 
 DEBIAN_SARGE_MIRROR="http://archive.debian.org/debian"
+
 SARGE_DIST_NAME="sarge"
 
+DEBIAN_SARGE_BACKPORTS="deb http://archive.debian.org/debian-backports sarge-backports main contrib"
+
 usage() {
        echo "Usage: $0 <path to source code> <chroot location>"
        exit 1
@@ -49,8 +52,9 @@ echo -ne "*******************\n* You are now in the OpenITG AC chroot environmen
 echo "Installing necessary dev packages..."
 # non-free and contrib for the nvidia packages
 echo "deb $DEBIAN_SARGE_MIRROR $SARGE_DIST_NAME main contrib non-free" >/etc/apt/sources.list
+echo "$DEBIAN_SARGE_BACKPORTS" >>/etc/apt/sources.list
 apt-get update
-apt-get install build-essential gettext automake1.8 gcc g++ libavcodec-dev libavformat-dev libxt-dev libogg-dev libpng-dev libjpeg-dev libvorbis-dev libusb-dev libglu1-mesa-dev libx11-dev libxrandr-dev liblua50-dev liblualib50-dev nvidia-glx-dev libmad0-dev libasound-dev
+apt-get install build-essential gettext automake1.8 gcc g++ libavcodec-dev libavformat-dev libxt-dev libogg-dev libpng-dev libjpeg-dev libvorbis-dev libusb-dev libglu1-mesa-dev libx11-dev libxrandr-dev liblua50-dev liblualib50-dev nvidia-glx-dev libmad0-dev libasound-dev git-core
 echo "OpenITG AC chroot successfully set up!"
 exec /bin/bash
 !
diff --git a/generate-version b/generate-version
new file mode 100755 (executable)
index 0000000..89c2659
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+VF=version.txt
+CODE_VF=version.h
+
+if [[ -f $VF ]]; then
+       echo "Using existing version file: "
+       cat $VF;
+       exit;
+fi
+
+VERSION=$(git describe)
+# we have to do this the legacy way because git in debian sarge is only like
+# v1.5.4 which doesn't support the --format arguemnt
+DATE=$(git log -1 --pretty="format:%ad")
+
+echo "
+#ifndef VERSION_H_
+#define VERSION_H_
+#define OITG_VERSION \"$VERSION\"
+#define OITG_DATE \"$DATE\"
+#endif
+" > $CODE_VF
+
+# TODO: detect dirty working tree and note it
+echo "$VERSION
+$DATE" > $VF
+echo "Using version: "
+cat $VF
+exit 0;