8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-26 07:23:08 +01:00
firebird-mirror/builds/posix/postfix.darwin
Adriano dos Santos Fernandes 9ed0e28b09 Add Travis MacOS build, GitHub Actions MacOS/Windows build and adjust MacOS build to be (almost) relocatable.
While MacOS people seems to be ok with fixed locations for applications and libraries, this complicates a lot the (post)
build process, needing to change each id and rpaths in a very error prone process.

Relocatable binaries makes this a lot easier, but unfortunately "restricted" (chmod +s, like firebird executable)
programs cannot use @loader_path or @executable_path in its rpath.

So the solution has to make internal libraries relocatable and make rpath of firebird fixed. Also, as the ecosystem
seems to use fixed path, the id of fbclient.dylib has set to its fixed path.

Also MacOS post build makefile has adjusted to allow creation of packages for the debug build.

The MacOS build could still be improved with some scripts to build ICU (instead of done directly in the CI scripts,
but I leave that for now) and copies its files to our lib path. However situation seems to be better than before in
relation to ICU and TomMath.

Note: Linux build is not working in GitHub Actions. It segfaults when running (exiting) utilities.
I had this problem lot's of time in the past, maybe it's not completely fixed in v3.
2019-11-26 13:11:55 -03:00

104 lines
6.0 KiB
Plaintext

