summaryrefslogtreecommitdiff
path: root/external/nss/ExternalProject_nss.mk
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2020-02-19 22:54:50 +0100
committerLuboš Luňák <l.lunak@collabora.com>2020-03-23 14:31:04 +0100
commit8512f4ca090c85477a6670438aeefe7fdfcf8a98 (patch)
treed8832c3f2fff7a4f78b40d941f970ec800348718 /external/nss/ExternalProject_nss.mk
parenta58e086ededb8442938e81f971dfae36ef7eb076 (diff)
build nss using their new build system (gyp/ninja-based)
This requires installed ninja, gyp is included as source. This allows nss be built as a parallel build, unlike the old Makefile build system. Since gyp internally uses python, even recursively, this requires more complicated setup in case our internal python is used. Moreover gyp itself seems to be kind of deprecated itself and hasn't been ported to python3 yet, so that needs patching too. So far only easy Unix-like systems are converted, Windows I'll do later, the more complicated systems I'll leave to whoever has access to them. Change-Id: I358baad7690d2aa6df44bafa9244dc7cc828fc3f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90115 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'external/nss/ExternalProject_nss.mk')
-rw-r--r--external/nss/ExternalProject_nss.mk26
1 files changed, 25 insertions, 1 deletions
diff --git a/external/nss/ExternalProject_nss.mk b/external/nss/ExternalProject_nss.mk
index acf418805772..daee76fc8fa9 100644
--- a/external/nss/ExternalProject_nss.mk
+++ b/external/nss/ExternalProject_nss.mk
@@ -34,7 +34,31 @@ $(call gb_ExternalProject_get_state_target,nss,build): $(call gb_ExternalExecuta
,nss)
$(call gb_Trace_EndRange,nss,EXTERNAL)
-else # OS!=WNT
+else ifneq (,$(filter FREEBSD LINUX NETBSD OPENBSD SOLARIS,$(OS))) # non-WNT gyp-based
+
+# The nss build system uses 'python', so make it find our internal python if necessary.
+nss_PYTHON := $(call gb_UnpackedTarball_get_dir,nss)/python
+nss_SETUP_PYTHON := $(call gb_UnpackedTarball_get_dir,nss)/setup-python
+
+$(call gb_ExternalProject_get_state_target,nss,build): $(call gb_ExternalExecutable_get_dependencies,python)
+ $(call gb_Trace_StartRange,nss,EXTERNAL)
+ echo "#! /bin/sh" > $(nss_PYTHON)
+ pythondir=$$($(call gb_ExternalExecutable_get_command,python) -c 'import sys; import os; sys.stdout.write(os.path.dirname(sys.executable))') \
+ && echo PATH=\"$$pythondir:\$$PATH\" >>$(nss_PYTHON)
+ echo '$(call gb_ExternalExecutable_get_command,python)' \"$$\@\" $(if $(ICECREAM_RUN), | sed 's/$(ICECREAM_RUN)//') >> $(nss_PYTHON)
+ chmod +x $(nss_PYTHON)
+ cp $(SRCDIR)/external/nss/setup-python $(nss_SETUP_PYTHON)
+ chmod +x $(nss_SETUP_PYTHON)
+ $(call gb_ExternalProject_run,build,\
+ COMMA=$(COMMA) \
+ PATH=$(call gb_UnpackedTarball_get_dir,nss):$(call gb_UnpackedTarball_get_dir,gyp):$$PATH \
+ ./build.sh -v --disable-tests --enable-libpkix \
+ $(if $(ENABLE_DBGUTIL),,--opt) \
+ && rm -f $(call gb_UnpackedTarball_get_dir,nss)/dist/out/lib/*.a \
+ ,nss)
+ $(call gb_Trace_EndRange,nss,EXTERNAL)
+
+else # platforms which need(?) the old build system (feel free to port to the new system)
# make sure to specify NSPR_CONFIGURE_OPTS as env (before make command), so nss can append it's own defaults
# OTOH specify e.g. CC and NSINSTALL as arguments (after make command), so they will overrule nss makefile values
$(call gb_ExternalProject_get_state_target,nss,build): $(call gb_ExternalExecutable_get_dependencies,python)