summaryrefslogtreecommitdiff
path: root/pcr/ring/0001-contrib-recursive-dependency-tracking.patch
blob: 030c5cf943829241345c368ec8c7c8905f1224a3 (plain)
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
From f50c8a7e1fbdf317013f19b962093b068ed6e0f7 Mon Sep 17 00:00:00 2001
From: Luke Shumaker <lukeshu@parabola.nu>
Date: Wed, 13 Dec 2017 13:49:07 -0500
Subject: [PATCH] contrib: recursive dependency tracking

Let's say we're building gnutls (since the system version is too new).
gnutls depends on nettle.
Let's say we're using the system nettle (naturally in FOUND_PKGS).
nettle depends on gmp.

With the old (non-recursive) dependency tracking, we would end up building
gmp just for nettle, even though we aren't even building nettle!
---
 contrib/src/README              | 17 +++++------------
 contrib/src/ffmpeg/rules.mak    |  2 +-
 contrib/src/flac/rules.mak      |  2 +-
 contrib/src/gnutls/rules.mak    |  2 +-
 contrib/src/main.mak            |  3 ++-
 contrib/src/nettle/rules.mak    |  2 +-
 contrib/src/opendht/rules.mak   |  2 +-
 contrib/src/secp256k1/rules.mak |  2 +-
 contrib/src/vorbis/rules.mak    |  4 ++--
 9 files changed, 15 insertions(+), 21 deletions(-)

diff --git a/contrib/src/README b/contrib/src/README
index 581a39219..d03ff1899 100644
--- a/contrib/src/README
+++ b/contrib/src/README
@@ -92,18 +92,11 @@ Dependencies
 If package bar depends on package foo, the special DEPS_bar variable
 should be defined as follow:
 
-	DEPS_bar = foo $(DEPS_foo)
-
-Note that dependency resolution is unfortunately _not_ recursive.
-Therefore $(DEPS_foo) really should be specified explicitly as shown
-above. (In practice, this will not make any difference insofar as there
-are no pure second-level nested dependencies. For instance, libass
-depends on FontConfig, which depends on FreeType, but libass depends
-directly on FreeType anyway.)
-
-Also note that DEPS_bar is set "recursively" with =, rather than
-"immediately" with :=. This is so that $(DEPS_foo) is expanded
-correctly, even if DEPS_foo it is defined after DEPS_bar.
+	DEPS_bar = foo
+
+Dependency resolution is recursive (unlike in previous versions); the
+above will cause bar to also depend on the dependencies of foo.
+However, it will not correctly handle cycles.
 
 Implementation note:
 