# The contents of this file are subject to the Interbase Public
# License Version 1.0 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy
# of the License at http://www.Inprise.com/IPL.html
#
# Software distributed under the License is distributed on an
# "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
# or implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code was created by Inprise Corporation
# and its predecessors. Portions created by Inprise Corporation are
#
# Copyright (C) 2000 Inprise Corporation
# All Rights Reserved.
# Contributor(s): ______________________________________.
# Start of file prefix.darwin: $(VERSION) DARWIN
# 2 Oct 2002, Nickolay Samofatov - Major Cleanup
TARGET ?= Release
ICU_VERS = icu54
ICU_LOC ?= $(HOME)/$(ICU_VERS)/icu/source/lib/
FB_FW = ../gen/$(TARGET)/frameworks/Firebird3.framework
all: framework
framework:
-$(RM) -rf $(FB_FW)
mkdir -p $(FB_FW)/Versions/A/Libraries
cp $(ICU_LOC)*.dylib ../gen/$(TARGET)/firebird/lib/
ln -s Versions/Current/Firebird $(FB_FW)/Firebird
ln -s Versions/Current/Headers $(FB_FW)/Headers
ln -s Versions/Current/Resources $(FB_FW)/Resources
ln -s Versions/Current/Libraries $(FB_FW)/Libraries
ln -s A $(FB_FW)/Versions/Current
cp -r ../gen/$(TARGET)/firebird/include $(FB_FW)/Versions/A/Headers
mkdir -p $(FB_FW)/Versions/A/Resources/lib
cp ../gen/$(TARGET)/firebird/lib/libtommath.dylib $(FB_FW)/Versions/A/Resources/lib/
cp ../gen/$(TARGET)/firebird/lib/libfbclient.dylib $(FB_FW)/Versions/A/Resources/lib/
cp ../gen/$(TARGET)/firebird/lib/libicudata*.dylib $(FB_FW)/Versions/A/Resources/lib/
cp ../gen/$(TARGET)/firebird/lib/libicui18n*.dylib $(FB_FW)/Versions/A/Resources/lib/
cp ../gen/$(TARGET)/firebird/lib/libicuuc*.dylib $(FB_FW)/Versions/A/Resources/lib/
cp ../gen/$(TARGET)/firebird/lib/libib_util.dylib $(FB_FW)/Versions/A/Resources/lib/
ln -s ../Resources/lib/libfbclient.dylib $(FB_FW)/Versions/A/Libraries/libfbclient.dylib
ln -s ../Resources/lib/libib_util.dylib $(FB_FW)/Versions/A/Libraries/libib_util.dylib
mkdir -p $(FB_FW)/Versions/A/Resources/English.lproj
mkdir -p $(FB_FW)/Versions/A/Resources/UDF
cp ../gen/$(TARGET)/firebird/UDF/fbudf.dylib $(FB_FW)/Versions/A/Resources/UDF/fbudf.dylib
cp ../gen/$(TARGET)/firebird/UDF/ib_udf.dylib $(FB_FW)/Versions/A/Resources/UDF/ib_udf.dylib
cp ../gen/$(TARGET)/firebird/UDF/fbudf.sql $(FB_FW)/Versions/A/Resources/UDF/fbudf.sql
cp ../gen/$(TARGET)/firebird/UDF/ib_udf.sql $(FB_FW)/Versions/A/Resources/UDF/ib_udf.sql
cp ../gen/$(TARGET)/firebird/UDF/ib_udf2.sql $(FB_FW)/Versions/A/Resources/UDF/ib_udf2.sql
mkdir -p $(FB_FW)/Versions/A/Resources/intl
cp -r ../gen/$(TARGET)/firebird/intl/libfbintl.dylib $(FB_FW)/Versions/A/Resources/intl/libfbintl.dylib
cp ../gen/$(TARGET)/firebird/intl/fbintl.conf $(FB_FW)/Versions/A/Resources/intl/fbintl.conf
#chmod a+rx $(FB_FW)/Versions/A/Resources/intl/fbintl
cp -r ../gen/$(TARGET)/firebird/plugins $(FB_FW)/Versions/A/Resources/plugins
cp ../gen/$(TARGET)/firebird/security3.fdb $(FB_FW)/Versions/A/Resources/security3.fdb
cp ../gen/$(TARGET)/firebird/firebird.msg $(FB_FW)/Versions/A/Resources/firebird.msg
cp -r ../gen/$(TARGET)/firebird/help $(FB_FW)/Versions/A/Resources/help
mkdir -p $(FB_FW)/Resources/doc
cp -r ../doc $(FB_FW)/Resources
mkdir -p $(FB_FW)/Resources/examples
cp -r ../gen/$(TARGET)/firebird/examples $(FB_FW)/Resources
mkdir -p $(FB_FW)/Resources/bin
touch $(FB_FW)/Resources/SuperServer
chflags hidden $(FB_FW)/Resources/SuperServer
cp ../gen/$(TARGET)/firebird/bin/gfix $(FB_FW)/Versions/A/Resources/bin
cp ../gen/$(TARGET)/firebird/bin/gbak $(FB_FW)/Versions/A/Resources/bin
cp ../gen/$(TARGET)/firebird/bin/isql $(FB_FW)/Versions/A/Resources/bin
cp ../gen/$(TARGET)/firebird/bin/gpre $(FB_FW)/Versions/A/Resources/bin
cp ../gen/$(TARGET)/firebird/bin/qli $(FB_FW)/Versions/A/Resources/bin
cp ../gen/$(TARGET)/firebird/bin/fb_lock_print $(FB_FW)/Versions/A/Resources/bin
cp ../gen/$(TARGET)/firebird/bin/gsec $(FB_FW)/Versions/A/Resources/bin
cp ../gen/$(TARGET)/firebird/bin/gstat $(FB_FW)/Versions/A/Resources/bin
cp ../gen/$(TARGET)/firebird/bin/nbackup $(FB_FW)/Versions/A/Resources/bin
cp ../gen/$(TARGET)/firebird/bin/fbguard $(FB_FW)/Versions/A/Resources/bin
cp ../gen/$(TARGET)/firebird/bin/fbtracemgr $(FB_FW)/Versions/A/Resources/bin
cp ../gen/$(TARGET)/firebird/bin/firebird $(FB_FW)/Versions/A/Resources/bin
chmod +x ../builds/install/arch-specific/darwin/changeServerMode
cp ../builds/install/arch-specific/darwin/changeServerMode $(FB_FW)/Versions/A/Resources/bin/changeServerMode.sh
cp ../src/extlib/ib_udf.sql $(FB_FW)/Versions/A/Resources/UDF
cp ../src/extlib/fbudf/fbudf.sql $(FB_FW)/Versions/A/Resources/UDF
cp ../builds/install/arch-specific/darwin/FrameworkInfo.plist $(FB_FW)/Versions/A/Resources/Info.plist
cp ../builds/install/arch-specific/darwin/launchd.org.firebird.gds.plist $(FB_FW)/Versions/A/Resources/org.firebird.gds.plist
cp ../builds/install/arch-specific/darwin/launchdcs.org.firebird.gds.plist $(FB_FW)/Versions/A/Resources/cs.org.firebird.gds.plist
cp ../builds/install/arch-specific/darwin/Readme.txt $(FB_FW)/Versions/A/Resources/Readme.txt
cp ../builds/install/arch-specific/darwin/License.txt $(FB_FW)/Versions/A/Resources/License.txt
cp ../gen/$(TARGET)/firebird/firebird.conf $(FB_FW)/Versions/A/Resources//firebird.conf
cp ../gen/$(TARGET)/firebird/databases.conf $(FB_FW)/Versions/A/Resources/databases.conf
cp ../gen/$(TARGET)/firebird/fbtrace.conf $(FB_FW)/Versions/A/Resources/fbtrace.conf
cp ../gen/$(TARGET)/firebird/plugins.conf $(FB_FW)/Versions/A/Resources/plugins.conf
mkdir $(FB_FW)/Versions/A/Resources/misc
mkdir $(FB_FW)/Versions/A/Resources/misc/upgrade
cp -r ../src/misc/upgrade/v3.0 $(FB_FW)/Versions/A/Resources/misc/upgrade
install_name_tool -rpath @loader_path/.. /Library/Frameworks/Firebird.framework/Resources $(FB_FW)/Versions/A/Resources/bin/firebird
install_name_tool -id /Library/Frameworks/Firebird.framework/Libraries/libfbclient.dylib $(FB_FW)/Versions/A/Resources/lib/libfbclient.dylib