Re: Building lablGtk 2.18.0/2.14.2 + gtksourceview2 on Windows

Enrico Tassi <[email protected]> Fri, 6 Dec 2013 12:28:05 +0100
Newsgroups gmane.comp.lang.ocaml.lib.gtk
Message-ID <[email protected]>
--9jxsPFA5p3P2qPhR
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Wed, Dec 04, 2013 at 07:02:37PM +0100, Enrico Tassi wrote:
> On Wed, Dec 04, 2013 at 05:54:39PM +0100, Andreas Hauptmann wrote:
> > You can try my prebuild binaries from
> > http://wodi.forge.ocamlcore.org/download.html (use the command line
> > installation, the installer is broken)
> 
> Interesting.  I'll look at that.

Indeed it works.  The difference is in the gtk precompiled binaries.
The ones I've downloaded from the link on the lablgtk2 homepage are not
working for me.  Where did you get yours?

I'm attaching a version of the script that works, and may be used by
others.  The script builds an SDK in C:\CoqSDK-$N.  One gets the
right env variables by sourcing C:\CoqSDK-$N\environ.  The whole set of
lablgtk 2.18.0 modules is compiled and available via findlib.

Cheers and thanks for your help
-- 
Enrico Tassi

--9jxsPFA5p3P2qPhR
Content-Type: application/x-sh
Content-Disposition: attachment; filename="build-sdk.sh"
Content-Transfer-Encoding: quoted-printable

#!/bin/sh=0A=0A# Sworn by Enrico Tassi <[email protected]>=0A# License: =
Expat/MIT http://opensource.org/licenses/MIT=0A=0Aset -e=0A=0A# Resources=
=0Aocaml=3Docaml-4.01.0-i686-mingw64-installer3.exe=0Aglib=3Dbase-windows-0=
=2E18.1.1.13.356@BUILD_ec06e9.txz=0Agtk=3Dbase-gtk-2.24.18.1.58@BUILD_594ca=
8.txz=0Alablgtk=3Dlablgtk-2.18.0.tar.gz=0Acamlp5=3Dcamlp5-6.11.tgz=0A=0Aoca=
ml_URL=3D'http://yquem.inria.fr/~protzenk/caml-installer/'$ocaml=0Alablgtk_=
URL=3D'https://forge.ocamlcore.org/frs/download.php/1261/'$lablgtk=0Aglib_U=
RL=3D'http://dl.arirux.de/5/binaries32/'$glib=0Agtk_URL=3D'http://dl.arirux=
=2Ede/5/binaries32/'$gtk=0Acamlp5_URL=3D'http://pauillac.inria.fr/~ddr/caml=
p5/distrib/src/'$camlp5=0A=0Acygwin=3Dsetup-x86.exe=0Acygwin_URL=3D'http://=
cygwin.com/'$cygwin=0Acygwin_PKGS=3D7z,zip,make,mingw64-i686-gcc-g++,mingw6=
4-i686-gcc-core,mingw64-i686-gcc,patch,rlwrap,libreadline6,diffutils=0A=0A#=
 utilities=0A# http://www.dependencywalker.com/depends22_x86.zip=0A=0A# The=
 SDK itself=0AREVISION=3D0=0ABASE=3D/cygdrive/c/CoqSDK-$REVISION=0ABASE_TMP=
=3D/cygdrive/c/CoqSDK-TMP=0A=0Asanity_check() {=0A  echo "Checking for wget=
"=0A  which wget=0A  echo "Installing 7z, gcc, ... using cygwin"=0A  if [ !=
 -e $cygwin ]; then wget -q $cygwin_URL; fi=0A  chmod a+x $cygwin=0A  cygst=
