3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
12 # Use of unset variable is an error
15 # If any part of a pipeline of commands fails, the whole pipeline fails
18 if [ `uname` != Darwin
]; then
19 echo This is
for macOS only
>&2
24 echo Usage
: $0 app-bundle-1 app-bundle-2 output-app-bundle
29 echo The directory
$3 exists already
34 echo $3 exists and is a
file
38 if [ ! -d "$1" ]; then
39 echo No such directory
: $1
43 if [ ! -d "$2" ]; then
44 echo No such directory
: $2
48 ONE
=$
(cd "$1" && /bin
/pwd)
49 TWO
=$
(cd "$2" && /bin
/pwd)
51 OUT
=$
(cd "$3" && /bin
/pwd)
53 # Create all directories
60 while read dirname; do
65 # Check which files in 1 exist in 2, and if they are executable, merge them into a fat copy. For
66 # other files, just use one copy, assuming they are equivalent in most cases.
69 find .
-type l
-or -type f
74 if test -L "$fname"; then
75 ln -s $
(readlink
"$fname") "$OUT/$fname"
76 elif test -f "$fname"; then
83 */Frameworks
/LibreOfficePython.framework
/Versions
/*/LibreOfficePython | \
84 */Frameworks
/LibreOfficePython.framework
/Versions
/*/Resources
/Python.app
/Contents
/MacOS
/LibreOfficePython | \
85 */Library
/Spotlight
/OOoSpotlightImporter.mdimporter
/Contents
/MacOS
/OOoSpotlightImporter
)
86 lipo
-create -output "$OUT/$fname" "$fname" "$ONE/$fname"
88 # Ignore differences in these files. Let's hope it's just the timestamps.
92 */_sysconfigdata_m_darwin_darwin.py | \
93 */Contents
/Resources
/firebird
/security3.fdb | \
94 */Contents
/Resources
/autocorr
/acor_
*.dat | \
95 */Contents
/Resources
/resource
/*/LC_MESSAGES
/*.mo | \
96 */Contents
/Resources
/config
/images_
*.
zip)
97 cp "$fname" "$OUT/$fname"
100 case $
(file --brief "$fname") in
101 Mach-O\
64-bit\ executable\
*)
102 lipo
-create -output "$OUT/$fname" "$fname" "$ONE/$fname"
105 cmp -s "$fname" "$ONE/$fname" ||
106 echo "$fname differs and is not an executable!?" >&2
107 cp "$fname" "$OUT/$fname"
111 # We ignore some files that can't be built for macOS on arm64 for now
113 .
/Contents
/Frameworks
/LibreOfficePython.framework
/Versions
/3.
*/lib
/python
*/lib-dynload
/_ctypes.cpython-
*m.so
)
116 echo "$fname does not exist in $TWO" >&2
119 cp "$ONE/$fname" "$OUT/$fname"
124 # Look for files in 2 that don't exist in 1
127 find .
-type f
-print
132 if test -f "$fname"; then
135 echo "$fname does not exist in $ONE" >&2
136 cp "$TWO/$fname" "$OUT/$fname"
143 # indent-tabs-mode: nil