diff --git a/contrib/src/ffmpeg/rules.mak b/contrib/src/ffmpeg/rules.mak
index b1db5d131..e86403e25 100644
--- a/contrib/src/ffmpeg/rules.mak
+++ b/contrib/src/ffmpeg/rules.mak
@@ -11,7 +11,7 @@ ifeq ($(call need_pkg,"libavutil >= 55.75.100 libavcodec >= 57.106.101 libavform
 PKGS_FOUND += ffmpeg
 endif
 
-DEPS_ffmpeg = iconv zlib x264 vpx opus speex $(DEPS_vpx)
+DEPS_ffmpeg = iconv zlib x264 vpx opus speex
 
 FFMPEGCONF = \
 	--cc="$(CC)" \
diff --git a/contrib/src/flac/rules.mak b/contrib/src/flac/rules.mak
index 7abc69938..857593aad 100644
--- a/contrib/src/flac/rules.mak
+++ b/contrib/src/flac/rules.mak
@@ -47,7 +47,7 @@ FLACCONF += --disable-asm-optimizations
 endif
 endif
 
-DEPS_flac = ogg $(DEPS_ogg)
+DEPS_flac = ogg
 
 .flac: flac
 	cd $< && $(HOSTVARS) ./configure $(FLACCONF)
diff --git a/contrib/src/gnutls/rules.mak b/contrib/src/gnutls/rules.mak
index 843135814..4441fcf91 100644
--- a/contrib/src/gnutls/rules.mak
+++ b/contrib/src/gnutls/rules.mak
@@ -60,7 +60,7 @@ ifdef HAVE_IOS
 	GNUTLS_CONF += --disable-hardware-acceleration
 endif
 
-DEPS_gnutls = nettle $(DEPS_nettle) iconv $(DEPS_iconv)
+DEPS_gnutls = nettle iconv
 
 
 #Workaround for localtime_r function
diff --git a/contrib/src/main.mak b/contrib/src/main.mak
index 51cbbfbcd..542f2228c 100644
--- a/contrib/src/main.mak
+++ b/contrib/src/main.mak
@@ -391,7 +391,8 @@ PKGS_AUTOMATIC := $(filter-out $(PKGS_FOUND),$(PKGS))
 # Apply manual selection (from bootstrap):
 PKGS_MANUAL := $(sort $(PKGS_ENABLE) $(filter-out $(PKGS_DISABLE),$(PKGS_AUTOMATIC)))
 # Resolve dependencies:
-PKGS_DEPS := $(filter-out $(PKGS_FOUND) $(PKGS_MANUAL),$(sort $(foreach p,$(PKGS_MANUAL),$(DEPS_$(p)))))
+dep_on = $(sort $(foreach p,$(filter-out $(PKGS_FOUND),$(1)),$(p) $(call dep_on,$(DEPS_$(p)))))
+PKGS_DEPS := $(call dep_on,$(PKGS_MANUAL))
 PKGS := $(sort $(PKGS_MANUAL) $(PKGS_DEPS))
 
 convert-static:
diff --git a/contrib/src/nettle/rules.mak b/contrib/src/nettle/rules.mak
index f811297a6..b924c7f87 100644
--- a/contrib/src/nettle/rules.mak
+++ b/contrib/src/nettle/rules.mak
@@ -19,7 +19,7 @@ nettle: nettle-$(NETTLE_VERSION).tar.gz .sum-nettle
 	$(UPDATE_AUTOCONFIG)
 	$(MOVE)
 
-DEPS_nettle = gmp $(DEPS_gmp)
+DEPS_nettle = gmp
 
 .nettle: nettle
 ifdef HAVE_IOS
diff --git a/contrib/src/opendht/rules.mak b/contrib/src/opendht/rules.mak
index 4443a6fc0..b7fbe8ec8 100644
--- a/contrib/src/opendht/rules.mak
+++ b/contrib/src/opendht/rules.mak
@@ -15,7 +15,7 @@ ifneq ($(call need_pkg,"libargon2"),)
 DEPS_opendht += argon2
 endif
 ifneq ($(call need_pkg,"gnutls >= 3.3.0"),)
-DEPS_opendht += gnutls $(DEPS_gnutls)
+DEPS_opendht += gnutls
 endif
 
 $(TARBALLS)/opendht-$(OPENDHT_VERSION).tar.gz:
diff --git a/contrib/src/secp256k1/rules.mak b/contrib/src/secp256k1/rules.mak
index c5681629d..5b4f84e43 100644
--- a/contrib/src/secp256k1/rules.mak
+++ b/contrib/src/secp256k1/rules.mak
@@ -7,7 +7,7 @@ PKGS += secp256k1
 ifeq ($(call need_pkg,"libsecp256k1"),)
 PKGS_FOUND += secp256k1
 endif
-DEPS_secp256k1 = gmp $(DEPS_gmp)
+DEPS_secp256k1 = gmp
 
 $(TARBALLS)/secp256k1-$(SECP256K1_VERSION).tar.gz:
 	$(call download,$(SECP256K1_URL))
diff --git a/contrib/src/vorbis/rules.mak b/contrib/src/vorbis/rules.mak
index 1fb268514..e20cc7493 100644
--- a/contrib/src/vorbis/rules.mak
+++ b/contrib/src/vorbis/rules.mak
@@ -36,7 +36,7 @@ endif
 	$(UPDATE_AUTOCONFIG)
 	$(MOVE)
 
-DEPS_vorbis = ogg $(DEPS_ogg)
+DEPS_vorbis = ogg
 
 .vorbis: vorbis
 	$(RECONF) -Im4
@@ -47,7 +47,7 @@ DEPS_vorbis = ogg $(DEPS_ogg)
 .sum-vorbisenc: .sum-vorbis
 	touch $@
 
-DEPS_vorbisenc = vorbis $(DEPS_vorbis)
+DEPS_vorbisenc = vorbis
 
 .vorbisenc:
 	touch $@
-- 
2.15.1