@ -1,23 +1,17 @@
# when updating version, wait for the build to fail
# run make without sourcing the environment and let libreoffice
# download all extra files
# then list extra files separated by newline and pipe them to
# generate-libreoffice-srcs.sh and copy output to libreoffice-srcs.nix
{ stdenv , fetchurl , pam , python3 , tcsh , libxslt , perl , ArchiveZip
, CompressZlib , zlib , libjpeg , expat , pkgconfigUpstream , freetype , libwpd
, libxml2 , db , sablotron , curl , fontconfig , libsndfile , neon
, bison , flex , zip , unzip , gtk , libmspack , getopt , file , cairo , which
, icu , boost , jdk , ant , cups , xorg
, icu , boost , jdk , ant , cups , xorg , libcmis
, openssl , gperf , cppunit , GConf , ORBit2 , poppler
, librsvg , gnome_vfs , mesa
, librsvg , gnome_vfs , mesa , bsh , CoinMP , libwps , libabw
, autoconf , automake , openldap , bash , hunspell , librdf_redland , nss , nspr
, libwpg , dbus_glib , glibc , qt4 , kde4 , clucene_core , libcdr , lcms , vigra
, unixODBC , mdds , saneBackends , mythes , libexttextcat , libvisio
, fontsConf , pkgconfig , libzip , bluez5 , libtool , maven
, libatomic_ops , graphite2 , harfbuzz , libodfgen
, librevenge , libe-book , libmwaw , glm , glew , gst_all_1
, gdb
, gdb , commonsLogging
, langs ? [ " e n - U S " " e n - G B " " c a " " r u " " e o " " f r " " n l " " d e " " s l " ]
, withHelp ? true
} :
@ -26,27 +20,11 @@ let
langsSpaces = stdenv . lib . concatStringsSep " " langs ;
major = " 5 " ;
minor = " 0 " ;
patch = " 0 " ;
tweak = " 5 " ;
patch = " 1 " ;
tweak = " 2 " ;
subdir = " ${ major } . ${ minor } . ${ patch } " ;
version = " ${ subdir } ${ if tweak == " " then " " else " . " } ${ tweak } " ;
# doesn't exist in srcs
# 0.8 version is in 0.7.0 tarball
libixion = stdenv . mkDerivation rec {
version = " 0 . 7 . 0 " ;
name = " l i b i x i o n - ${ version } " ;
src = fetchurl {
url = " h t t p : / / k o h e i . u s / f i l e s / i x i o n / s r c / ${ name } . t a r . b z 2 " ;
sha256 = " 1 0 a m v z 7 f z r 1 k c y 3 s v f s p k d y k m s p q g p j d m k 4 4 c y r 4 0 6 w i 7 v 4 l w n f 9 " ;
} ;
buildInputs = [ boost mdds pkgconfig ] ;
configureFlags = [ " - - w i t h - b o o s t = ${ boost . dev } " ] ;
} ;
fetchThirdParty = { name , md5 , brief , subDir ? " " }: fetchurl {
inherit name md5 ;
url = if brief then
@ -55,19 +33,6 @@ let
" h t t p : / / d e v - w w w . l i b r e o f f i c e . o r g / s r c / ${ subDir } ${ md5 } - ${ name } " ;
} ;
# Can't find Boost inside LO build
liborcus = stdenv . mkDerivation rec {
name = " l i b o r c u s - 0 . 7 . 0 " ;
src = fetchThirdParty ( stdenv . lib . findFirst
( x : x . name == " ${ name } . t a r . b z 2 " )
( " E r r o r : u p d a t e l i b o r c u s v e r s i o n i n s i d e L O e x p r e s s i o n " )
( import ./libreoffice-srcs.nix ) ) ;
buildInputs = [ boost mdds pkgconfig zlib /* l i b i x i o n */ ] ;
configureFlags = [ " - - w i t h - b o o s t = ${ boost . dev } " ] ;
} ;
fetchSrc = { name , sha256 }: fetchurl {
url = " h t t p : / / d o w n l o a d . d o c u m e n t f o u n d a t i o n . o r g / l i b r e o f f i c e / s r c / ${ subdir } / l i b r e o f f i c e - ${ name } - ${ version } . t a r . x z " ;
inherit sha256 ;
@ -82,24 +47,23 @@ let
translations = fetchSrc {
name = " t r a n s l a t i o n s " ;
sha256 = " 0 x 8 6 v f 1 f h g n j g k j 2 5 r q c f g r v i d 6 s m i k m b 9 6 1 2 1 s a s y d m g 0 j c s y p m " ;
sha256 = " 0 z 8 q f 4 r i 8 w m z g c 5 6 0 1 f x c w x w y m 1 h 9 r w k 0 k a q p x h q b k j 0 4 h 9 z 0 x q 7 " ;
} ;
# TODO: dictionaries
help = fetchSrc {
name = " h e l p " ;
sha256 = " 1 8 w q m b m 3 y v j z 6 p f n z 5 q f k l w v 4 d 5 3 v r v 2 n p i z 3 7 9 6 d 4 d 1 j 2 4 5 y l c v " ;
sha256 = " 0 i z 9 j z 0 p p g h z h 3 3 k z w 7 v 0 x q c h i m 9 b r y s 6 m n m l k 7 4 n z r h c i 2 v j 7 f 7 " ;
} ;
} ;
in
stdenv . mkDerivation rec {
in stdenv . mkDerivation rec {
name = " l i b r e o f f i c e - ${ version } " ;
src = fetchurl {
url = " h t t p : / / d o w n l o a d . d o c u m e n t f o u n d a t i o n . o r g / l i b r e o f f i c e / s r c / ${ subdir } / l i b r e o f f i c e - ${ version } . t a r . x z " ;
sha256 = " 0 4 6 f 5 l a k w 2 r y g s 5 q j m h s x m d w 7 p a 9 g w c a m a v n y q p k 1 r f b i s 2 g a 5 w v " ;
sha256 = " 0 6 n j 1 w n x 0 9 a 6 v 3 k x 9 k 4 8 8 1 0 m k b 1 9 d b k a l n 1 a f 3 3 f 4 m 7 b x g 5 b j l 8 7 " ;
} ;
# Openoffice will open libcups dynamically, so we link it directly
@ -119,30 +83,17 @@ stdenv.mkDerivation rec {
ln - svf $ { srcs . translations } $ sourceRoot/src / $ { srcs . translations . name }
'' ;
patchPhase = ''
find . - type f - print0 | xargs -0 sed - i \
- e ' s , ! * /bin/bash , ! $ { bash } /bin/bash , ' - e ' s , \ ( ! \ | SHELL = \ ) * /usr/bin/env bash , \ 1 $ { bash } /bin/bash , ' \
- e ' s , ! * /usr/bin/perl , ! $ { perl } /bin/perl , ' - e ' s , ! * /usr/bin/env perl , ! $ { perl } /bin/perl , ' \
- e ' s , ! * /usr/bin/python , ! $ { python3 } /bin / $ { python3 . executable } , ' - e ' s , ! * /usr/bin/env python , ! $ { python3 } /bin / $ { python3 . executable } , '
#sed -i 's,ANT_OPTS+="\(.*\)",ANT_OPTS+=\1,' apache-commons/java/*/makefile.mk
'' ;
QT4DIR = qt4 ;
KDE4DIR = kde4 . kdelibs ;
preConfigure = ''
# Needed to find genccode
PATH = $ PATH:$ { icu } /sbin
configureFlagsArray = (
" - - w i t h - p a r a l l e l i s m = $ N I X _ B U I L D _ C O R E S "
" - - w i t h - l a n g = ${ langsSpaces } "
" ${ if withHelp then " " else " - - w i t h o u t - h e l p " } "
) ;
chmod a + x ./bin/unpack-sources
patchShebangs .
# It is used only as an indicator of the proper current directory
touch solenv/inc/target.mk
'' ;
@ -167,7 +118,7 @@ stdenv.mkDerivation rec {
# This is required as some cppunittests require fontconfig configured
export FONTCONFIG_FILE = $ { fontsConf }
# This to ao vid using /lib:/usr/lib at linking
# This to avo id using /lib:/usr/lib at linking
sed - i ' /gb_LinkTarget_LDFLAGS / { n ; /rpath-link/d ; } ' solenv/gbuild/platform/unxgcc.mk
find - name " * . c m d " - exec sed - i s , /lib : /usr/lib , , { } \ ;
@ -177,74 +128,76 @@ stdenv.mkDerivation rec {
# It installs only things to $out/lib/libreoffice
postInstall = ''
mkdir - p $ out/bin $ out/share
mkdir - p $ out/bin $ out/share/desktop
for a in sbase scalc sdraw smath swriter spadmin simpress soffice ; do
ln - s $ out/lib/libreoffice/program / $ a $ out/bin / $ a
done
ln - s $ out/bin/soffice $ out/bin/libreoffice
ln - s $ out/bin/soffice $ out/bin/libreoffice
ln - s $ out/lib/libreoffice/share/xdg $ out/share/applications
for f in $ out/share/applications /* . d e s k t o p ; d o
substituteInPlace " $ f " - - replace " E x e c = l i b r e o f f i c e d e v ${ major } . ${ minor } " " E x e c = l i b r e o f f i c e "
substituteInPlace " $ f " - - replace " E x e c = l i b r e o f f i c e ${ major } . ${ minor } " " E x e c = l i b r e o f f i c e "
substituteInPlace " $ f " - - replace " E x e c = l i b r e o f f i c e " " E x e c = l i b r e o f f i c e "
done
mkdir - p " $ o u t / s h a r e / d e s k t o p "
cp - r sysui/desktop/icons " $ o u t / s h a r e "
sed - re ' s @ Icon = libreofficedev [ 0 -9 . ] * - ? @ Icon = @ ' - i " $ o u t / s h a r e / a p p l i c a t i o n s / " * . desktop
'' ;
configureFlags = [
" ${ if withHelp then " " else " - - w i t h o u t - h e l p " } "
" - - w i t h - b o o s t = ${ boost . dev } "
" - - w i t h - b o o s t - l i b d i r = ${ boost . lib } / l i b "
" - - w i t h - b e a n s h e l l - j a r = ${ bsh } "
" - - w i t h - v e n d o r = N i x O S "
# Without these, configure does not finish
" - - w i t h o u t - j u n i t "
# Without this, it wants to download
" - - w i t h - c o m m o n s - l o g g i n g - j a r = ${ commonsLogging } / s h a r e / j a v a / c o m m o n s - l o g g i n g - 1 . 2 . j a r "
" - - d i s a b l e - r e p o r t - b u i l d e r "
" - - e n a b l e - p y t h o n = s y s t e m "
" - - e n a b l e - d b u s "
" - - e n a b l e - k d e 4 "
" - - d i s a b l e - o d k "
" - - w i t h - p a c k a g e - f o r m a t = i n s t a l l e d "
" - - e n a b l e - e p m "
" - - w i t h - j d k - h o m e = ${ jdk . home } "
" - - w i t h - a n t - h o m e = ${ ant } / l i b / a n t "
" - - w i t h - s y s t e m - c a i r o "
" - - w i t h - s y s t e m - l i b s "
" - - w i t h - s y s t e m - h e a d e r s "
" - - w i t h - s y s t e m - o p e n s s l "
" - - w i t h - s y s t e m - l i b a b w "
" - - w i t h - s y s t e m - l i b c m i s "
" - - w i t h - s y s t e m - l i b w p s "
" - - w i t h - s y s t e m - o p e n l d a p "
" - - w i t h o u t - s y s t e m - l i b w p s " # TODO
" - - w i t h o u t - d o x y g e n "
" - - w i t h - s y s t e m - c o i n m p "
# Without these, configure does not finish
" - - w i t h o u t - j u n i t "
# I imagine this helps. Copied from go-oo.
# Modified on every upgrade, though
" - - d i s a b l e - k d e "
" - - d i s a b l e - o d k "
" - - d i s a b l e - p o s t g r e s q l - s d b c "
" - - w i t h - p a c k a g e - f o r m a t = i n s t a l l e d "
" - - e n a b l e - e p m "
" - - w i t h - j d k - h o m e = ${ jdk . home } "
" - - w i t h - a n t - h o m e = ${ ant } / l i b / a n t "
" - - d i s a b l e - f i r e b i r d - s d b c "
" - - w i t h o u t - f o n t s "
" - - w i t h o u t - m y s p e l l - d i c t s "
" - - w i t h o u t - s y s t e m - b e a n s h e l l "
" - - w i t h o u t - d o x y g e n "
# TODO: package these as system libraries
" - - w i t h - s y s t e m - b e a n s h e l l "
" - - w i t h o u t - s y s t e m - h s q l d b "
" - - w i t h o u t - s y s t e m - j a r s "
" - - w i t h o u t - s y s t e m - a l t l i n u x h y p h "
" - - w i t h o u t - s y s t e m - l p s o l v e "
" - - w i t h o u t - s y s t e m - n p a p i - h e a d e r s "
" - - w i t h o u t - s y s t e m - l i b c m i s "
" - - w i t h o u t - s y s t e m - l i b e t o n y e k "
" - - w i t h o u t - s y s t e m - l i b f r e e h a n d "
" - - w i t h o u t - s y s t e m - l i b a b w "
" - - w i t h o u t - s y s t e m - f i r e b i r d "
" - - w i t h o u t - s y s t e m - l i b l a n g t a g "
" - - w i t h o u t - s y s t e m - l i b m s p u b "
" - - w i t h o u t - s y s t e m - l i b p a g e m a k e r "
" - - w i t h o u t - s y s t e m - c o i n m p "
" - - w i t h o u t - s y s t e m - l i b g l t f "
# https://github.com/NixOS/nixpkgs/commit/5c5362427a3fa9aefccfca9e531492a8735d4e6f
" - - w i t h o u t - s y s t e m - o r c u s "
] ;
@ -260,21 +213,21 @@ stdenv.mkDerivation rec {
hunspell icu jdk kde4 . kdelibs lcms libcdr libexttextcat unixODBC libjpeg
libmspack librdf_redland librsvg libsndfile libvisio libwpd libwpg libX11
libXaw libXext libXi libXinerama libxml2 libxslt libXtst
libXdmcp libpthreadstubs mesa mythes gst_all_1 . gstreamer
libXdmcp libpthreadstubs mesa mythes gst_all_1 . gstreamer
gst_all_1 . gst-plugins-base
neon nspr nss openldap openssl ORBit2 pam perl pkgconfigUpstream poppler
python3 sablotron saneBackends tcsh unzip vigra which zip zlib
mdds bluez5 glibc
mdds bluez5 glibc libcmis libwps libabw
libxshmfence libatomic_ops graphite2 harfbuzz
librevenge libe-book libmwaw glm glew
libodfgen
libodfgen CoinMP
] ;
meta = with stdenv . lib ; {
description = " C o m p r e h e n s i v e , p r o f e s s i o n a l - q u a l i t y p r o d u c t i v i t y s u i t e , a v a r i a n t o f o p e n o f f i c e . o r g " ;
homepage = http://libreoffice.org/ ;
license = licenses . lgpl3 ;
maintainers = [ maintainers . viric maintainers . raskin ] ;
maintainers = with maintainers ; [ viric raskin ] ;
platforms = platforms . linux ;
} ;
}