Error building on MacOS

Ilmari Lauhakangas ilmari.lauhakangas at libreoffice.org
Mon Feb 5 08:57:52 UTC 2024


On 4.2.2024 15.15, Stanisław Jeśmanowicz wrote:
> Hello Adlair,
> 
> I had also problems to install LibreOffice on MacOS.
> But after many tries and errors, I made it.
> Here's how it was:
> 
> - My Mac is: MacBook Pro
> - chip: Apple M2 Max chip
> - macOS: Sonoma 14.2.1
> 
> I use  MacPorts base version 2.9.1 for open source software tools.
> - run:
>    xcode-select -s /Applications/Xcode.app/Contents/Developer
> 
> In addition to the packages I use, I also had to install:
> - port install gperf
> - install java: 
> https://download.oracle.com/java/21/latest/jdk-21_macos-aarch64_bin.dmg 
> (sha256)
> - port install apache-ant
> - ~/.zprofile contains:
> 
>    export DYLD_LIBRARY_PATH="/opt/local/lib:$DYLD_LIBRARY_PATH"
>    export 
> DYLD_FALLBACK_LIBRARY_PATH="/opt/local/lib:$DYLD_FALLBACK_LIBRARY_PATH"
>    export PATH="/opt/local/bin:$PATH"
>    export PATH="/opt/local/sbin:$PATH"
>    export PATH="/opt/local/libexec/gnubin:$PATH"
>    export PATH="./:$PATH"
> 
> - download LibreOffice sources:
>    git clone https://github.com/LibreOffice/core.git
> 
> - since the sed program is here /opt/local/libexec/gnubin/sed, I had to 
> correct two files:
>   1.  ./core/editeng/CustomTarget_generated.mk :
> #    sed -i $(if $(filter MACOSX,$(OS_FOR_BUILD)),'') -e 
> "s/(char\*)0/(char\*)0, XML_TOKEN_INVALID/g" $(editeng_INC)/tokens.cxx
>        sed -i -e "s/(char\*)0/(char\*)0, XML_TOKEN_INVALID/g" 
> $(editeng_INC)/tokens.cxx
> #    sed -i $(if $(filter MACOSX,$(OS_FOR_BUILD)),'') -e "/^#line/d" 
> $(editeng_INC)/tokens.cxx
>        sed -i -e "/^#line/d" $(editeng_INC)/tokens.cxx
> 2. ./core/workdir/UnpackedTarball/firebird/gen/make.rules
>        sed -i -e "1,2s/:/: \$$(wildcard/" -e "\$$s/\(.*\)/\\1)/" 
> $(patsubst %.o,%.d,$@)
> #    @sed $(INLINE_EDIT_SED) -e "1,2s/:/: \$$(wildcard/" -e 
> "\$$s/\(.*\)/\\1)/" $(patsubst %.o,%.d,$@)
>   ( don't forget <tab> before sed, because these are makefiles )
> 
> - in directory core I did:
> ./autogen.sh \
>   --prefix=/opt/local \
>   --with-macosx-version-min-required=14.0 \
>   --enable-bogus-pkg-config \
>   --without-fonts \
>   --without-junit \
>   --disable-sdremote \
>   --disable-firebird-sdbc \
>   --disable-postgresql-sdbc \
> 
> ./configure \
>   --prefix=/opt/local \
>   --with-macosx-version-min-required=14.0 \
>   --enable-bogus-pkg-config \
>   --without-fonts \
>   --without-junit \
>   --disable-sdremote \
>   --disable-firebird-sdbc \
>   --disable-postgresql-sdbc \
> 
> ( correct your macos's version in --with-macosx-version-min-required )
> 
> - and then in core directory do:
>    make
> 
> It took 25 minutes on my box.

The normal instructions are at 
https://wiki.documentfoundation.org/Development/BuildingOnMac

Note that GitHub is just a mirror and not used for development.

Ilmari


More information about the LibreOffice mailing list