Permalink
Browse files

build_glade.sh: update to the version attached to bgo 634978

  • Loading branch information...
1 parent 545a847 commit d79aa4582899622e212aec0f6c1a7f68fcfe7d92 @dieterv committed Jan 15, 2011
Showing with 105 additions and 61 deletions.
  1. +105 −61 bin/build_glade.sh
View
@@ -1,65 +1,103 @@
#!/bin/bash
-# Copyright © 2010 pygtk-installer Contributors
-#
-# This file is part of pygtk-installer.
-#
-# pygtk-installer is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# pygtk-installer is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with pygtk-installer. If not, see <http://www.gnu.org/licenses/>.
-
-# What is this?
-# =============
-# build_glade.sh is a script for building glade3 with
-# "python widgets support"
-
-# How does it work?
-# =================
-# Install the deps (gtk+-bundle, ...) and MinGW/MSYS with GCC 4.5.0
-# $ mingw-get.exe install gcc
-# $ mingw-get.exe install msys-base
-#
-# Configure the CHECKOUT, DESTDIR and INTERPRETERS and GTKBUNDLE
-# variables in the etc/build_env.conf file
-#
-# To build glade for each python interpreter, execute
-# $ ./build_glade.sh
-
-#################################################################
-# Untill bug 634978 gets fixed you'll need to manually patch #
-# the configure script. #
-# https://bugzilla.gnome.org/show_bug.cgi?id=634978 #
-#################################################################
-
-# Load "configuration"
-source build.conf
+CHECKOUT="/d/dev/gnome.org/gnome-windows/checkout"
+TMPDIR="/d/dev/gnome.org/pygtk-installer/tmp/build"
+DESTDIR="/d/dev/gnome.org/pygtk-installer/dist"
+INTERPRETERS="/d/bin/Python26 /d/bin/Python27"
+GTKBUNDLE="/d/bin/Python27/Lib/site-packages/gtk-2.0/runtime/"
+# Or instead of using the gtk+-bundle included in the pygtk all-in-one
+# installer you could use a gtk+-bundle from ftp.gnome.org.
+# Both are identical.
+# GTKBUNDLE="/d/dev/gnome.org/gtk+-bundle_2.22.0-20101016_win32"
MOD=glade3
VER=3.6.7
-REV=0
+REV=1 # Always starts from 1 for each VER
ARCH=win32
DESTDIR=${DESTDIR}/`date +%Y%m%d-%H%M%S`
OLD_CWD=`pwd`
OLD_PATH=${PATH}
OLD_PKG_CONFIG_PATH=${PKG_CONFIG_PATH}
+#################################################################
+# Build Glade without Python support #
+#################################################################
+export PATH=${GTKBUNDLE}/bin:${OLD_PATH}
+export PKG_CONFIG_PATH=${GTKBUNDLE}/lib/pkgconfig/:${OLD_PKG_CONFIG_PATH}
+
+THIS=${MOD}-${VER}-${REV}.${ARCH}
+MFT=${MOD}_${VER}-${REV}_${ARCH}.mft
+BUILD=${MOD}_${VER}-${REV}_${ARCH}.sh
+ZIP=${MOD}-${VER}-${REV}.${ARCH}.zip
+
+PREFIX=${TMPDIR}/${THIS}
+
+if test -d "${PREFIX}"; then
+ rm -rf "${PREFIX}"
+fi
+
+LOG=${PREFIX}/src/glade3/${THIS}.log
+mkdir -p "${PREFIX}/src/glade3/"
+
+(
+ set -x
+ mkdir -p "${DESTDIR}"
+ cd "${CHECKOUT}/${MOD}-${VER}"
+
+ # Copied from tml@iki.fi's build scripts:
+ # Don't do any relinking and don't use any wrappers in libtool. It
+ # just causes trouble, IMHO.
+ sed -e "s/need_relink=yes/need_relink=no # no way --tml/" \
+ -e "s/wrappers_required=yes/wrappers_required=no # no thanks --tml/" \
+ <ltmain.sh >ltmain.temp && mv ltmain.temp ltmain.sh
+
+ lt_cv_deplibs_check_method="pass_all" \
+ CC="gcc -mthreads" \
+ CFLAGS=-O2 \
+ PYTHON_INCLUDES="-I${INTERPRETER}/include/" \
+ PYTHON_LIBS="-L${INTERPRETER}/libs/ -lpython${INTERPRETER_VERSION}" \
+ PYTHON_LIB_LOC="${INTERPRETER}/libs/" \
+ ./configure \
+ --enable-debug=yes \
+ --disable-static \
+ --disable-gnome \
+ --disable-gtk-doc \
+ --disable-python \
+ --disable-static \
+ --prefix="${PREFIX}" &&
+
+ make -j3 install &&
+
+ # No thanks
+ rm -rf ${PREFIX}/lib/glade3/modules/*.dll.a &&
+ rm -rf ${PREFIX}/lib/glade3/modules/*.la &&
+
+ # Create a manifest
+ mkdir "${PREFIX}/manifest" &&
+ touch "${PREFIX}/manifest/${MFT}" &&
+
+ # Copy build script
+ cp "${CHECKOUT}/${MOD}-${VER}/build/mswindows/build_glade.sh" "${PREFIX}/src/glade3/${BUILD}"
+) 2>&1 | tee "${LOG}"
+
+# Write manifest and create zip archive...
+cd "${PREFIX}" &&
+find -type f -print | sed "s/\.\///g" > "${PREFIX}/manifest/${MFT}"
+zip "${DESTDIR}/${ZIP}" -q -r ./*
+
+#################################################################
+# Build Glade with Python support #
+#################################################################
for INTERPRETER in ${INTERPRETERS}; do
export PATH=${INTERPRETER}:${INTERPRETER}/Scripts:${GTKBUNDLE}/bin:${OLD_PATH}
export PKG_CONFIG_PATH=${INTERPRETER}/Lib/pkgconfig/:${GTKBUNDLE}/lib/pkgconfig/:${OLD_PKG_CONFIG_PATH}
len=${#INTERPRETER}
INTERPRETER_VERSION=$(echo "$INTERPRETER"|cut -c"$((len-1))"-"$len")
THIS=${MOD}-${VER}-${REV}.${ARCH}-py${INTERPRETER_VERSION}
+ MFT=${MOD}_${VER}-${REV}_${ARCH}_py${INTERPRETER_VERSION}.mft
+ BUILD=${MOD}_${VER}-${REV}_${ARCH}_py${INTERPRETER_VERSION}.sh
ZIP=${MOD}-${VER}-${REV}.${ARCH}-py${INTERPRETER_VERSION}.zip
PREFIX=${TMPDIR}/${THIS}
@@ -68,16 +106,13 @@ for INTERPRETER in ${INTERPRETERS}; do
rm -rf "${PREFIX}"
fi
- LOG=${PREFIX}/src/dieterv/${THIS}.log
- mkdir -p ${PREFIX}/src/dieterv/
+ LOG=${PREFIX}/src/glade3/${THIS}.log
+ mkdir -p "${PREFIX}/src/glade3/"
(
set -x
-
- mkdir -p ${DESTDIR}
- mkdir -p "${PREFIX}"
-
- cd ${CHECKOUT}/${MOD}-${VER}
+ mkdir -p "${DESTDIR}"
+ cd "${CHECKOUT}/${MOD}-${VER}"
# Copied from tml@iki.fi's build scripts:
# Don't do any relinking and don't use any wrappers in libtool. It
@@ -101,11 +136,14 @@ for INTERPRETER in ${INTERPRETERS}; do
--disable-static \
--prefix="${PREFIX}" &&
- make -j3 install
- ) 2>&1 | tee "${LOG}"
+ make -j3 install &&
- # Write a .exe.manifest file...
- echo "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>
+ # No thanks
+ rm -rf ${PREFIX}/lib/glade3/modules/*.dll.a &&
+ rm -rf ${PREFIX}/lib/glade3/modules/*.la &&
+
+ # Write a .exe.manifest file...
+ echo "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>
<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">
<assemblyIdentity version=\"1.0.0.0\"
name=\"glade-3.exe\"
@@ -121,13 +159,19 @@ for INTERPRETER in ${INTERPRETERS}; do
</dependentAssembly>
</dependency>
</assembly>
-" > "${PREFIX}/bin/glade-3.exe.manifest"
+" > "${PREFIX}/bin/glade-3.exe.manifest" &&
+
+ # Create a manifest
+ mkdir "${PREFIX}/manifest" &&
+ touch "${PREFIX}/manifest/${MFT}" &&
+
+ # Copy build script
+ cp "${CHECKOUT}/${MOD}-${VER}/build/mswindows/build_glade.sh" "${PREFIX}/src/glade3/${BUILD}"
+ ) 2>&1 | tee "${LOG}"
- # We don't need these for modules...
- rm -rf ${PREFIX}/lib/glade3/modules/*.dll.a
- rm -rf ${PREFIX}/lib/glade3/modules/*.la
+ # Write manifest and create zip archive...
+ cd "${PREFIX}" &&
+ find -type f -print | sed "s/\.\///g" > "${PREFIX}/manifest/${MFT}" &&
+ zip "${DESTDIR}/${ZIP}" -q -r ./*
- # Put everything in a zip archive...
- cd ${PREFIX}
- zip ${DESTDIR}/${ZIP} -r ./*
done

0 comments on commit d79aa45

Please sign in to comment.