Lines 8-26
Link Here
|
8 |
# necessary (db5 if compatible). |
8 |
# necessary (db5 if compatible). |
9 |
# This adds a "debug-bdb" make target which will dump the |
9 |
# This adds a "debug-bdb" make target which will dump the |
10 |
# related data. |
10 |
# related data. |
11 |
# INVALID_BDB_VER |
|
|
12 |
# - This variable can be defined when the port does not |
13 |
# support one or more versions of Berkeley DB. |
14 |
# <BDB_UNIQUENAME>_WITH_BDB_VER |
11 |
# <BDB_UNIQUENAME>_WITH_BDB_VER |
15 |
# - User defined port specific variable to set Berkeley DB |
12 |
# - User defined port specific variable to set Berkeley DB |
16 |
# version. |
13 |
# version. |
17 |
# WITH_BDB_HIGHEST |
14 |
# WITH_BDB_HIGHEST |
18 |
# - Use the highest installed version of Berkeley DB. |
15 |
# - Use the highest installed version of Berkeley DB. |
19 |
# WITH_BDB6_PERMITTED |
|
|
20 |
# - If defined, BerkeleyDB 6 is added to the |
21 |
# default version set, making it eligible even |
22 |
# if not already installed. This is due to its |
23 |
# stricter Affero GNU Public License. |
24 |
# |
16 |
# |
25 |
# These variables will then be filled in by this .mk file: |
17 |
# These variables will then be filled in by this .mk file: |
26 |
# |
18 |
# |
Lines 58-71
BDB_UNIQUENAME?= ${PKGNAMEPREFIX}${PORTNAME}
Link Here
|
58 |
_BDB_DEFAULT_save:=${BDB_DEFAULT} |
50 |
_BDB_DEFAULT_save:=${BDB_DEFAULT} |
59 |
|
51 |
|
60 |
_DB_PORTS= 5 18 |
52 |
_DB_PORTS= 5 18 |
61 |
_DB_DEFAULTS= 5 |
|
|
62 |
# |
63 |
# Since 2020-12-02, this name is not fitting too much but |
64 |
# retained for now for compatibility. The name of this variable |
65 |
# is subject to change especially once db6 were removed. |
66 |
. if defined(WITH_BDB6_PERMITTED) || ${_bdb_ARGS} == 18 |
67 |
_DB_DEFAULTS+= 18 |
68 |
. endif |
69 |
|
53 |
|
70 |
# Dependency lines for different db versions |
54 |
# Dependency lines for different db versions |
71 |
db5_DEPENDS= libdb-5.3.so:databases/db5 |
55 |
db5_DEPENDS= libdb-5.3.so:databases/db5 |
Lines 83-114
BDB_DEFAULT= ${${BDB_UNIQUENAME:tu:S,-,_,}_WITH_BDB_VER}
Link Here
|
83 |
# Override _bdb_ARGS with global BDB_DEFAULT if the maintainer did not |
67 |
# Override _bdb_ARGS with global BDB_DEFAULT if the maintainer did not |
84 |
# ask for a more specific version. |
68 |
# ask for a more specific version. |
85 |
. if ${_bdb_ARGS} == yes |
69 |
. if ${_bdb_ARGS} == yes |
86 |
. if ${BDB_DEFAULT} != 1 |
|
|
87 |
_bdb_ARGS= ${BDB_DEFAULT} |
70 |
_bdb_ARGS= ${BDB_DEFAULT} |
88 |
. else |
|
|
89 |
_bdb_ARGS:= 5+ |
90 |
. endif |
91 |
. endif |
71 |
. endif |
92 |
|
72 |
|
93 |
# Compatiblity hack: |
73 |
# 1. parse supported versions and build list from _bdb_ARGS |
94 |
# upgrade older plussed versions to 5+ |
|
|
95 |
_BDB_OLDPLUSVERS=4+ 40+ 41+ 42+ 43+ 44+ 45+ 46+ 47+ 48+ |
96 |
. for i in ${_bdb_ARGS} |
97 |
. if ${_BDB_OLDPLUSVERS:M${i}} |
98 |
_bdb_ARGS:= 5+ |
99 |
. endif |
100 |
. endfor |
101 |
|
102 |
# 1. detect installed versions |
103 |
_INST_BDB_VER= |
104 |
. for bdb in ${_DB_PORTS} |
105 |
. if exists(${db${bdb}_FIND}) |
106 |
_INST_BDB_VER+=${bdb} |
107 |
. endif |
108 |
. endfor |
109 |
|
110 |
# 2. parse supported versions: |
111 |
# 2a. build list from _bdb_ARGS |
112 |
_SUPP_BDB_VER= |
74 |
_SUPP_BDB_VER= |
113 |
__bdb_ARGS:=${_bdb_ARGS:C,\+$,,} |
75 |
__bdb_ARGS:=${_bdb_ARGS:C,\+$,,} |
114 |
. if !empty(_bdb_ARGS:M*+) |
76 |
. if !empty(_bdb_ARGS:M*+) |
Lines 120-165
_SUPP_BDB_VER+=${bdb:C/\.//}
Link Here
|
120 |
. else |
82 |
. else |
121 |
_SUPP_BDB_VER=${_bdb_ARGS} |
83 |
_SUPP_BDB_VER=${_bdb_ARGS} |
122 |
. endif |
84 |
. endif |
123 |
# 2b. expand INVALID_BDB_VER if given with "+": |
|
|
124 |
. if !empty(INVALID_BDB_VER:M*+) |
125 |
_INV_BDB:=${INVALID_BDB_VER:C,\+$,,} |
126 |
_INV_BDB_VER:= |
127 |
. for bdb in ${_DB_PORTS} |
128 |
. if ${_INV_BDB} <= ${bdb} |
129 |
_INV_BDB_VER+=${bdb:C/\.//} |
130 |
. endif |
131 |
. endfor |
132 |
. else |
133 |
_INV_BDB_VER:=${INVALID_BDB_VER} |
134 |
. endif |
135 |
# 2c. strip versions from INVALID_BDB_VER out of _SUPP_BDB_VER |
136 |
. for unsupp in ${_INV_BDB_VER} |
137 |
_SUPP_BDB_VER:=${_SUPP_BDB_VER:N${unsupp}} |
138 |
. endfor |
139 |
|
140 |
# 3a. calculate intersection in _INST_BDB_VER to see if there |
141 |
# is a usable installed version |
142 |
. for i in ${_INST_BDB_VER} |
143 |
. if empty(_SUPP_BDB_VER:M${i}) |
144 |
_INST_BDB_VER:= ${_INST_BDB_VER:N${i}} |
145 |
. endif |
146 |
. endfor |
147 |
_ELIGIBLE_BDB_VER:=${_INST_BDB_VER} |
148 |
|
85 |
|
149 |
# 3b. if there is no usable version installed, check defaults |
86 |
# 2. check defaults |
150 |
. if empty(_INST_BDB_VER) |
87 |
_DFLT_BDB_VER:=${_DB_PORTS} |
151 |
_DFLT_BDB_VER:=${_DB_DEFAULTS} |
|
|
152 |
# make sure we use a reasonable version for package builds |
88 |
# make sure we use a reasonable version for package builds |
153 |
_WITH_BDB_HIGHEST=yes |
89 |
_WITH_BDB_HIGHEST=yes |
154 |
. for i in ${_DFLT_BDB_VER} |
90 |
. for i in ${_DFLT_BDB_VER} |
155 |
. if empty(_SUPP_BDB_VER:M${i}) |
91 |
. if empty(_SUPP_BDB_VER:M${i}) |
156 |
_DFLT_BDB_VER:= ${_DFLT_BDB_VER:N${i}} |
92 |
_DFLT_BDB_VER:= ${_DFLT_BDB_VER:N${i}} |
157 |
. endif |
93 |
. endif |
158 |
. endfor |
94 |
. endfor |
159 |
_ELIGIBLE_BDB_VER:=${_DFLT_BDB_VER} |
95 |
_ELIGIBLE_BDB_VER:=${_DFLT_BDB_VER} |
160 |
. endif |
|
|
161 |
|
96 |
|
162 |
# 4. elect a version |
97 |
# 3. elect a version |
163 |
_BDB_VER= |
98 |
_BDB_VER= |
164 |
. for i in ${_ELIGIBLE_BDB_VER} |
99 |
. for i in ${_ELIGIBLE_BDB_VER} |
165 |
. if !empty(WITH_BDB_HIGHEST) || !empty(_WITH_BDB_HIGHEST) || empty(${_BDB_VER}) |
100 |
. if !empty(WITH_BDB_HIGHEST) || !empty(_WITH_BDB_HIGHEST) || empty(${_BDB_VER}) |
Lines 167-175
_BDB_VER:=${i}
Link Here
|
167 |
. endif |
102 |
. endif |
168 |
. endfor |
103 |
. endfor |
169 |
|
104 |
|
170 |
# 5. catch errors or set variables |
105 |
# 4. catch errors or set variables |
171 |
. if empty(_BDB_VER) |
106 |
. if empty(_BDB_VER) |
172 |
IGNORE= cannot install: no eligible BerkeleyDB version. Requested: ${_bdb_ARGS}, incompatible: ${_INV_BDB_VER}. Try: make debug-bdb |
107 |
IGNORE= cannot install: no eligible BerkeleyDB version. Requested: ${_bdb_ARGS}. Try: make debug-bdb |
173 |
. else |
108 |
. else |
174 |
. if defined(BDB_BUILD_DEPENDS) |
109 |
. if defined(BDB_BUILD_DEPENDS) |
175 |
BUILD_DEPENDS+= ${db${_BDB_VER}_FIND}:${db${_BDB_VER}_DEPENDS:C/^libdb.*://} |
110 |
BUILD_DEPENDS+= ${db${_BDB_VER}_FIND}:${db${_BDB_VER}_DEPENDS:C/^libdb.*://} |
Lines 201-208
debug-bdb:
Link Here
|
201 |
@${ECHO_CMD} "WITH_BDB_HIGHEST (original): ${WITH_BDB_HIGHEST}" |
136 |
@${ECHO_CMD} "WITH_BDB_HIGHEST (original): ${WITH_BDB_HIGHEST}" |
202 |
@${ECHO_CMD} "--PROCESSING------------------------------------------------" |
137 |
@${ECHO_CMD} "--PROCESSING------------------------------------------------" |
203 |
@${ECHO_CMD} "supported versions: ${_SUPP_BDB_VER}" |
138 |
@${ECHO_CMD} "supported versions: ${_SUPP_BDB_VER}" |
204 |
@${ECHO_CMD} "invalid versions: ${_INV_BDB_VER}" |
|
|
205 |
@${ECHO_CMD} "installed versions: ${_INST_BDB_VER}" |
206 |
@${ECHO_CMD} "eligible versions: ${_ELIGIBLE_BDB_VER}" |
139 |
@${ECHO_CMD} "eligible versions: ${_ELIGIBLE_BDB_VER}" |
207 |
@${ECHO_CMD} "bdb_ARGS (effective): ${_bdb_ARGS}" |
140 |
@${ECHO_CMD} "bdb_ARGS (effective): ${_bdb_ARGS}" |
208 |
@${ECHO_CMD} "WITH_BDB_HIGHEST (override): ${_WITH_BDB_HIGHEST}" |
141 |
@${ECHO_CMD} "WITH_BDB_HIGHEST (override): ${_WITH_BDB_HIGHEST}" |