forked from ProcursusTeam/Procursus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gnutls.mk
86 lines (74 loc) · 2.84 KB
/
gnutls.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
ifneq ($(PROCURSUS),1)
$(error Use the main Makefile)
endif
SUBPROJECTS += gnutls
GNUTLS_VERSION := 3.7.0
DEB_GNUTLS_V ?= $(GNUTLS_VERSION)
gnutls-setup: setup
wget -q -nc -P $(BUILD_SOURCE) https://www.gnupg.org/ftp/gcrypt/gnutls/v3.7/gnutls-$(GNUTLS_VERSION).tar.xz
$(call EXTRACT_TAR,gnutls-$(GNUTLS_VERSION).tar.xz,gnutls-$(GNUTLS_VERSION),gnutls)
ifneq ($(wildcard $(BUILD_WORK)/gnutls/.build_complete),)
gnutls:
@echo "Using previously built gnutls."
else
gnutls: gnutls-setup readline gettext libgcrypt libgmp10 libidn2 libunistring nettle p11-kit
find $(BUILD_BASE) -name "*.la" -type f -delete
cd $(BUILD_WORK)/gnutls && autoreconf -f -i
ifeq ($(MEMO_TARGET),watchos-arm64)
cd $(BUILD_WORK)/gnutls && ./configure -C \
--host=$(GNU_HOST_TRIPLE) \
--prefix=/usr \
--disable-hardware-acceleration \
--enable-local-libopts \
--with-default-trust-store-file=/etc/ssl/certs/cacert.pem \
P11_KIT_CFLAGS=-I$(BUILD_BASE)/usr/include/p11-kit-1
else
cd $(BUILD_WORK)/gnutls && ./configure -C \
--host=$(GNU_HOST_TRIPLE) \
--prefix=/usr \
--enable-local-libopts \
--with-default-trust-store-file=/etc/ssl/certs/cacert.pem \
P11_KIT_CFLAGS=-I$(BUILD_BASE)/usr/include/p11-kit-1
endif
+$(MAKE) -C $(BUILD_WORK)/gnutls
+$(MAKE) -C $(BUILD_WORK)/gnutls install \
DESTDIR=$(BUILD_STAGE)/gnutls
+$(MAKE) -C $(BUILD_WORK)/gnutls install \
DESTDIR=$(BUILD_BASE)
rm -rf $(BUILD_STAGE)/gnutls/usr/share
touch $(BUILD_WORK)/gnutls/.build_complete
endif
gnutls-package: gnutls-stage
# gnutls.mk Package Structure
rm -rf $(BUILD_DIST)/gnutls-bin \
$(BUILD_DIST)/libgnutls30 \
$(BUILD_DIST)/libgnutlsxx28 \
$(BUILD_DIST)/libgnutls28-dev
mkdir -p $(BUILD_DIST)/gnutls-bin/usr \
$(BUILD_DIST)/libgnutls30/usr/lib \
$(BUILD_DIST)/libgnutlsxx28/usr/lib \
$(BUILD_DIST)/libgnutls28-dev/usr/lib
# gnutls.mk Prep gnutls-bin
cp -a $(BUILD_STAGE)/gnutls/usr/bin $(BUILD_DIST)/gnutls-bin/usr
# gnutls.mk Prep libgnutls30
cp -a $(BUILD_STAGE)/gnutls/usr/lib/libgnutls.30.dylib $(BUILD_DIST)/libgnutls30/usr/lib
# gnutls.mk Prep libgnutlsxx28
cp -a $(BUILD_STAGE)/gnutls/usr/lib/libgnutlsxx.28.dylib $(BUILD_DIST)/libgnutlsxx28/usr/lib
# gnutls.mk Prep libgnutls28-dev
cp -a $(BUILD_STAGE)/gnutls/usr/lib/{pkgconfig,libgnutls{,xx}.dylib} $(BUILD_DIST)/libgnutls28-dev/usr/lib
cp -a $(BUILD_STAGE)/gnutls/usr/include $(BUILD_DIST)/libgnutls28-dev/usr
# gnutls.mk Sign
$(call SIGN,gnutls-bin,general.xml)
$(call SIGN,libgnutls30,general.xml)
$(call SIGN,libgnutlsxx28,general.xml)
# gnutls.mk Make .debs
$(call PACK,gnutls-bin,DEB_GNUTLS_V)
$(call PACK,libgnutls30,DEB_GNUTLS_V)
$(call PACK,libgnutlsxx28,DEB_GNUTLS_V)
$(call PACK,libgnutls28-dev,DEB_GNUTLS_V)
# gnutls.mk Build cleanup
rm -rf $(BUILD_DIST)/gnutls-bin \
$(BUILD_DIST)/libgnutls30 \
$(BUILD_DIST)/libgnutlsxx28 \
$(BUILD_DIST)/libgnutls28-dev
.PHONY: gnutls gnutls-package