8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-29 03:23:03 +01:00
firebird-mirror/builds/install/arch-specific/darwin/Makefile.in
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

79 lines
3.7 KiB
Makefile

TARGET ?= Release
# EKU: taken from Makefile.in.firebird
ROOT=..
include $(ROOT)/gen/make.defaults
include $(ROOT)/gen/make.platform
include $(ROOT)/gen/make.rules
include $(ROOT)/gen/make.shared.variables
all: package
FB_INST_VERS:=$(shell cpp -DDARWIN -I. ../builds/install/arch-specific/darwin/buildsuffix.c | tail -2 | sed -e 's/" "//g' -e 's/"//g' -e 's/Firebird[ ]*//' -e 's/Release Candidate/RC/' -e 's/ /-/g')
FB_VER_SUFFIX:=$(shell cpp -DDARWIN -I. ../builds/install/arch-specific/darwin/buildsuffix.c | tail -2 | sed -e 's/" "//g' -e 's/"//g')
FB_VER_SUFFIX_SM:=$(shell cpp -DDARWIN -I. ../builds/install/arch-specific/darwin/buildsuffix.c | tail -2 | sed -e 's/" "//g' -e 's/"//g' -e 's/Firebird[ ]*//' -e 's/Release Candidate/RC/')
FB_VER_SUFFIX_M:=$(shell cpp -DDARWIN -I. ../builds/install/arch-specific/darwin/buildsuffix.c | tail -2 | sed -e 's/" "//g' -e 's/"//g' -e 's/Release Candidate/RC/')
FB_MAJOR_VERS:=$(shell cpp -DDARWIN -I. ../builds/install/arch-specific/darwin/majorvers.c | tail -2 | sed -e 's/" "//g' -e 's/"//g')
FB_MINOR_VERS:=$(shell cpp -DDARWIN -I. ../builds/install/arch-specific/darwin/minorvers.c | tail -2 | sed -e 's/" "//g' -e 's/"//g')
FB_REV_NO:=$(shell cpp -DDARWIN -I. ../builds/install/arch-specific/darwin/revno.c | tail -2 | sed -e 's/" "//g' -e 's/"//g')
FB_BUILD_NO:=$(shell cpp -DDARWIN -I. ../builds/install/arch-specific/darwin/buildno.c | tail -2 | sed -e 's/" "//g' -e 's/"//g')
FB_PLATFORM:=$(CpuType)
package: package_firebird
package_firebird: INST_NM=Firebird-$(FB_MAJOR_VERS).$(FB_MINOR_VERS).$(FB_REV_NO)-$(FB_BUILD_NO)-$(FB_PLATFORM)
package_firebird:
sed -e 's/_FB_BUILD_SUFFIX_/$(FB_VER_SUFFIX)/g' \
-e 's/_SMFB_BUILD_SUFFIX_/$(FB_VER_SUFFIX_SM)/g' \
-e 's/_MFB_BUILD_SUFFIX_/$(FB_VER_SUFFIX_M)/g' \
-e 's/_MAJOR_VERS_/$(FB_MAJOR_VERS)/g' \
-e 's/_MINOR_VERS_/$(FB_MINOR_VERS)/g' \
-e 's/_REV_NO_/$(FB_REV_NO)/g' \
../builds/install/arch-specific/darwin/Info.plist \
> $(ROOT)/gen/$(TARGET)/frameworks/Firebird3.framework/Resources/Info.plist
sed -e 's/_FB_BUILD_SUFFIX_/$(FB_VER_SUFFIX)/g' \
-e 's/_SMFB_BUILD_SUFFIX_/$(FB_VER_SUFFIX_SM)/g' \
-e 's/_MFB_BUILD_SUFFIX_/$(FB_VER_SUFFIX_M)/g' \
-e 's/_MAJOR_VERS_/$(FB_MAJOR_VERS)/g' \
-e 's/_MINOR_VERS_/$(FB_MINOR_VERS)/g' \
-e 's/_REV_NO_/$(FB_REV_NO)/g' \
../builds/install/arch-specific/darwin/Description.plist \
> $(ROOT)/gen/$(TARGET)/frameworks/Firebird3.framework/Resources/Description.plist
rm -fr $(ROOT)/gen/$(TARGET)/scripts
mkdir $(ROOT)/gen/$(TARGET)/scripts
cp ../builds/install/arch-specific/darwin/install-script \
$(ROOT)/gen/$(TARGET)/scripts/postinstall
cp ../builds/install/arch-specific/darwin/preupgrade-script \
$(ROOT)/gen/$(TARGET)/scripts/preinstall
chmod u+x $(ROOT)/gen/$(TARGET)/scripts/postinstall
chmod u+x $(ROOT)/gen/$(TARGET)/scripts/preinstall
rm -fr $(ROOT)/gen/$(TARGET)/resources
mkdir $(ROOT)/gen/$(TARGET)/resources
cp ../builds/install/arch-specific/darwin/Welcome.txt \
$(ROOT)/gen/$(TARGET)/resources/Welcome.txt
cp ../builds/install/arch-specific/darwin/Readme.txt \
$(ROOT)/gen/$(TARGET)/resources/Readme.txt
cp ../builds/install/arch-specific/darwin/License.txt \
$(ROOT)/gen/$(TARGET)/resources/License.txt
cp ../builds/install/arch-specific/darwin/Distribution.xml \
$(ROOT)/gen/$(TARGET)/Distribution.xml
rm -fr $(TARGET)/packages
mkdir $(TARGET)/packages
pkgbuild --root $(ROOT)/gen/$(TARGET)/frameworks/Firebird3.framework \
--identifier com.firebirdsql.Firebird \
--install-location /Library/Frameworks/Firebird.framework \
--scripts $(ROOT)/gen/$(TARGET)/scripts \
$(TARGET)/packages/Firebird.pkg
productbuild --distribution $(TARGET)/Distribution.xml \
--resources $(TARGET)/resources \
--package-path $(TARGET)/packages \
$(TARGET)/$(INST_NM).pkg