summary refs log tree commit diff
path: root/pkgs/applications/office/openoffice/builder.sh
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2007-09-06 15:00:33 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2007-09-06 15:00:33 +0000
commit8746f18f0dd9206086d3520a997f0f5bfc21b070 (patch)
treef55e83e7455f0fd8f7925b774cf4dd836cc64f1c /pkgs/applications/office/openoffice/builder.sh
parent4b04ed1b84ff6a497028a5824dc9ce7a4a85ea93 (diff)
downloadnixpkgs-8746f18f0dd9206086d3520a997f0f5bfc21b070.tar
nixpkgs-8746f18f0dd9206086d3520a997f0f5bfc21b070.tar.gz
nixpkgs-8746f18f0dd9206086d3520a997f0f5bfc21b070.tar.bz2
nixpkgs-8746f18f0dd9206086d3520a997f0f5bfc21b070.tar.lz
nixpkgs-8746f18f0dd9206086d3520a997f0f5bfc21b070.tar.xz
nixpkgs-8746f18f0dd9206086d3520a997f0f5bfc21b070.tar.zst
nixpkgs-8746f18f0dd9206086d3520a997f0f5bfc21b070.zip
* More OpenOffice hackery. Added the magic incantations to get it to
  install (of course there's no "make install", that would be too
  easy).  Also create some wrapper scripts "oowriter", "oodraw" etc.

  (I haven't done a full build of this yet, I've hacked on a tmpdir
  left behind by nix-build -K.)

svn path=/nixpkgs/trunk/; revision=9260
Diffstat (limited to 'pkgs/applications/office/openoffice/builder.sh')
-rw-r--r--pkgs/applications/office/openoffice/builder.sh56
1 files changed, 52 insertions, 4 deletions
diff --git a/pkgs/applications/office/openoffice/builder.sh b/pkgs/applications/office/openoffice/builder.sh
index edeb0e99760..3234e366b90 100644
--- a/pkgs/applications/office/openoffice/builder.sh
+++ b/pkgs/applications/office/openoffice/builder.sh
@@ -5,25 +5,73 @@ export NO_HIDS=TRUE
 
 export PATH=$icu/sbin:$PATH
 
+
 preConfigure=preConfigure
 preConfigure() {
     for i in \
 	sysui/desktop/share/makefile.mk \
 	; do 
-	substituteInPlace $i --replace /bin/bash /bin/sh
+	substituteInPlace $i --replace /bin/bash $shell
     done
 
+    SRCDIR=
+
     cd config_office/
 }
 
+
 postConfigure="cd .."
 
+
 buildPhase=buildPhase
 buildPhase() {
-  source LinuxX86Env.Set.sh
-  ./bootstrap
+    source LinuxX86Env.Set.sh
+    ./bootstrap
+    dmake # wait a few hours...
+}
+
+
+wrapSOffice() {
+    local fn=$1
+    local arg=$2
+
+    # !!! should use makeWrapper for this.
 
-  dmake
+    cat > $out/bin/$fn <<EOF 
+#! $shell
+# Add fontconfig to the library search path; apparently OpenOffice
+# looks for it at runtime.
+export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH\${LD_LIBRARY_PATH:+:}$fontconfig/lib
+exec $ooFiles/program/soffice $arg "\$@"
+EOF
+    chmod +x $out/bin/$fn
 }
 
+
+installPhase=installPhase
+installPhase() {
+    ooFiles=$out/lib/openoffice
+
+    # This was all borrowed from ooo-build-2.2.1's bin/ooinstall.
+    eval $(grep 'BUILD\|LAST_MINOR' $SOLARENV/inc/minor.mk)
+    export PYTHONPATH=$SOLARVERSION/$INPATH/lib:$SRC_ROOT/instsetoo_native/$INPATH/bin:$PYTHONPATH 
+    export OUT=../$INPATH
+    export LOCAL_OUT=../$INPATH
+    export LOCAL_COMMON_OUT=../$INPATH
+
+    # Do the actual installation into $out.
+    (cd $SRC_ROOT/instsetoo_native/util && perl -w $SOLARENV/bin/make_installer.pl \
+	-f openoffice.lst -l en-US -p OpenOffice \
+	-packagelist ../inc_openoffice/unix/packagelist.txt \
+	-addpackagelist ../inc_openoffice/unix/packagelist_language.txt \
+	-buildid $BUILD -simple $ooFiles)
+
+    ensureDir $out/bin
+    for i in soffice ooffice; do wrapSOffice $i; done
+    
+    # Create some wrappers to start individual OpenOffice components.
+    for i in writer calc draw impress base math web; do wrapSOffice oo$i -$i; done
+}
+
+
 genericBuild