art -w $cygwin -q -P $cygwin_PKGS=0A  echo "Check: 7z, gcc.  If it fails wa=
it for cygwin to complete and retry"=0A  which 7z=0A  which i686-w64-mingw3=
2-gcc=0A}=0A=0Ainstall_base() {=0A  echo "Setting up $BASE"=0A  rm -rf $BAS=
E 2> /dev/null=0A  mkdir -p $BASE=0A  echo "export BASE=3D\"$BASE\""  >$BAS=
E/environ=0A  echo "export PATH=3D\"\$BASE/bin:\$PATH\""  >>$BASE/environ=
=0A  echo "export OCAMLLIB=3D\"\`cygpath -m \$BASE\`/lib\""  >>$BASE/enviro=
n=0A  echo "export OCAMLFIND_CONF=3D\"\`cygpath -m \$BASE\`/etc/findlib.con=
f\""  \=0A	  >>$BASE/environ=0A  echo "# To change BASE also fix lib/{ld.co=
nf,topfind} and etc/findlib.conf" \=0A	>>$BASE/environ=0A  echo "# Sanity c=
hecks: is the mingw64-i686-gcc package installed?" \=0A	>> $BASE/environ=0A=
  echo "which i686-w64-mingw32-gcc" >> $BASE/environ=0A}=0A=0Adownload() {=
=0A  echo "Downloading stuff"=0A  if [ ! -e $ocaml ]; then wget -q $ocaml_U=
RL; fi=0A  chmod a+x $ocaml=0A  if [ ! -e $lablgtk ]; then wget -q --no-che=
ck-certificate $lablgtk_URL; fi=0A  if [ ! -e $gtk ]; then wget -q $gtk_URL=
; fi=0A  if [ ! -e $glib ]; then wget -q $glib_URL; fi=0A  if [ ! -e $camlp=
5 ]; then wget -q $camlp5_URL; fi=0A}=0A=0Acleanup() {=0A  rm -rf tmp build=
 2> /dev/null=0A}=0A=0Ainstall_gtk() {=0A  echo "Installing $glib"=0A  tar =
-xJf $glib -C $BASE=0A  echo "Installing $gtk"=0A  tar -xJf $gtk -C $BASE=
=0A}=0A =0A install_ocaml() {=0A  echo "Installing $ocaml"=0A  mkdir -p tmp=
=0A  7z -bd -otmp x $ocaml >/dev/null=0A  cp -r tmp/\$_OUTDIR/bin $BASE/=0A=
  cp -r tmp/bin $BASE/=0A  cp -r tmp/\$_OUTDIR/lib $BASE/=0A  cp -r tmp/lib=
 $BASE/=0A  cp -r tmp/\$_OUTDIR/etc $BASE/=0A  chmod a+x `find $BASE -name =
\*.dll -o -name \*.exe`=0A  sed -i "s/@SITELIB@/C:\\\\\\\\CoqSDK-$REVISION\=
\\\\\\\lib\\\\\\\\site-lib/" \=0A	  $BASE/lib/topfind=0A  echo "C:\\CoqSDK-=
$REVISION\\lib" > $BASE/lib/ld.conf=0A  echo "C:\\CoqSDK-$REVISION\\lib\\st=
ublibs" >> $BASE/lib/ld.conf=0A  echo 'destdir=3D"C:\\'CoqSDK-$REVISION'\\l=
ib\\site-lib"' >$BASE/etc/findlib.conf=0A  echo 'path=3D"C:\\'CoqSDK-$REVIS=
ION'\\lib\\site-lib"' >> $BASE/etc/findlib.conf=0A  echo 'stdlib=3D"C:\\'Co=
qSDK-$REVISION'\\lib"' >> $BASE/etc/findlib.conf=0A  echo 'ldconf=3D"C:\\'C=
oqSDK-$REVISION'\\lib\\ld.conf"' >> $BASE/etc/findlib.conf=0A  echo 'ocamlc=
=3D"ocamlc.opt"' >> $BASE/etc/findlib.conf=0A  echo 'ocamlopt=3D"ocamlopt.o=
pt"' >> $BASE/etc/findlib.conf=0A  echo 'ocamldep=3D"ocamldep.opt"' >> $BAS=
E/etc/findlib.conf=0A  echo 'ocamldoc=3D"ocamldoc.opt"' >> $BASE/etc/findli=
b.conf=0A}=0A=0Abuild_install_lablgtk() {=0A  echo "Building $lablgtk"=0A  =
mkdir -p build=0A  tar -xzf $lablgtk -C build=0A  cd build/lablgtk-*=0A  ./=
configure --disable-gtktest --prefix=3D"`cygpath -m $BASE`" \=0A	  >log-con=
figure 2>&1=0A  sed -i 's?\\?/?g' config.make=0A  make >log-make 2>&1=0A  m=
ake opt >>log-make 2>&1=0A  #echo "Testing $lablgtk"=0A  #cd src=0A  #./lab=
lgtk2 ../examples/calc.ml=0A  #./lablgtk2 -all ../examples/calc.ml=0A  #cd =
=2E.=0A  echo "Installing $lablgtk"=0A  make install >>log-make 2>&1=0A  cd=
 ../..=0A}=0A=0Abuild_install_camlp5() {=0A  echo "Building $camlp5"=0A  mk=
dir -p build=0A  tar -xzf $camlp5 -C build=0A  cd build/camlp5-*=0A  ./conf=
igure >log-configure 2>&1=0A  make world.opt >log-make 2>&1=0A  echo "Insta=
lling $camlp5"=0A  make install >>log-make 2>&1=0A  cd ../..=0A}=0A=0Azip_s=
dk() {=0A  echo "Generating CoqSDK-${REVISION}.zip"=0A  here=3D"`pwd`"=0A  =
cd $BASE/..=0A  rm -f $here/CoqSDK-${REVISION}.zip=0A  zip -q -r $here/CoqS=
DK-${REVISION}.zip CoqSDK-$REVISION=0A  cd $here=0A}=0A=0Adiet_sdk() {=0A  =
rm -r $BASE/+* $BASE/bin/camlp4* $BASE/lib/camlp4/ $BASE/lib/site-lib/camlp=
4/=0A}=0A=0Avictory(){=0A  echo "Output file: CoqSDK-${REVISION}.zip (`du -=
sh CoqSDK-${REVISION}.zip | cut -f 1`)"=0A  echo "Usage: unpack in C:\\ and=
 source the environ file at its root"=0A}=0A=0Aif [ -z "$1" ]; then=0A  san=
ity_check=0A  download=0A  cleanup=0A  install_base=0A  install_ocaml=0A  i=
nstall_gtk=0A  . $BASE/environ=0A  build_install_lablgtk=0A  build_install_=
camlp5=0A  diet_sdk=0A  zip_sdk=0A  cleanup=0A  victory=0Aelse=0A  $1=0Afi=
=0A
--9jxsPFA5p3P2qPhR
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Lablgtk-list mailing list
[email protected]
https://lists.ocamlcore.org/cgi-bin/listinfo/lablgtk-list

--9jxsPFA5p3P2qPhR--