| @@ -1,859 +1,859 @@ | | | @@ -1,859 +1,859 @@ |
1 | # $NetBSD: bsd.pkg.mk,v 1.2049 2023/02/04 08:38:28 wiz Exp $ | | 1 | # $NetBSD: bsd.pkg.mk,v 1.2050 2023/02/12 20:14:02 wiz Exp $ |
2 | # | | 2 | # |
3 | # This file is in the public domain. | | 3 | # This file is in the public domain. |
4 | # | | 4 | # |
5 | # Please see the pkgsrc/doc/guide manual for details on the | | 5 | # Please see the pkgsrc/doc/guide manual for details on the |
6 | # variables used in this make file template. | | 6 | # variables used in this make file template. |
7 | # | | 7 | # |
8 | # Default sequence for "all" is: | | 8 | # Default sequence for "all" is: |
9 | # | | 9 | # |
10 | # bootstrap-depends | | 10 | # bootstrap-depends |
11 | # fetch | | 11 | # fetch |
12 | # checksum | | 12 | # checksum |
13 | # depends | | 13 | # depends |
14 | # tools | | 14 | # tools |
15 | # extract | | 15 | # extract |
16 | # patch | | 16 | # patch |
17 | # wrapper | | 17 | # wrapper |
18 | # configure | | 18 | # configure |
19 | # build | | 19 | # build |
20 | # | | 20 | # |
21 | | | 21 | |
22 | .include "misc/common.mk" | | 22 | .include "misc/common.mk" |
23 | | | 23 | |
24 | ############################################################################ | | 24 | ############################################################################ |
25 | # Transform package Makefile variables and set defaults | | 25 | # Transform package Makefile variables and set defaults |
26 | # This is the early set used directly or indirectly in | | 26 | # This is the early set used directly or indirectly in |
27 | # the phase variables. | | 27 | # the phase variables. |
28 | ############################################################################ | | 28 | ############################################################################ |
29 | | | 29 | |
30 | ##### PKGBASE, PKGNAME[_NOREV], PKGVERSION | | 30 | ##### PKGBASE, PKGNAME[_NOREV], PKGVERSION |
31 | | | 31 | |
32 | PKGBASE?= ${PKGNAME:C/-[^-]*$//} | | 32 | PKGBASE?= ${PKGNAME:C/-[^-]*$//} |
33 | PKGVERSION?= ${PKGNAME:C/^.*-//} | | 33 | PKGVERSION?= ${PKGNAME:C/^.*-//} |
34 | .if defined(PKGREVISION) && !empty(PKGREVISION) && (${PKGREVISION} != "0") | | 34 | .if defined(PKGREVISION) && !empty(PKGREVISION) && (${PKGREVISION} != "0") |
35 | . if defined(PKGNAME) | | 35 | . if defined(PKGNAME) |
36 | PKGNAME_NOREV:= ${PKGNAME} | | 36 | PKGNAME_NOREV:= ${PKGNAME} |
37 | PKGNAME:= ${PKGNAME}nb${PKGREVISION} | | 37 | PKGNAME:= ${PKGNAME}nb${PKGREVISION} |
38 | . else | | 38 | . else |
39 | PKGNAME?= ${DISTNAME}nb${PKGREVISION} | | 39 | PKGNAME?= ${DISTNAME}nb${PKGREVISION} |
40 | PKGNAME_NOREV= ${DISTNAME} | | 40 | PKGNAME_NOREV= ${DISTNAME} |
41 | . endif | | 41 | . endif |
42 | .else | | 42 | .else |
43 | PKGNAME?= ${DISTNAME} | | 43 | PKGNAME?= ${DISTNAME} |
44 | PKGNAME_NOREV= ${PKGNAME} | | 44 | PKGNAME_NOREV= ${PKGNAME} |
45 | .endif | | 45 | .endif |
46 | PKGVERSION_NOREV= ${PKGNAME_NOREV:C/^.*-//} | | 46 | PKGVERSION_NOREV= ${PKGNAME_NOREV:C/^.*-//} |
47 | | | 47 | |
48 | _VARGROUPS+= pkgname | | 48 | _VARGROUPS+= pkgname |
49 | _DEF_VARS.pkgname= PKGBASE PKGVERSION PKGNAME_NOREV PKGNAME PKGVERSION_NOREV | | 49 | _DEF_VARS.pkgname= PKGBASE PKGVERSION PKGNAME_NOREV PKGNAME PKGVERSION_NOREV |
50 | | | 50 | |
51 | # Fail-safe in the case of circular dependencies | | 51 | # Fail-safe in the case of circular dependencies |
52 | .if defined(_PKGSRC_DEPS) && defined(PKGNAME) && !empty(_PKGSRC_DEPS:M${PKGNAME}) | | 52 | .if defined(_PKGSRC_DEPS) && defined(PKGNAME) && !empty(_PKGSRC_DEPS:M${PKGNAME}) |
53 | PKG_FAIL_REASON+= "Circular dependency detected" | | 53 | PKG_FAIL_REASON+= "Circular dependency detected" |
54 | .endif | | 54 | .endif |
55 | | | 55 | |
56 | #### | | 56 | #### |
57 | | | 57 | |
58 | ############################################################################ | | 58 | ############################################################################ |
59 | # Allow various phases to define the default variables | | 59 | # Allow various phases to define the default variables |
60 | ############################################################################ | | 60 | ############################################################################ |
61 | .if defined(EMUL_PLATFORMS) && !empty(EMUL_PLATFORMS) | | 61 | .if defined(EMUL_PLATFORMS) && !empty(EMUL_PLATFORMS) |
62 | . include "emulator/emulator.mk" | | 62 | . include "emulator/emulator.mk" |
63 | .endif | | 63 | .endif |
64 | | | 64 | |
65 | .include "features/features.mk" | | 65 | .include "features/features.mk" |
66 | | | 66 | |
67 | .include "pkgformat/bsd.pkgformat-vars.mk" | | 67 | .include "pkgformat/bsd.pkgformat-vars.mk" |
68 | .include "check/bsd.check-vars.mk" | | 68 | .include "check/bsd.check-vars.mk" |
69 | .include "depends/bsd.depends-vars.mk" | | 69 | .include "depends/bsd.depends-vars.mk" |
70 | .include "fetch/bsd.fetch-vars.mk" | | 70 | .include "fetch/bsd.fetch-vars.mk" |
71 | .include "checksum/bsd.checksum-vars.mk" | | 71 | .include "checksum/bsd.checksum-vars.mk" |
72 | .include "extract/bsd.extract-vars.mk" | | 72 | .include "extract/bsd.extract-vars.mk" |
73 | .include "patch/bsd.patch-vars.mk" | | 73 | .include "patch/bsd.patch-vars.mk" |
74 | .include "configure/bsd.configure-vars.mk" | | 74 | .include "configure/bsd.configure-vars.mk" |
75 | .include "build/bsd.build-vars.mk" | | 75 | .include "build/bsd.build-vars.mk" |
76 | .include "install/bsd.install-vars.mk" | | 76 | .include "install/bsd.install-vars.mk" |
77 | | | 77 | |
78 | .include "bsd.pkg.error.mk" | | 78 | .include "bsd.pkg.error.mk" |
79 | | | 79 | |
80 | .include "bsd.hacks.mk" | | 80 | .include "bsd.hacks.mk" |
81 | | | 81 | |
82 | ############################################################################ | | 82 | ############################################################################ |
83 | # Transform package Makefile variables and set defaults | | 83 | # Transform package Makefile variables and set defaults |
84 | ############################################################################ | | 84 | ############################################################################ |
85 | | | 85 | |
86 | ##### Others | | 86 | ##### Others |
87 | | | 87 | |
88 | BUILD_DEPENDS?= # empty | | 88 | BUILD_DEPENDS?= # empty |
89 | COMMENT?= (no description) | | 89 | COMMENT?= (no description) |
90 | DEPENDS?= # empty | | 90 | DEPENDS?= # empty |
91 | DESCR_SRC?= ${PKGDIR}/DESCR | | 91 | DESCR_SRC?= ${PKGDIR}/DESCR |
92 | INTERACTIVE_STAGE?= none | | 92 | INTERACTIVE_STAGE?= none |
93 | .if defined(OWNER) | | 93 | .if defined(OWNER) |
94 | MAINTAINER= ${OWNER} | | 94 | MAINTAINER= ${OWNER} |
95 | .else | | 95 | .else |
96 | MAINTAINER?= pkgsrc-users@NetBSD.org | | 96 | MAINTAINER?= pkgsrc-users@NetBSD.org |
97 | .endif | | 97 | .endif |
98 | PKGWILDCARD?= ${PKGBASE}-[0-9]* | | 98 | PKGWILDCARD?= ${PKGBASE}-[0-9]* |
99 | TEST_DEPENDS?= # empty | | 99 | TEST_DEPENDS?= # empty |
100 | TOOL_DEPENDS?= # empty | | 100 | TOOL_DEPENDS?= # empty |
101 | .if defined(GITHUB_TAG) | | 101 | .if defined(GITHUB_TAG) |
102 | WRKSRC?= ${WRKDIR}/${GITHUB_PROJECT}-${GITHUB_TAG:C/^v//} | | 102 | WRKSRC?= ${WRKDIR}/${GITHUB_PROJECT}-${GITHUB_TAG:C/^v//} |
103 | .else | | 103 | .else |
104 | WRKSRC?= ${WRKDIR}/${DISTNAME:U${PKGNAME_NOREV}} | | 104 | WRKSRC?= ${WRKDIR}/${DISTNAME:U${PKGNAME_NOREV}} |
105 | .endif | | 105 | .endif |
106 | | | 106 | |
107 | # Override for SU_CMD user check | | 107 | # Override for SU_CMD user check |
108 | _IS_ROOT_CMD?= ${TEST} `${ID} -u` = `${ID} -u ${_SU_ROOT_USER}` | | 108 | _IS_ROOT_CMD?= ${TEST} `${ID} -u` = `${ID} -u ${_SU_ROOT_USER}` |
109 | _SU_ROOT_USER?= ${ROOT_USER} | | 109 | _SU_ROOT_USER?= ${ROOT_USER} |
110 | REAL_ROOT_USER?= ${ROOT_USER} | | 110 | REAL_ROOT_USER?= ${ROOT_USER} |
111 | REAL_ROOT_GROUP?= ${ROOT_GROUP} | | 111 | REAL_ROOT_GROUP?= ${ROOT_GROUP} |
112 | | | 112 | |
113 | .if (defined(INSTALL_UNSTRIPPED) && !empty(INSTALL_UNSTRIPPED:M[yY][eE][sS])) | | 113 | .if (defined(INSTALL_UNSTRIPPED) && !empty(INSTALL_UNSTRIPPED:M[yY][eE][sS])) |
114 | _INSTALL_UNSTRIPPED= # set (flag used by platform/*.mk) | | 114 | _INSTALL_UNSTRIPPED= # set (flag used by platform/*.mk) |
115 | .endif | | 115 | .endif |
116 | | | 116 | |
117 | ##### Transform USE_* into dependencies | | 117 | ##### Transform USE_* into dependencies |
118 | | | 118 | |
119 | .include "bsd.pkg.use.mk" | | 119 | .include "bsd.pkg.use.mk" |
120 | | | 120 | |
121 | ############################################################################ | | 121 | ############################################################################ |
122 | # Sanity checks | | 122 | # Sanity checks |
123 | ############################################################################ | | 123 | ############################################################################ |
124 | | | 124 | |
125 | .if defined(BUILDLINK_DEPTH) || defined(BUILDLINK_PACKAGES) || \ | | 125 | .if defined(BUILDLINK_DEPTH) || defined(BUILDLINK_PACKAGES) || \ |
126 | defined(BUILDLINK_DEPENDS) || defined(BUILDLINK_ORDER) | | 126 | defined(BUILDLINK_DEPENDS) || defined(BUILDLINK_ORDER) |
127 | PKG_FAIL_REASON+= "Out-dated buildlink3.mk detected, please update" | | 127 | PKG_FAIL_REASON+= "Out-dated buildlink3.mk detected, please update" |
128 | .endif | | 128 | .endif |
129 | | | 129 | |
130 | .if !defined(CATEGORIES) | | 130 | .if !defined(CATEGORIES) |
131 | PKG_FAIL_REASON+= 'CATEGORIES are mandatory.' | | 131 | PKG_FAIL_REASON+= 'CATEGORIES are mandatory.' |
132 | .endif | | 132 | .endif |
133 | | | 133 | |
134 | .if !defined(PKGNAME) && !defined(DISTNAME) | | 134 | .if !defined(PKGNAME) && !defined(DISTNAME) |
135 | PKG_FAIL_REASON+= 'PKGNAME and/or DISTNAME are mandatory.' | | 135 | PKG_FAIL_REASON+= 'PKGNAME and/or DISTNAME are mandatory.' |
136 | .endif | | 136 | .endif |
137 | | | 137 | |
138 | .if defined(PKG_PATH) | | 138 | .if defined(PKG_PATH) |
139 | PKG_FAIL_REASON+= 'Please unset PKG_PATH before doing pkgsrc work!' | | 139 | PKG_FAIL_REASON+= 'Please unset PKG_PATH before doing pkgsrc work!' |
140 | .endif | | 140 | .endif |
141 | | | 141 | |
142 | # Allow variables to be set on a per-OS basis | | 142 | # Allow variables to be set on a per-OS basis |
143 | OPSYSVARS+= CFLAGS CXXFLAGS CPPFLAGS LDFLAGS LIBS | | 143 | OPSYSVARS+= CFLAGS CXXFLAGS CPPFLAGS LDFLAGS LIBS |
144 | OPSYSVARS+= CMAKE_ARGS CONFIGURE_ARGS CONFIGURE_ENV | | 144 | OPSYSVARS+= CMAKE_ARGS CONFIGURE_ARGS CONFIGURE_ENV |
145 | OPSYSVARS+= BUILDLINK_TRANSFORM SUBST_CLASSES | | 145 | OPSYSVARS+= BUILDLINK_TRANSFORM SUBST_CLASSES |
146 | OPSYSVARS+= BUILD_TARGET MAKE_ENV MAKE_FLAGS USE_TOOLS | | 146 | OPSYSVARS+= BUILD_TARGET MAKE_ENV MAKE_FLAGS USE_TOOLS |
147 | .for _var_ in ${OPSYSVARS:O} | | 147 | .for _var_ in ${OPSYSVARS:O} |
148 | . if defined(${_var_}.${OPSYS}) | | 148 | . if defined(${_var_}.${OPSYS}) |
149 | ${_var_}+= ${${_var_}.${OPSYS}} | | 149 | ${_var_}+= ${${_var_}.${OPSYS}} |
150 | . elif defined(${_var_}.*) | | 150 | . elif defined(${_var_}.*) |
151 | ${_var_}+= ${${_var_}.*} | | 151 | ${_var_}+= ${${_var_}.*} |
152 | . endif | | 152 | . endif |
153 | .endfor | | 153 | .endfor |
154 | | | 154 | |
155 | CPPFLAGS+= ${CPP_PRECOMP_FLAGS} | | 155 | CPPFLAGS+= ${CPP_PRECOMP_FLAGS} |
156 | | | 156 | |
157 | # To sanitize the environment, set PKGSRC_SETENV=${SETENV} -i. | | 157 | # To sanitize the environment, set PKGSRC_SETENV=${SETENV} -i. |
158 | # This will however cause build failures (e.g. "www/firefox"). Settings | | 158 | # This will however cause build failures (e.g. "www/firefox"). Settings |
159 | # like "ALLOW_VULNERABLE_PACKAGES" will also not be correctly passed | | 159 | # like "ALLOW_VULNERABLE_PACKAGES" will also not be correctly passed |
160 | # to dependence builds. | | 160 | # to dependence builds. |
161 | PKGSRC_SETENV?= ${SETENV} | | 161 | PKGSRC_SETENV?= ${SETENV} |
162 | | | 162 | |
163 | ALL_ENV+= CC=${CC:Q} | | 163 | ALL_ENV+= CC=${CC:Q} |
164 | ALL_ENV+= CFLAGS=${CFLAGS:M*:Q} | | 164 | ALL_ENV+= CFLAGS=${CFLAGS:M*:Q} |
165 | ALL_ENV+= CPPFLAGS=${CPPFLAGS:M*:Q} | | 165 | ALL_ENV+= CPPFLAGS=${CPPFLAGS:M*:Q} |
166 | ALL_ENV+= CXX=${CXX:Q} | | 166 | ALL_ENV+= CXX=${CXX:Q} |
167 | ALL_ENV+= CXXFLAGS=${CXXFLAGS:M*:Q} | | 167 | ALL_ENV+= CXXFLAGS=${CXXFLAGS:M*:Q} |
168 | ALL_ENV+= COMPILER_RPATH_FLAG=${COMPILER_RPATH_FLAG:Q} | | 168 | ALL_ENV+= COMPILER_RPATH_FLAG=${COMPILER_RPATH_FLAG:Q} |
169 | ALL_ENV+= F77=${FC:Q} | | 169 | ALL_ENV+= F77=${FC:Q} |
170 | ALL_ENV+= FC=${FC:Q} | | 170 | ALL_ENV+= FC=${FC:Q} |
171 | ALL_ENV+= FFLAGS=${FFLAGS:M*:Q} | | 171 | ALL_ENV+= FFLAGS=${FFLAGS:M*:Q} |
172 | ALL_ENV+= LANG=C | | 172 | ALL_ENV+= LANG=C |
173 | ALL_ENV+= LC_ALL=C | | 173 | ALL_ENV+= LC_ALL=C |
174 | ALL_ENV+= LC_COLLATE=C | | 174 | ALL_ENV+= LC_COLLATE=C |
175 | ALL_ENV+= LC_CTYPE=C | | 175 | ALL_ENV+= LC_CTYPE=C |
176 | ALL_ENV+= LC_MESSAGES=C | | 176 | ALL_ENV+= LC_MESSAGES=C |
177 | ALL_ENV+= LC_MONETARY=C | | 177 | ALL_ENV+= LC_MONETARY=C |
178 | ALL_ENV+= LC_NUMERIC=C | | 178 | ALL_ENV+= LC_NUMERIC=C |
179 | ALL_ENV+= LC_TIME=C | | 179 | ALL_ENV+= LC_TIME=C |
180 | ALL_ENV+= LDFLAGS=${LDFLAGS:M*:Q} | | 180 | ALL_ENV+= LDFLAGS=${LDFLAGS:M*:Q} |
181 | ALL_ENV+= LINKER_RPATH_FLAG=${LINKER_RPATH_FLAG:Q} | | 181 | ALL_ENV+= LINKER_RPATH_FLAG=${LINKER_RPATH_FLAG:Q} |
182 | ALL_ENV+= PATH=${PATH:Q}:${LOCALBASE}/bin:${X11BASE}/bin | | 182 | ALL_ENV+= PATH=${PATH:Q}:${LOCALBASE}/bin:${X11BASE}/bin |
183 | ALL_ENV+= PREFIX=${PREFIX} | | 183 | ALL_ENV+= PREFIX=${PREFIX} |
184 | ALL_ENV+= MAKELEVEL=0 | | 184 | ALL_ENV+= MAKELEVEL=0 |
185 | ALL_ENV+= CONFIG_SITE=${PKGSRC_CONFIG_SITE:U} | | 185 | ALL_ENV+= CONFIG_SITE=${PKGSRC_CONFIG_SITE:U} |
186 | | | 186 | |
187 | # This variable can be added to MAKE_ENV to ease installation of packages | | 187 | # This variable can be added to MAKE_ENV to ease installation of packages |
188 | # that use BSD-style Makefiles. | | 188 | # that use BSD-style Makefiles. |
189 | BSD_MAKE_ENV= BINOWN=${BINOWN} BINGRP=${BINGRP} | | 189 | BSD_MAKE_ENV= BINOWN=${BINOWN} BINGRP=${BINGRP} |
190 | BSD_MAKE_ENV+= GAMEOWN=${GAMEOWN} GAMEGRP=${GAMEGRP} | | 190 | BSD_MAKE_ENV+= GAMEOWN=${GAMEOWN} GAMEGRP=${GAMEGRP} |
191 | BSD_MAKE_ENV+= MANOWN=${MANOWN} MANGRP=${MANGRP} | | 191 | BSD_MAKE_ENV+= MANOWN=${MANOWN} MANGRP=${MANGRP} |
192 | BSD_MAKE_ENV+= SHAREOWN=${SHAREOWN} SHAREGRP=${SHAREGRP} | | 192 | BSD_MAKE_ENV+= SHAREOWN=${SHAREOWN} SHAREGRP=${SHAREGRP} |
193 | BSD_MAKE_ENV+= DOCOWN=${DOCOWN} DOCGRP=${DOCGRP} | | 193 | BSD_MAKE_ENV+= DOCOWN=${DOCOWN} DOCGRP=${DOCGRP} |
194 | BSD_MAKE_ENV+= BINMODE=${BINMODE} NONBINMODE=${NONBINMODE} | | 194 | BSD_MAKE_ENV+= BINMODE=${BINMODE} NONBINMODE=${NONBINMODE} |
195 | BSD_MAKE_ENV+= BINDIR=${PREFIX}/bin | | 195 | BSD_MAKE_ENV+= BINDIR=${PREFIX}/bin |
196 | BSD_MAKE_ENV+= INCSDIR=${PREFIX}/include | | 196 | BSD_MAKE_ENV+= INCSDIR=${PREFIX}/include |
197 | BSD_MAKE_ENV+= LIBDIR=${PREFIX}/lib | | 197 | BSD_MAKE_ENV+= LIBDIR=${PREFIX}/lib |
198 | BSD_MAKE_ENV+= MANDIR=${PREFIX}/${PKGMANDIR} | | 198 | BSD_MAKE_ENV+= MANDIR=${PREFIX}/${PKGMANDIR} |
199 | BSD_MAKE_ENV+= STRIPFLAG=${_STRIPFLAG_INSTALL:Q} | | 199 | BSD_MAKE_ENV+= STRIPFLAG=${_STRIPFLAG_INSTALL:Q} |
200 | BSD_MAKE_ENV+= MANINSTALL=${MANINSTALL:Q} | | 200 | BSD_MAKE_ENV+= MANINSTALL=${MANINSTALL:Q} |
201 | BSD_MAKE_ENV+= MKCATPAGES=${MKCATPAGES:Q} | | 201 | BSD_MAKE_ENV+= MKCATPAGES=${MKCATPAGES:Q} |
202 | BSD_MAKE_ENV+= MKHTML=no | | 202 | BSD_MAKE_ENV+= MKHTML=no |
203 | | | 203 | |
204 | _BUILD_DEFS= ${BUILD_DEFS} | | 204 | _BUILD_DEFS= ${BUILD_DEFS} |
205 | _BUILD_DEFS+= LOCALBASE | | 205 | _BUILD_DEFS+= LOCALBASE |
206 | _BUILD_DEFS+= PKGGNUDIR | | 206 | _BUILD_DEFS+= PKGGNUDIR |
207 | _BUILD_DEFS+= PKGINFODIR | | 207 | _BUILD_DEFS+= PKGINFODIR |
208 | _BUILD_DEFS+= PKGMANDIR | | 208 | _BUILD_DEFS+= PKGMANDIR |
209 | _BUILD_DEFS+= _USE_DESTDIR | | 209 | _BUILD_DEFS+= _USE_DESTDIR |
210 | | | 210 | |
211 | # Store the result in the +BUILD_INFO file so mk/pkg-build-options.mk | | 211 | # Store the result in the +BUILD_INFO file so mk/pkg-build-options.mk |
212 | # can query for the build options using "pkg_info -Q PKG_OPTIONS <pkg>". | | 212 | # can query for the build options using "pkg_info -Q PKG_OPTIONS <pkg>". |
213 | # | | 213 | # |
214 | .if defined(PKG_SUPPORTED_OPTIONS) && defined(PKG_OPTIONS) | | 214 | .if defined(PKG_SUPPORTED_OPTIONS) && defined(PKG_OPTIONS) |
215 | _BUILD_DEFS+= PKG_OPTIONS | | 215 | _BUILD_DEFS+= PKG_OPTIONS |
216 | .endif | | 216 | .endif |
217 | | | 217 | |
218 | # Store the build options for multi-packages, i.e. packages that can | | 218 | # Store the build options for multi-packages, i.e. packages that can |
219 | # be built with multiple versions of Apache, Python, Ruby, PHP etc. | | 219 | # be built with multiple versions of Apache, Python, Ruby, PHP etc. |
220 | # | | 220 | # |
221 | .if defined(MULTI) | | 221 | .if defined(MULTI) |
222 | _BUILD_DEFS+= MULTI | | 222 | _BUILD_DEFS+= MULTI |
223 | .endif | | 223 | .endif |
224 | | | 224 | |
225 | # _ZERO_FILESIZE_P exits with a successful return code if the given file | | 225 | # _ZERO_FILESIZE_P exits with a successful return code if the given file |
226 | # has zero length. | | 226 | # has zero length. |
227 | # _NONZERO_FILESIZE_P exits with a successful return code if the given file | | 227 | # _NONZERO_FILESIZE_P exits with a successful return code if the given file |
228 | # has nonzero length. | | 228 | # has nonzero length. |
229 | # | | 229 | # |
230 | _ZERO_FILESIZE_P= ${AWK} 'END { exit (NR > 0) ? 1 : 0; }' | | 230 | _ZERO_FILESIZE_P= ${AWK} 'END { exit (NR > 0) ? 1 : 0; }' |
231 | _NONZERO_FILESIZE_P= ${AWK} 'END { exit (NR > 0) ? 0 : 1; }' | | 231 | _NONZERO_FILESIZE_P= ${AWK} 'END { exit (NR > 0) ? 0 : 1; }' |
232 | | | 232 | |
233 | # Automatically increase process limit where necessary for building. | | 233 | # Automatically increase process limit where necessary for building. |
234 | _ULIMIT_CMD= ${UNLIMIT_RESOURCES:@_lim_@${ULIMIT_CMD_${_lim_}:U\:};@} | | 234 | _ULIMIT_CMD= ${UNLIMIT_RESOURCES:@_lim_@${ULIMIT_CMD_${_lim_}:U\:};@} |
235 | | | 235 | |
236 | _NULL_COOKIE= ${WRKDIR}/.null | | 236 | _NULL_COOKIE= ${WRKDIR}/.null |
237 | | | 237 | |
238 | # Miscellaneous overridable commands: | | 238 | # Miscellaneous overridable commands: |
239 | SHCOMMENT?= ${ECHO_MSG} >/dev/null '***' | | 239 | SHCOMMENT?= ${ECHO_MSG} >/dev/null '***' |
240 | | | 240 | |
241 | LIBABISUFFIX?= | | 241 | LIBABISUFFIX?= |
242 | | | 242 | |
243 | TOUCH_FLAGS?= -f | | 243 | TOUCH_FLAGS?= -f |
244 | | | 244 | |
245 | # A few aliases for *-install targets | | 245 | # A few aliases for *-install targets |
246 | INSTALL= ${TOOLS_INSTALL} # XXX override sys.mk | | 246 | INSTALL= ${TOOLS_INSTALL} # XXX override sys.mk |
247 | INSTALL_PROGRAM?= \ | | 247 | INSTALL_PROGRAM?= \ |
248 | ${INSTALL} ${COPY} ${_STRIPFLAG_INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} | | 248 | ${INSTALL} ${COPY} ${_STRIPFLAG_INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} |
249 | INSTALL_GAME?= \ | | 249 | INSTALL_GAME?= \ |
250 | ${INSTALL} ${COPY} ${_STRIPFLAG_INSTALL} -o ${GAMEOWN} -g ${GAMEGRP} -m ${GAMEMODE} | | 250 | ${INSTALL} ${COPY} ${_STRIPFLAG_INSTALL} -o ${GAMEOWN} -g ${GAMEGRP} -m ${GAMEMODE} |
251 | INSTALL_SCRIPT?= \ | | 251 | INSTALL_SCRIPT?= \ |
252 | ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} | | 252 | ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} |
253 | INSTALL_LIB?= \ | | 253 | INSTALL_LIB?= \ |
254 | ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} | | 254 | ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} |
255 | INSTALL_DATA?= \ | | 255 | INSTALL_DATA?= \ |
256 | ${INSTALL} ${COPY} -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE} | | 256 | ${INSTALL} ${COPY} -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE} |
257 | INSTALL_GAME_DATA?= \ | | 257 | INSTALL_GAME_DATA?= \ |
258 | ${INSTALL} ${COPY} -o ${GAMEOWN} -g ${GAMEGRP} -m ${GAMEDATAMODE} | | 258 | ${INSTALL} ${COPY} -o ${GAMEOWN} -g ${GAMEGRP} -m ${GAMEDATAMODE} |
259 | INSTALL_MAN?= \ | | 259 | INSTALL_MAN?= \ |
260 | ${INSTALL} ${COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} | | 260 | ${INSTALL} ${COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} |
261 | INSTALL_PROGRAM_DIR?= \ | | 261 | INSTALL_PROGRAM_DIR?= \ |
262 | ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m ${PKGDIRMODE} | | 262 | ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m ${PKGDIRMODE} |
263 | INSTALL_GAME_DIR?= \ | | 263 | INSTALL_GAME_DIR?= \ |
264 | ${INSTALL} -d -o ${GAMEOWN} -g ${GAMEGRP} -m ${GAMEDIRMODE} | | 264 | ${INSTALL} -d -o ${GAMEOWN} -g ${GAMEGRP} -m ${GAMEDIRMODE} |
265 | INSTALL_SCRIPT_DIR?= \ | | 265 | INSTALL_SCRIPT_DIR?= \ |
266 | ${INSTALL_PROGRAM_DIR} | | 266 | ${INSTALL_PROGRAM_DIR} |
267 | INSTALL_LIB_DIR?= \ | | 267 | INSTALL_LIB_DIR?= \ |
268 | ${INSTALL_PROGRAM_DIR} | | 268 | ${INSTALL_PROGRAM_DIR} |
269 | INSTALL_DATA_DIR?= \ | | 269 | INSTALL_DATA_DIR?= \ |
270 | ${INSTALL} -d -o ${SHAREOWN} -g ${SHAREGRP} -m ${PKGDIRMODE} | | 270 | ${INSTALL} -d -o ${SHAREOWN} -g ${SHAREGRP} -m ${PKGDIRMODE} |
271 | INSTALL_MAN_DIR?= \ | | 271 | INSTALL_MAN_DIR?= \ |
272 | ${INSTALL} -d -o ${MANOWN} -g ${MANGRP} -m ${PKGDIRMODE} | | 272 | ${INSTALL} -d -o ${MANOWN} -g ${MANGRP} -m ${PKGDIRMODE} |
273 | | | 273 | |
274 | INSTALL_MACROS= BSD_INSTALL_PROGRAM=${INSTALL_PROGRAM:Q} \ | | 274 | INSTALL_MACROS= BSD_INSTALL_PROGRAM=${INSTALL_PROGRAM:Q} \ |
275 | BSD_INSTALL_SCRIPT=${INSTALL_SCRIPT:Q} \ | | 275 | BSD_INSTALL_SCRIPT=${INSTALL_SCRIPT:Q} \ |
276 | BSD_INSTALL_LIB=${INSTALL_LIB:Q} \ | | 276 | BSD_INSTALL_LIB=${INSTALL_LIB:Q} \ |
277 | BSD_INSTALL_DATA=${INSTALL_DATA:Q} \ | | 277 | BSD_INSTALL_DATA=${INSTALL_DATA:Q} \ |
278 | BSD_INSTALL_MAN=${INSTALL_MAN:Q} \ | | 278 | BSD_INSTALL_MAN=${INSTALL_MAN:Q} \ |
279 | BSD_INSTALL=${INSTALL:Q} \ | | 279 | BSD_INSTALL=${INSTALL:Q} \ |
280 | BSD_INSTALL_PROGRAM_DIR=${INSTALL_PROGRAM_DIR:Q} \ | | 280 | BSD_INSTALL_PROGRAM_DIR=${INSTALL_PROGRAM_DIR:Q} \ |
281 | BSD_INSTALL_SCRIPT_DIR=${INSTALL_SCRIPT_DIR:Q} \ | | 281 | BSD_INSTALL_SCRIPT_DIR=${INSTALL_SCRIPT_DIR:Q} \ |
282 | BSD_INSTALL_LIB_DIR=${INSTALL_LIB_DIR:Q} \ | | 282 | BSD_INSTALL_LIB_DIR=${INSTALL_LIB_DIR:Q} \ |
283 | BSD_INSTALL_DATA_DIR=${INSTALL_DATA_DIR:Q} \ | | 283 | BSD_INSTALL_DATA_DIR=${INSTALL_DATA_DIR:Q} \ |
284 | BSD_INSTALL_MAN_DIR=${INSTALL_MAN_DIR:Q} \ | | 284 | BSD_INSTALL_MAN_DIR=${INSTALL_MAN_DIR:Q} \ |
285 | BSD_INSTALL_GAME=${INSTALL_GAME:Q} \ | | 285 | BSD_INSTALL_GAME=${INSTALL_GAME:Q} \ |
286 | BSD_INSTALL_GAME_DATA=${INSTALL_GAME_DATA:Q} \ | | 286 | BSD_INSTALL_GAME_DATA=${INSTALL_GAME_DATA:Q} \ |
287 | BSD_INSTALL_GAME_DIR=${INSTALL_GAME_DIR:Q} | | 287 | BSD_INSTALL_GAME_DIR=${INSTALL_GAME_DIR:Q} |
288 | MAKE_ENV+= ${INSTALL_MACROS:M*} | | 288 | MAKE_ENV+= ${INSTALL_MACROS:M*} |
289 | SCRIPTS_ENV+= ${INSTALL_MACROS:M*} | | 289 | SCRIPTS_ENV+= ${INSTALL_MACROS:M*} |
290 | | | 290 | |
291 | # If pkgsrc is supposed to ensure that tests are run before installation | | 291 | # If pkgsrc is supposed to ensure that tests are run before installation |
292 | # of the package, then the build targets should be "build test", otherwise | | 292 | # of the package, then the build targets should be "build test", otherwise |
293 | # just "build" suffices. | | 293 | # just "build" suffices. |
294 | # | | 294 | # |
295 | .if !empty(PKGSRC_RUN_TEST:M[yY][eE][sS]) | | 295 | .if !empty(PKGSRC_RUN_TEST:M[yY][eE][sS]) |
296 | _PKGSRC_BUILD_TARGETS= build test | | 296 | _PKGSRC_BUILD_TARGETS= build test |
297 | .else | | 297 | .else |
298 | _PKGSRC_BUILD_TARGETS= build | | 298 | _PKGSRC_BUILD_TARGETS= build |
299 | .endif | | 299 | .endif |
300 | | | 300 | |
301 | # OVERRIDE_DIRDEPTH represents the common directory depth under | | 301 | # OVERRIDE_DIRDEPTH represents the common directory depth under |
302 | # ${WRKSRC} up to which we find the files that need to be | | 302 | # ${WRKSRC} up to which we find the files that need to be |
303 | # overridden. By default, we search two levels down, i.e., | | 303 | # overridden. By default, we search two levels down, i.e., |
304 | # */*/file. | | 304 | # */*/file. |
305 | # | | 305 | # |
306 | OVERRIDE_DIRDEPTH?= 2 | | 306 | OVERRIDE_DIRDEPTH?= 2 |
307 | | | 307 | |
308 | # Handle alternatives | | 308 | # Handle alternatives |
309 | # | | 309 | # |
310 | .include "alternatives.mk" | | 310 | .include "alternatives.mk" |
311 | | | 311 | |
312 | # Handle alternative init systems | | 312 | # Handle alternative init systems |
313 | # | | 313 | # |
314 | .if ${_USE_NEW_PKGINSTALL:Uno} == "no" | | 314 | .if ${_USE_NEW_PKGINSTALL:Uno} == "no" |
315 | .if ${INIT_SYSTEM} == "smf" | | 315 | .if ${INIT_SYSTEM} == "smf" |
316 | . include "smf.mk" | | 316 | . include "smf.mk" |
317 | .endif | | 317 | .endif |
318 | .endif | | 318 | .endif |
319 | | | 319 | |
320 | # Handle Reproducible Builds | | 320 | # Handle Reproducible Builds |
321 | # | | 321 | # |
322 | .include "repro/repro.mk" | | 322 | .include "repro/repro.mk" |
323 | | | 323 | |
324 | # Define SMART_MESSAGES in /etc/mk.conf for messages giving the tree | | 324 | # Define SMART_MESSAGES in /etc/mk.conf for messages giving the tree |
325 | # of dependencies for building, and the current target. | | 325 | # of dependencies for building, and the current target. |
326 | _PKGSRC_IN?= ===${SMART_MESSAGES:D> ${.TARGET} [${PKGNAME}${_PKGSRC_DEPS}] ===} | | 326 | _PKGSRC_IN?= ===${SMART_MESSAGES:D> ${.TARGET} [${PKGNAME}${_PKGSRC_DEPS}] ===} |
327 | | | 327 | |
328 | # Used to print all the '===>' style prompts - override this to turn them off. | | 328 | # Used to print all the '===>' style prompts - override this to turn them off. |
329 | ECHO_MSG?= ${ECHO} | | 329 | ECHO_MSG?= ${ECHO} |
330 | PHASE_MSG?= ${ECHO_MSG} ${_PKGSRC_IN:Q}\> | | 330 | PHASE_MSG?= ${ECHO_MSG} ${_PKGSRC_IN:Q}\> |
331 | STEP_MSG?= ${ECHO_MSG} "=>" | | 331 | STEP_MSG?= ${ECHO_MSG} "=>" |
332 | INFO_MSG?= ${ECHO_MSG} "INFO:" | | 332 | INFO_MSG?= ${ECHO_MSG} "INFO:" |
333 | WARNING_MSG?= ${ECHO_MSG} 1>&2 "WARNING:" | | 333 | WARNING_MSG?= ${ECHO_MSG} 1>&2 "WARNING:" |
334 | ERROR_MSG?= ${ECHO_MSG} 1>&2 "ERROR:" | | 334 | ERROR_MSG?= ${ECHO_MSG} 1>&2 "ERROR:" |
335 | FAIL_MSG?= ${FAIL} ${ERROR_MSG} | | 335 | FAIL_MSG?= ${FAIL} ${ERROR_MSG} |
336 | | | 336 | |
337 | WARNING_CAT?= ${SED} -e "s|^|WARNING: |" 1>&2 | | 337 | WARNING_CAT?= ${SED} -e "s|^|WARNING: |" 1>&2 |
338 | ERROR_CAT?= ${SED} -e "s|^|ERROR: |" 1>&2 | | 338 | ERROR_CAT?= ${SED} -e "s|^|ERROR: |" 1>&2 |
339 | | | 339 | |
340 | # How to do nothing. Override if you, for some strange reason, would rather | | 340 | # How to do nothing. Override if you, for some strange reason, would rather |
341 | # do something. | | 341 | # do something. |
342 | DO_NADA?= | | 342 | DO_NADA?= |
343 | | | 343 | |
344 | # the FAIL command executes its arguments and then exits with a non-zero | | 344 | # the FAIL command executes its arguments and then exits with a non-zero |
345 | # status. | | 345 | # status. |
346 | # Example: ${FAIL} ${ERROR_MSG} "This is unexpected." | | 346 | # Example: ${FAIL} ${ERROR_MSG} "This is unexpected." |
347 | FAIL?= ${SH} ${PKGSRCDIR}/mk/scripts/fail | | 347 | FAIL?= ${SH} ${PKGSRCDIR}/mk/scripts/fail |
348 | | | 348 | |
349 | # | | 349 | # |
350 | # Config file related settings - see doc/pkgsrc.txt | | 350 | # Config file related settings - see doc/pkgsrc.txt |
351 | # | | 351 | # |
352 | PKG_SYSCONFVAR?= ${PKGBASE} | | 352 | PKG_SYSCONFVAR?= ${PKGBASE} |
353 | PKG_SYSCONFSUBDIR?= # empty | | 353 | PKG_SYSCONFSUBDIR?= # empty |
354 | PKG_SYSCONFBASEDIR= ${PKG_SYSCONFBASE} | | 354 | PKG_SYSCONFBASEDIR= ${PKG_SYSCONFBASE} |
355 | .if empty(PKG_SYSCONFSUBDIR) | | 355 | .if empty(PKG_SYSCONFSUBDIR) |
356 | DFLT_PKG_SYSCONFDIR:= ${PKG_SYSCONFBASEDIR} | | 356 | DFLT_PKG_SYSCONFDIR:= ${PKG_SYSCONFBASEDIR} |
357 | .else | | 357 | .else |
358 | DFLT_PKG_SYSCONFDIR:= ${PKG_SYSCONFBASEDIR}/${PKG_SYSCONFSUBDIR} | | 358 | DFLT_PKG_SYSCONFDIR:= ${PKG_SYSCONFBASEDIR}/${PKG_SYSCONFSUBDIR} |
359 | .endif | | 359 | .endif |
360 | PKG_SYSCONFDIR= ${DFLT_PKG_SYSCONFDIR} | | 360 | PKG_SYSCONFDIR= ${DFLT_PKG_SYSCONFDIR} |
361 | .if defined(PKG_SYSCONFDIR.${PKG_SYSCONFVAR}) | | 361 | .if defined(PKG_SYSCONFDIR.${PKG_SYSCONFVAR}) |
362 | PKG_SYSCONFDIR= ${PKG_SYSCONFDIR.${PKG_SYSCONFVAR}} | | 362 | PKG_SYSCONFDIR= ${PKG_SYSCONFDIR.${PKG_SYSCONFVAR}} |
363 | PKG_SYSCONFBASEDIR= ${PKG_SYSCONFDIR.${PKG_SYSCONFVAR}} | | 363 | PKG_SYSCONFBASEDIR= ${PKG_SYSCONFDIR.${PKG_SYSCONFVAR}} |
364 | .endif | | 364 | .endif |
365 | PKG_SYSCONFDIR_PERMS?= ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 755 | | 365 | PKG_SYSCONFDIR_PERMS?= ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 755 |
366 | | | 366 | |
367 | ALL_ENV+= PKG_SYSCONFDIR=${PKG_SYSCONFDIR:Q} | | 367 | ALL_ENV+= PKG_SYSCONFDIR=${PKG_SYSCONFDIR:Q} |
368 | _BUILD_DEFS+= PKG_SYSCONFBASEDIR PKG_SYSCONFDIR | | 368 | _BUILD_DEFS+= PKG_SYSCONFBASEDIR PKG_SYSCONFDIR |
369 | | | 369 | |
370 | # These are all of the tools use by pkgsrc Makefiles. This should | | 370 | # These are all of the tools use by pkgsrc Makefiles. This should |
371 | # eventually be split up into lists of tools required by different | | 371 | # eventually be split up into lists of tools required by different |
372 | # phases of a pkgsrc build. | | 372 | # phases of a pkgsrc build. |
373 | # | | 373 | # |
374 | USE_TOOLS+= \ | | 374 | USE_TOOLS+= \ |
375 | [ awk basename cat chgrp chmod chown cmp cp cut dirname echo \ | | 375 | [ awk basename cat chgrp chmod chown cmp cp cut dirname echo \ |
376 | egrep env false fgrep find grep head hostname id install ln ls \ | | 376 | egrep env false fgrep find grep head hostname id install ln ls \ |
377 | mkdir mv printf pwd rm rmdir sed sh sort \ | | 377 | mkdir mv printf pwd rm rmdir sed sh sort \ |
378 | tail test touch tr true wc xargs | | 378 | tail test touch tr true wc xargs |
379 | | | 379 | |
380 | # bsd.wrapper.mk | | 380 | # bsd.wrapper.mk |
381 | USE_TOOLS+= expr | | 381 | USE_TOOLS+= expr |
382 | | | 382 | |
383 | .if ${_USE_NEW_PKGINSTALL:Uno} != "no" | | 383 | .if ${_USE_NEW_PKGINSTALL:Uno} != "no" |
384 | # Init services framework | | 384 | # Init services framework |
385 | .include "init/bsd.init.mk" | | 385 | .include "init/bsd.init.mk" |
386 | | | 386 | |
387 | # Package tasks framework | | 387 | # Package tasks framework |
388 | .include "pkgtasks/bsd.pkgtasks.mk" | | 388 | .include "pkgtasks/bsd.pkgtasks.mk" |
389 | .else | | 389 | .else |
390 | # INSTALL/DEINSTALL script framework | | 390 | # INSTALL/DEINSTALL script framework |
391 | .include "pkginstall/bsd.pkginstall.mk" | | 391 | .include "pkginstall/bsd.pkginstall.mk" |
392 | .endif | | 392 | .endif |
393 | | | 393 | |
394 | # Locking | | 394 | # Locking |
395 | .include "misc/locking.mk" | | 395 | .include "misc/locking.mk" |
396 | | | 396 | |
397 | # Tools | | 397 | # Tools |
398 | .include "tools/bsd.tools.mk" | | 398 | .include "tools/bsd.tools.mk" |
399 | | | 399 | |
400 | # Barrier | | 400 | # Barrier |
401 | .include "bsd.pkg.barrier.mk" | | 401 | .include "bsd.pkg.barrier.mk" |
402 | | | 402 | |
403 | # Unprivileged builds | | 403 | # Unprivileged builds |
404 | .include "unprivileged.mk" | | 404 | .include "unprivileged.mk" |
405 | | | 405 | |
406 | # If NO_BUILD is defined, default to not needing a compiler. | | 406 | # If NO_BUILD is defined, default to not needing a compiler. |
407 | .if defined(NO_BUILD) | | 407 | .if defined(NO_BUILD) |
408 | USE_LANGUAGES?= # empty | | 408 | USE_LANGUAGES?= # empty |
409 | .endif | | 409 | .endif |
410 | | | 410 | |
411 | # Get the proper dependencies and set the PATH to use the compiler | | 411 | # Get the proper dependencies and set the PATH to use the compiler |
412 | # named in PKGSRC_COMPILER. | | 412 | # named in PKGSRC_COMPILER. |
413 | # | | 413 | # |
414 | .include "compiler.mk" | | 414 | .include "compiler.mk" |
415 | | | 415 | |
416 | #Fake up a home directory | | 416 | #Fake up a home directory |
417 | WRAPPER_TARGETS+= fake-home | | 417 | WRAPPER_TARGETS+= fake-home |
418 | FAKEHOMEDIR= ${WRKDIR}/.home | | 418 | FAKEHOMEDIR= ${WRKDIR}/.home |
419 | ALL_ENV+= HOME=${FAKEHOMEDIR} | | 419 | ALL_ENV+= HOME=${FAKEHOMEDIR} |
420 | .PHONY: fake-home | | 420 | .PHONY: fake-home |
421 | fake-home: ${FAKEHOMEDIR} | | 421 | fake-home: ${FAKEHOMEDIR} |
422 | ${FAKEHOMEDIR}: | | 422 | ${FAKEHOMEDIR}: |
423 | @${MKDIR} ${.TARGET} | | 423 | @${MKDIR} ${.TARGET} |
424 | | | 424 | |
425 | # Use C-based wrappers or legacy shell versions. | | 425 | # Use C-based wrappers or legacy shell versions. |
426 | .if ${_USE_CWRAPPERS} == "yes" | | 426 | .if ${_USE_CWRAPPERS} == "yes" |
427 | .include "cwrappers.mk" | | 427 | .include "cwrappers.mk" |
428 | .else | | 428 | .else |
429 | .include "wrapper/bsd.wrapper.mk" | | 429 | .include "wrapper/bsd.wrapper.mk" |
430 | .endif | | 430 | .endif |
431 | | | 431 | |
432 | .if defined(ABI_DEPENDS) || defined(BUILD_ABI_DEPENDS) | | 432 | .if defined(ABI_DEPENDS) || defined(BUILD_ABI_DEPENDS) |
433 | . if !empty(USE_ABI_DEPENDS:M[yY][eE][sS]) | | 433 | . if !empty(USE_ABI_DEPENDS:M[yY][eE][sS]) |
434 | DEPENDS+= ${ABI_DEPENDS} | | 434 | DEPENDS+= ${ABI_DEPENDS} |
435 | BUILD_DEPENDS+= ${BUILD_ABI_DEPENDS} | | 435 | BUILD_DEPENDS+= ${BUILD_ABI_DEPENDS} |
436 | . else | | 436 | . else |
437 | _BUILD_DEFS+= USE_ABI_DEPENDS | | 437 | _BUILD_DEFS+= USE_ABI_DEPENDS |
438 | . endif | | 438 | . endif |
439 | .endif | | 439 | .endif |
440 | | | 440 | |
441 | .if !defined(_PATH_ORIG) | | 441 | .if !defined(_PATH_ORIG) |
442 | _PATH_ORIG:= ${PATH} | | 442 | _PATH_ORIG:= ${PATH} |
443 | MAKEFLAGS+= _PATH_ORIG=${_PATH_ORIG:Q} | | 443 | MAKEFLAGS+= _PATH_ORIG=${_PATH_ORIG:Q} |
444 | .endif | | 444 | .endif |
445 | | | 445 | |
446 | _PATH_COMPONENTS= \ | | 446 | _PATH_COMPONENTS= \ |
447 | ${PREPEND_PATH:[-1..1]} \ | | 447 | ${PREPEND_PATH:[-1..1]} \ |
448 | ${_PATH_ORIG:S, ,__space_in_path__,gW:S,:, ,g} | | 448 | ${_PATH_ORIG:S, ,__space_in_path__,gW:S,:, ,g} |
449 | PATH= ${_PATH_COMPONENTS:ts::S,__space_in_path__, ,g} | | 449 | PATH= ${_PATH_COMPONENTS:ts::S,__space_in_path__, ,g} |
450 | | | 450 | |
451 | ################################################################ | | 451 | ################################################################ |
452 | # Many ways to disable a package. | | 452 | # Many ways to disable a package. |
453 | # | | 453 | # |
454 | # Ignore packages that can't be resold if building for a CDROM. | | 454 | # Ignore packages that can't be resold if building for a CDROM. |
455 | # | | 455 | # |
456 | # Don't build a package if it's restricted and we don't want to | | 456 | # Don't build a package if it's restricted and we don't want to |
457 | # get into that. | | 457 | # get into that. |
458 | # | | 458 | # |
459 | # Don't attempt to build packages against X if we don't have X. | | 459 | # Don't attempt to build packages against X if we don't have X. |
460 | # | | 460 | # |
461 | # Don't build a package if it's broken. | | 461 | # Don't build a package if it's broken. |
462 | ################################################################ | | 462 | ################################################################ |
463 | .if ${X11_TYPE} == "xorg" | | 463 | .if ${X11_TYPE} == "xorg" |
464 | PKG_FAIL_REASON+= "Support for X11_TYPE=xorg was removed." | | 464 | PKG_FAIL_REASON+= "Support for X11_TYPE=xorg was removed." |
465 | PKG_FAIL_REASON+= "Please switch to X11_TYPE=modular." | | 465 | PKG_FAIL_REASON+= "Please switch to X11_TYPE=modular." |
466 | X11_TYPE:= native | | 466 | X11_TYPE:= native |
467 | X11BASE:= /usr | | 467 | X11BASE:= /usr |
468 | .endif | | 468 | .endif |
469 | | | 469 | |
470 | .if !defined(NO_SKIP) | | 470 | .if !defined(NO_SKIP) |
471 | . if (defined(NO_BIN_ON_CDROM) && defined(FOR_CDROM)) | | 471 | . if (defined(NO_BIN_ON_CDROM) && defined(FOR_CDROM)) |
472 | PKG_SKIP_REASON+= \ | | 472 | PKG_SKIP_REASON+= \ |
473 | "${PKGNAME} may not be placed in binary form on a CDROM:" \ | | 473 | "${PKGNAME} may not be placed in binary form on a CDROM:" \ |
474 | " "${NO_BIN_ON_CDROM:Q} | | 474 | " "${NO_BIN_ON_CDROM:Q} |
475 | . endif | | 475 | . endif |
476 | . if (defined(NO_SRC_ON_CDROM) && defined(FOR_CDROM)) | | 476 | . if (defined(NO_SRC_ON_CDROM) && defined(FOR_CDROM)) |
477 | PKG_SKIP_REASON+= \ | | 477 | PKG_SKIP_REASON+= \ |
478 | "${PKGNAME} may not be placed in source form on a CDROM:" \ | | 478 | "${PKGNAME} may not be placed in source form on a CDROM:" \ |
479 | " "${NO_SRC_ON_CDROM:Q} | | 479 | " "${NO_SRC_ON_CDROM:Q} |
480 | . endif | | 480 | . endif |
481 | . if (defined(RESTRICTED) && defined(NO_RESTRICTED)) | | 481 | . if (defined(RESTRICTED) && defined(NO_RESTRICTED)) |
482 | PKG_SKIP_REASON+= \ | | 482 | PKG_SKIP_REASON+= \ |
483 | "${PKGNAME} is restricted:" \ | | 483 | "${PKGNAME} is restricted:" \ |
484 | " "${RESTRICTED:Q} | | 484 | " "${RESTRICTED:Q} |
485 | . endif | | 485 | . endif |
486 | . if defined(USE_X11) && (${USE_X11} != "weak") && (${X11_TYPE} == "native") && !exists(${X11BASE}) | | 486 | . if defined(USE_X11) && (${USE_X11} != "weak") && (${X11_TYPE} == "native") && !exists(${X11BASE}) |
487 | PKG_FAIL_REASON+= \ | | 487 | PKG_FAIL_REASON+= \ |
488 | "${PKGNAME} uses X11, but ${X11BASE} not found" | | 488 | "${PKGNAME} uses X11, but ${X11BASE} not found" |
489 | . endif | | 489 | . endif |
490 | . if ${BROKEN:U:M*} | | 490 | . if ${BROKEN:U:M*} |
491 | PKG_FAIL_REASON+= "${PKGNAME} is marked as broken:" | | 491 | PKG_FAIL_REASON+= "${PKGNAME} is marked as broken:" |
492 | PKG_FAIL_REASON+= ${BROKEN} | | 492 | PKG_FAIL_REASON+= ${BROKEN} |
493 | . endif | | 493 | . endif |
494 | | | 494 | |
495 | .include "license.mk" | | 495 | .include "license.mk" |
496 | | | 496 | |
497 | # | | 497 | # |
498 | # Check for packages broken or inappropriate on this platform. | | 498 | # Check for packages broken or inappropriate on this platform. |
499 | # Set __PLATFORM_OK and __PLATFORM_WORKS only if the platform passes | | 499 | # Set __PLATFORM_OK and __PLATFORM_WORKS only if the platform passes |
500 | # both the NOT_FOR/ONLY_FOR and BROKEN_ON lists (respectively). | | 500 | # both the NOT_FOR/ONLY_FOR and BROKEN_ON lists (respectively). |
501 | # | | 501 | # |
502 | | | 502 | |
503 | # 1. BROKEN_EXCEPT_ON_PLATFORM | | 503 | # 1. BROKEN_EXCEPT_ON_PLATFORM |
504 | . if defined(BROKEN_EXCEPT_ON_PLATFORM) && !empty(BROKEN_EXCEPT_ON_PLATFORM) | | 504 | . if defined(BROKEN_EXCEPT_ON_PLATFORM) && !empty(BROKEN_EXCEPT_ON_PLATFORM) |
505 | . for __tmp__ in ${BROKEN_EXCEPT_ON_PLATFORM} | | 505 | . for __tmp__ in ${BROKEN_EXCEPT_ON_PLATFORM} |
506 | . if ${MACHINE_PLATFORM:M${__tmp__}} != "" | | 506 | . if ${MACHINE_PLATFORM:M${__tmp__}} != "" |
507 | __PLATFORM_WORKS?= yes | | 507 | __PLATFORM_WORKS?= yes |
508 | . endif # MACHINE_PLATFORM | | 508 | . endif # MACHINE_PLATFORM |
509 | . endfor # __tmp__ | | 509 | . endfor # __tmp__ |
510 | . else # !BROKEN_EXCEPT_ON_PLATFORM | | 510 | . else # !BROKEN_EXCEPT_ON_PLATFORM |
511 | __PLATFORM_WORKS?= yes | | 511 | __PLATFORM_WORKS?= yes |
512 | . endif # BROKEN_EXCEPT_ON_PLATFORM | | 512 | . endif # BROKEN_EXCEPT_ON_PLATFORM |
513 | | | 513 | |
514 | # 2. ONLY_FOR_PLATFORM | | 514 | # 2. ONLY_FOR_PLATFORM |
515 | . if defined(ONLY_FOR_PLATFORM) && !empty(ONLY_FOR_PLATFORM) | | 515 | . if defined(ONLY_FOR_PLATFORM) && !empty(ONLY_FOR_PLATFORM) |
516 | . for __tmp__ in ${ONLY_FOR_PLATFORM} | | 516 | . for __tmp__ in ${ONLY_FOR_PLATFORM} |
517 | . if ${MACHINE_PLATFORM:M${__tmp__}} != "" | | 517 | . if ${MACHINE_PLATFORM:M${__tmp__}} != "" |
518 | __PLATFORM_OK?= yes | | 518 | __PLATFORM_OK?= yes |
519 | . endif # MACHINE_PLATFORM | | 519 | . endif # MACHINE_PLATFORM |
520 | . endfor # __tmp__ | | 520 | . endfor # __tmp__ |
521 | . else # !ONLY_FOR_PLATFORM | | 521 | . else # !ONLY_FOR_PLATFORM |
522 | __PLATFORM_OK?= yes | | 522 | __PLATFORM_OK?= yes |
523 | . endif # ONLY_FOR_PLATFORM | | 523 | . endif # ONLY_FOR_PLATFORM |
524 | | | 524 | |
525 | # 3. BROKEN_ON_PLATFORM | | 525 | # 3. BROKEN_ON_PLATFORM |
526 | . for __tmp__ in ${BROKEN_ON_PLATFORM} | | 526 | . for __tmp__ in ${BROKEN_ON_PLATFORM} |
527 | . if ${MACHINE_PLATFORM:M${__tmp__}} != "" | | 527 | . if ${MACHINE_PLATFORM:M${__tmp__}} != "" |
528 | . undef __PLATFORM_WORKS | | 528 | . undef __PLATFORM_WORKS |
529 | . endif # MACHINE_PLATFORM | | 529 | . endif # MACHINE_PLATFORM |
530 | . endfor # __tmp__ | | 530 | . endfor # __tmp__ |
531 | | | 531 | |
532 | # 4. NOT_FOR_PLATFORM | | 532 | # 4. NOT_FOR_PLATFORM |
533 | . for __tmp__ in ${NOT_FOR_PLATFORM} | | 533 | . for __tmp__ in ${NOT_FOR_PLATFORM} |
534 | . if ${MACHINE_PLATFORM:M${__tmp__}} != "" | | 534 | . if ${MACHINE_PLATFORM:M${__tmp__}} != "" |
535 | . undef __PLATFORM_OK | | 535 | . undef __PLATFORM_OK |
536 | . endif # MACHINE_PLATFORM | | 536 | . endif # MACHINE_PLATFORM |
537 | . endfor # __tmp__ | | 537 | . endfor # __tmp__ |
538 | | | 538 | |
539 | # Check OK (NOT_FOR/ONLY_FOR) before WORKS (BROKEN_ON) | | 539 | # Check OK (NOT_FOR/ONLY_FOR) before WORKS (BROKEN_ON) |
540 | . if !defined(__PLATFORM_OK) | | 540 | . if !defined(__PLATFORM_OK) |
541 | PKG_SKIP_REASON+= \ | | 541 | PKG_SKIP_REASON+= \ |
542 | "${PKGNAME} is not available for ${MACHINE_PLATFORM}" | | 542 | "${PKGNAME} is not available for ${MACHINE_PLATFORM}" |
543 | . endif # !__PLATFORM_OK | | 543 | . endif # !__PLATFORM_OK |
544 | . if !defined(__PLATFORM_WORKS) | | 544 | . if !defined(__PLATFORM_WORKS) |
545 | PKG_FAIL_REASON+= \ | | 545 | PKG_FAIL_REASON+= \ |
546 | "${PKGNAME} is marked broken on ${MACHINE_PLATFORM}" | | 546 | "${PKGNAME} is marked broken on ${MACHINE_PLATFORM}" |
547 | . endif # !__PLATFORM_WORKS | | 547 | . endif # !__PLATFORM_WORKS |
548 | | | 548 | |
549 | .endif # NO_SKIP | | 549 | .endif # NO_SKIP |
550 | | | 550 | |
551 | # Add these defs to the ones dumped into +BUILD_INFO | | 551 | # Add these defs to the ones dumped into +BUILD_INFO |
552 | _BUILD_DEFS+= PKGPATH | | 552 | _BUILD_DEFS+= PKGPATH |
553 | _BUILD_DEFS+= OPSYS OS_VERSION MACHINE_ARCH MACHINE_GNU_ARCH | | 553 | _BUILD_DEFS+= OPSYS OS_VERSION MACHINE_ARCH MACHINE_GNU_ARCH |
554 | _BUILD_DEFS+= ABI | | 554 | _BUILD_DEFS+= ABI |
555 | _BUILD_DEFS+= CPPFLAGS CFLAGS FFLAGS LDFLAGS | | 555 | _BUILD_DEFS+= CPPFLAGS CFLAGS FFLAGS LDFLAGS |
556 | _BUILD_DEFS+= OBJECT_FMT LICENSE RESTRICTED | | 556 | _BUILD_DEFS+= OBJECT_FMT LICENSE RESTRICTED |
557 | _BUILD_DEFS+= NO_SRC_ON_FTP NO_SRC_ON_CDROM | | 557 | _BUILD_DEFS+= NO_SRC_ON_FTP NO_SRC_ON_CDROM |
558 | _BUILD_DEFS+= NO_BIN_ON_FTP NO_BIN_ON_CDROM | | 558 | _BUILD_DEFS+= NO_BIN_ON_FTP NO_BIN_ON_CDROM |
559 | | | 559 | |
560 | .if defined(OSVERSION_SPECIFIC) | | 560 | .if defined(OSVERSION_SPECIFIC) |
561 | _BUILD_DEFS+= OSVERSION_SPECIFIC | | 561 | _BUILD_DEFS+= OSVERSION_SPECIFIC |
562 | DEPENDS+= osabi-${OPSYS}-${OS_VERSION}:../../pkgtools/osabi | | 562 | DEPENDS+= osabi-${OPSYS}-${OS_VERSION}:../../pkgtools/osabi |
563 | .endif # OSVERSION_SPECIFIC | | 563 | .endif # OSVERSION_SPECIFIC |
564 | | | 564 | |
565 | .for _pkg_ in ${_BUILTIN_PKGS} | | 565 | .for _pkg_ in ${_BUILTIN_PKGS} |
566 | . if defined(USE_BUILTIN.${_pkg_}) && \ | | 566 | . if defined(USE_BUILTIN.${_pkg_}) && \ |
567 | !empty(USE_BUILTIN.${_pkg_}:M[yY][eE][sS]) && \ | | 567 | !empty(USE_BUILTIN.${_pkg_}:M[yY][eE][sS]) && \ |
568 | defined(BUILTIN_PKG.${_pkg_}) && !empty(BUILTIN_PKG.${_pkg_}) | | 568 | defined(BUILTIN_PKG.${_pkg_}) && !empty(BUILTIN_PKG.${_pkg_}) |
569 | BUILTIN_PKGS+= ${BUILTIN_PKG.${_pkg_}} | | 569 | BUILTIN_PKGS+= ${BUILTIN_PKG.${_pkg_}} |
570 | . endif | | 570 | . endif |
571 | .endfor | | 571 | .endfor |
572 | .if defined(BUILTIN_PKGS) | | 572 | .if defined(BUILTIN_PKGS) |
573 | _BUILD_DEFS+= BUILTIN_PKGS | | 573 | _BUILD_DEFS+= BUILTIN_PKGS |
574 | .endif | | 574 | .endif |
575 | | | 575 | |
576 | .if defined(GLIBC_VERSION) | | 576 | .if defined(GLIBC_VERSION) |
577 | _BUILD_DEFS+= GLIBC_VERSION | | 577 | _BUILD_DEFS+= GLIBC_VERSION |
578 | .endif # GLIBC_VERSION | | 578 | .endif # GLIBC_VERSION |
579 | | | 579 | |
580 | .PHONY: all | | 580 | .PHONY: all |
581 | .if !target(all) | | 581 | .if !target(all) |
582 | all: ${_PKGSRC_BUILD_TARGETS} | | 582 | all: ${_PKGSRC_BUILD_TARGETS} |
583 | .endif | | 583 | .endif |
584 | | | 584 | |
585 | .PHONY: makedirs | | 585 | .PHONY: makedirs |
586 | makedirs: ${WRKDIR} ${FAKEHOMEDIR} _check-wrkdir-canonical | | 586 | makedirs: ${WRKDIR} ${FAKEHOMEDIR} _check-wrkdir-canonical |
587 | | | 587 | |
588 | ${WRKDIR}: | | 588 | ${WRKDIR}: |
589 | .if !defined(KEEP_WRKDIR) | | 589 | .if !defined(KEEP_WRKDIR) |
590 | . if ${WRKDIR_LOCKTYPE} != "none" | | 590 | . if ${WRKDIR_LOCKTYPE} != "none" |
591 | ${RUN} ${TEST} -f ${_WRKDIR_LOCKFILE} || ${RM} -fr ${WRKDIR} | | 591 | ${RUN} ${TEST} -f ${_WRKDIR_LOCKFILE} || ${RM} -fr ${WRKDIR} |
592 | . endif | | 592 | . endif |
593 | .endif | | 593 | .endif |
594 | ${RUN} umask 077 && ${MKDIR} ${WRKDIR} | | 594 | ${RUN} umask 077 && ${MKDIR} ${WRKDIR} |
595 | | | 595 | |
596 | # If the WRKDIR is not canonical (such as when it contains a symlink), | | 596 | # If the WRKDIR is not canonical (such as when it contains a symlink), |
597 | # various packages such as databases/mysql57-client will not find their | | 597 | # various packages such as databases/mysql57-client will not find their |
598 | # include files. See also checkarg_sane_absolute_path in bootstrap/bootstrap. | | 598 | # include files. See also checkarg_sane_absolute_path in bootstrap/bootstrap. |
599 | .PHONY: _check-wrkdir-canonical | | 599 | .PHONY: _check-wrkdir-canonical |
600 | _check-wrkdir-canonical: ${WRKDIR} | | 600 | _check-wrkdir-canonical: ${WRKDIR} |
601 | ${RUN} cd ${WRKDIR}; d=`exec pwd`; ${TEST} "$$d" = ${WRKDIR} \ | | 601 | ${RUN} cd ${WRKDIR}; d=`exec pwd`; ${TEST} "$$d" = ${WRKDIR} \ |
602 | || ${FAIL_MSG} "[bsd.pkg.mk] The path to WRKDIR ${WRKDIR} must be canonical ($$d)." | | 602 | || ${FAIL_MSG} "[bsd.pkg.mk] The path to WRKDIR ${WRKDIR} must be canonical ($$d)." |
603 | | | 603 | |
604 | # Create a symlink from ${WRKDIR} to the package directory if | | 604 | # Create a symlink from ${WRKDIR} to the package directory if |
605 | # CREATE_WRKDIR_SYMLINK is "yes". | | 605 | # CREATE_WRKDIR_SYMLINK is "yes". |
606 | # | | 606 | # |
607 | # This symlink is not used by pkgsrc and is only created for convenience. | | 607 | # This symlink is not used by pkgsrc and is only created for convenience. |
608 | # Most other pkgsrc pathnames must not contain symlinks, to prevent | | 608 | # Most other pkgsrc pathnames must not contain symlinks, to prevent |
609 | # spurious build failures (see checkarg_sane_absolute_path in | | 609 | # spurious build failures (see checkarg_sane_absolute_path in |
610 | # bootstrap/bootstrap). | | 610 | # bootstrap/bootstrap). |
611 | # | | 611 | # |
612 | # Keywords: work wrkdir symlink | | 612 | # Keywords: work wrkdir symlink |
613 | CREATE_WRKDIR_SYMLINK?= no | | 613 | CREATE_WRKDIR_SYMLINK?= no |
614 | | | 614 | |
615 | .if defined(WRKOBJDIR) && !empty(CREATE_WRKDIR_SYMLINK:M[Yy][Ee][Ss]) | | 615 | .if defined(WRKOBJDIR) && !empty(CREATE_WRKDIR_SYMLINK:M[Yy][Ee][Ss]) |
616 | makedirs: ${.CURDIR}/${WRKDIR_BASENAME} | | 616 | makedirs: ${.CURDIR}/${WRKDIR_BASENAME} |
617 | ${.CURDIR}/${WRKDIR_BASENAME}: | | 617 | ${.CURDIR}/${WRKDIR_BASENAME}: |
618 | . if ${WRKDIR_LOCKTYPE} != "none" | | 618 | . if ${WRKDIR_LOCKTYPE} != "none" |
619 | ${RUN} ${TEST} -f ${_WRKDIR_LOCKFILE} || ${RM} -f ${.TARGET} | | 619 | ${RUN} ${TEST} -f ${_WRKDIR_LOCKFILE} || ${RM} -f ${.TARGET} |
620 | . endif | | 620 | . endif |
621 | ${RUN} \ | | 621 | ${RUN} \ |
622 | if ${LN} -s ${WRKDIR} ${.TARGET} 2>/dev/null; then \ | | 622 | if ${LN} -s ${WRKDIR} ${.TARGET} 2>/dev/null; then \ |
623 | ${ECHO_MSG} "${.TARGET:T} -> ${WRKDIR}"; \ | | 623 | ${ECHO_MSG} "${.TARGET:T} -> ${WRKDIR}"; \ |
624 | fi | | 624 | fi |
625 | .endif | | 625 | .endif |
626 | | | 626 | |
627 | .include "pkgformat/bsd.pkgformat.mk" | | 627 | .include "pkgformat/bsd.pkgformat.mk" |
628 | | | 628 | |
629 | .include "depends/bsd.depends.mk" | | 629 | .include "depends/bsd.depends.mk" |
630 | .include "check/bsd.check.mk" | | 630 | .include "check/bsd.check.mk" |
631 | .include "fetch/bsd.fetch.mk" | | 631 | .include "fetch/bsd.fetch.mk" |
632 | .include "checksum/bsd.checksum.mk" | | 632 | .include "checksum/bsd.checksum.mk" |
633 | .include "extract/bsd.extract.mk" | | 633 | .include "extract/bsd.extract.mk" |
634 | .include "patch/bsd.patch.mk" | | 634 | .include "patch/bsd.patch.mk" |
635 | .include "configure/bsd.configure.mk" | | 635 | .include "configure/bsd.configure.mk" |
636 | .include "build/bsd.build.mk" | | 636 | .include "build/bsd.build.mk" |
637 | .include "install/bsd.install.mk" | | 637 | .include "install/bsd.install.mk" |
638 | .include "package/bsd.package.mk" | | 638 | .include "package/bsd.package.mk" |
639 | | | 639 | |
640 | .include "bsd.pkg.clean.mk" | | 640 | .include "bsd.pkg.clean.mk" |
641 | .include "bsd.pkg.update.mk" | | 641 | .include "bsd.pkg.update.mk" |
642 | | | 642 | |
643 | # su-target is a macro target that does just-in-time su-to-root before | | 643 | # su-target is a macro target that does just-in-time su-to-root before |
644 | # reinvoking the make process as root. It acquires root privileges and | | 644 | # reinvoking the make process as root. It acquires root privileges and |
645 | # invokes a new make process with the target named "su-${.TARGET}". | | 645 | # invokes a new make process with the target named "su-${.TARGET}". |
646 | # | | 646 | # |
647 | # MAKEFLAGS.su-${.TARGET} | | 647 | # MAKEFLAGS.su-${.TARGET} |
648 | # The additional flags that are passed to the make process. | | 648 | # The additional flags that are passed to the make process. |
649 | # | | 649 | # |
650 | # PRE_CMD.su-${.TARGET} | | 650 | # PRE_CMD.su-${.TARGET} |
651 | # Shell command executed before running the command that requires | | 651 | # Shell command executed before running the command that requires |
652 | # root privileges. This may "exit 0" to short-circuit the command | | 652 | # root privileges. This may "exit 0" to short-circuit the command |
653 | # list and skip executing the command that requires the root | | 653 | # list and skip executing the command that requires the root |
654 | # privileges. | | 654 | # privileges. |
655 | # | | 655 | # |
656 | | | 656 | |
657 | _ROOT_CMD= cd ${.CURDIR} && \ | | 657 | _ROOT_CMD= cd ${.CURDIR} && \ |
658 | ${PKGSRC_SETENV} ${PKGSRC_MAKE_ENV} \ | | 658 | ${PKGSRC_SETENV} ${PKGSRC_MAKE_ENV} \ |
659 | PATH=${_PATH_ORIG:Q}:${SU_CMD_PATH_APPEND:Q} \ | | 659 | PATH=${_PATH_ORIG:Q}:${SU_CMD_PATH_APPEND:Q} \ |
660 | ${MAKE} ${MAKEFLAGS} _PKGSRC_BARRIER=yes \ | | 660 | ${MAKE} ${MAKEFLAGS} _PKGSRC_BARRIER=yes \ |
661 | PKG_DEBUG_LEVEL=${PKG_DEBUG_LEVEL:Q} \ | | 661 | PKG_DEBUG_LEVEL=${PKG_DEBUG_LEVEL:Q} \ |
662 | ${USE_CROSS_COMPILE:DUSE_CROSS_COMPILE=${USE_CROSS_COMPILE:Q}} \ | | 662 | ${USE_CROSS_COMPILE:DUSE_CROSS_COMPILE=${USE_CROSS_COMPILE:Q}} \ |
663 | su-${.TARGET} ${MAKEFLAGS.su-${.TARGET}} | | 663 | su-${.TARGET} ${MAKEFLAGS.su-${.TARGET}} |
664 | | | 664 | |
665 | .PHONY: su-target | | 665 | .PHONY: su-target |
666 | su-target: .USE | | 666 | su-target: .USE |
667 | ${RUN}${PRE_CMD.su-${.TARGET}:U${TRUE}}; \ | | 667 | ${RUN}${PRE_CMD.su-${.TARGET}:U${TRUE}}; \ |
668 | if ${_IS_ROOT_CMD}; then \ | | 668 | if ${_IS_ROOT_CMD}; then \ |
669 | ${_ROOT_CMD}; \ | | 669 | ${_ROOT_CMD}; \ |
670 | else \ | | 670 | else \ |
671 | case ${PRE_ROOT_CMD:Q}"" in \ | | 671 | case ${PRE_ROOT_CMD:Q}"" in \ |
672 | ${TRUE:Q}"") ;; \ | | 672 | ${TRUE:Q}"") ;; \ |
673 | *) ${WARNING_MSG} "Running: "${PRE_ROOT_CMD:Q} ;; \ | | 673 | *) ${WARNING_MSG} "Running: "${PRE_ROOT_CMD:Q} ;; \ |
674 | esac; \ | | 674 | esac; \ |
675 | ${PRE_ROOT_CMD}; \ | | 675 | ${PRE_ROOT_CMD}; \ |
676 | ${STEP_MSG} "Becoming \`\`${_SU_ROOT_USER}'' to make su-${.TARGET} (`${ECHO} ${SU_CMD} | ${AWK} '{ print $$1 }'`)"; \ | | 676 | ${STEP_MSG} "Becoming \`\`${_SU_ROOT_USER}'' to make su-${.TARGET} (`${ECHO} ${SU_CMD} | ${AWK} '{ print $$1 }'`)"; \ |
677 | ${SU_CMD} ${_ROOT_CMD:Q}; \ | | 677 | ${SU_CMD} ${_ROOT_CMD:Q}; \ |
678 | ${STEP_MSG} "Dropping \`\`${_SU_ROOT_USER}'' privileges."; \ | | 678 | ${STEP_MSG} "Dropping \`\`${_SU_ROOT_USER}'' privileges."; \ |
679 | fi | | 679 | fi |
680 | | | 680 | |
681 | ################################################################ | | 681 | ################################################################ |
682 | # Some more targets supplied for users' convenience | | 682 | # Some more targets supplied for users' convenience |
683 | ################################################################ | | 683 | ################################################################ |
684 | | | 684 | |
685 | # Run pkglint: | | 685 | # Run pkglint: |
686 | .PHONY: lint | | 686 | .PHONY: lint |
687 | lint: | | 687 | lint: |
688 | ${RUN} ${LOCALBASE}/bin/pkglint | | 688 | ${RUN} ${LOCALBASE}/bin/pkglint |
689 | | | 689 | |
690 | # List of flags to pass to pkg_add(1) for bin-install: | | 690 | # List of flags to pass to pkg_add(1) for bin-install: |
691 | | | 691 | |
692 | BIN_INSTALL_FLAGS?= # -v | | 692 | BIN_INSTALL_FLAGS?= # -v |
693 | _BIN_INSTALL_FLAGS= ${BIN_INSTALL_FLAGS} | | 693 | _BIN_INSTALL_FLAGS= ${BIN_INSTALL_FLAGS} |
694 | .if defined(_AUTOMATIC) && !empty(_AUTOMATIC:M[Yy][Ee][Ss]) | | 694 | .if defined(_AUTOMATIC) && !empty(_AUTOMATIC:M[Yy][Ee][Ss]) |
695 | _BIN_INSTALL_FLAGS+= -A | | 695 | _BIN_INSTALL_FLAGS+= -A |
696 | .endif | | 696 | .endif |
697 | _BIN_INSTALL_FLAGS+= ${PKG_ARGS_ADD} | | 697 | _BIN_INSTALL_FLAGS+= ${PKG_ARGS_ADD} |
698 | | | 698 | |
699 | _SHORT_UNAME_R= ${:!${UNAME} -r!:C@\.([0-9]*)[_.-].*@.\1@} # n.n[_.]anything => n.n | | 699 | _SHORT_UNAME_R= ${:!${UNAME} -r!:C@\.([0-9]*)[_.-].*@.\1@} # n.n[_.]anything => n.n |
700 | | | 700 | |
701 | .include "install/bin-install.mk" | | 701 | .include "install/bin-install.mk" |
702 | | | 702 | |
703 | # Handle PaX flags | | 703 | # Handle PaX flags |
704 | # | | 704 | # |
705 | .include "pax.mk" | | 705 | .include "pax.mk" |
706 | | | 706 | |
707 | .PHONY: show-pkgtools-version | | 707 | .PHONY: show-pkgtools-version |
708 | .if !target(show-pkgtools-version) | | 708 | .if !target(show-pkgtools-version) |
709 | show-pkgtools-version: | | 709 | show-pkgtools-version: |
710 | @${ECHO} ${PKGTOOLS_VERSION} | | 710 | @${ECHO} ${PKGTOOLS_VERSION} |
711 | .endif | | 711 | .endif |
712 | | | 712 | |
713 | # show-var: | | 713 | # show-var: |
714 | # show-vars: | | 714 | # show-vars: |
715 | # show-subdir-var: | | 715 | # show-subdir-var: |
716 | # Convenience targets, to display make variables from the command | | 716 | # Convenience targets, to display make variables from the command |
717 | # line. Examples: | | 717 | # line. Examples: |
718 | # | | 718 | # |
719 | # make show-var VARNAME=PKGNAME | | 719 | # make show-var VARNAME=PKGNAME |
720 | # make show-vars VARNAMES="PKGNAME PKGVERSION PKGREVISION" | | 720 | # make show-vars VARNAMES="PKGNAME PKGVERSION PKGREVISION" |
721 | # make show-subdir-var VARNAME=DISTFILES | | 721 | # make show-subdir-var VARNAME=DISTFILES |
722 | # | | 722 | # |
723 | # In category directories, show-var and show-vars descend | | 723 | # In category directories, show-var and show-vars descend |
724 | # recursively into each subdirectory, printing the variables of | | 724 | # recursively into each subdirectory, printing the variables of |
725 | # the individual packages. To show a variable from the category | | 725 | # the individual packages. To show a variable from the category |
726 | # itself, use show-subdir-var. | | 726 | # itself, use show-subdir-var. |
727 | .PHONY: show-var | | 727 | .PHONY: show-var |
728 | show-var: | | 728 | show-var: |
729 | @${ECHO} ${${VARNAME}:Q} | | 729 | @${ECHO} ${${VARNAME}:Q} |
730 | | | 730 | |
731 | .PHONY: show-vars | | 731 | .PHONY: show-vars |
732 | show-vars: | | 732 | show-vars: |
733 | .for VARNAME in ${VARNAMES} | | 733 | .for VARNAME in ${VARNAMES} |
734 | @${ECHO} ${${VARNAME}:Q} | | 734 | @${ECHO} ${${VARNAME}:Q} |
735 | .endfor | | 735 | .endfor |
736 | | | 736 | |
737 | # displays multiple variables as shell expressions | | 737 | # displays multiple variables as shell expressions |
738 | # VARS is space separated list of VARNAME:shellvarname | | 738 | # VARS is space separated list of VARNAME:shellvarname |
739 | .PHONY: show-vars-eval | | 739 | .PHONY: show-vars-eval |
740 | show-vars-eval: | | 740 | show-vars-eval: |
741 | .for var in ${VARS} | | 741 | .for var in ${VARS} |
742 | @${ECHO} ${var:C/^.*://}="${${var:C/:.*$//}:Q}" | | 742 | @${ECHO} ${var:C/^.*://}="${${var:C/:.*$//}:Q}" |
743 | .endfor | | 743 | .endfor |
744 | | | 744 | |
745 | LICENSE_FILE?= ${PKGSRCDIR}/licenses/${LICENSE} | | 745 | LICENSE_FILE?= ${PKGSRCDIR}/licenses/${LICENSE} |
746 | | | 746 | |
747 | .if !target(show-license) | | 747 | .if !target(show-license) |
748 | show-license show-licence: .PHONY | | 748 | show-license show-licence: .PHONY |
749 | @license=${LICENSE:Q}; \ | | 749 | @license=${LICENSE:Q}; \ |
750 | license_file=${LICENSE_FILE:Q}; \ | | 750 | license_file=${LICENSE_FILE:Q}; \ |
751 | pager=${PAGER:Q}; \ | | 751 | pager=${PAGER:Q}; \ |
752 | case "$$pager" in "") pager=${CAT:Q};; esac; \ | | 752 | case "$$pager" in "") pager=${CAT:Q};; esac; \ |
753 | case "$$license" in "") exit 0;; esac; \ | | 753 | case "$$license" in "") exit 0;; esac; \ |
754 | if ${TEST} -f "$$license_file"; then \ | | 754 | if ${TEST} -f "$$license_file"; then \ |
755 | $$pager "$$license_file"; \ | | 755 | $$pager "$$license_file"; \ |
756 | else \ | | 756 | else \ |
757 | ${ECHO} "Generic $$license information not available"; \ | | 757 | ${ECHO} "Generic $$license information not available"; \ |
758 | ${ECHO} "See the package description (pkg_info -d ${PKGNAME}) for more information."; \ | | 758 | ${ECHO} "See the package description (pkg_info -d ${PKGNAME}) for more information."; \ |
759 | fi | | 759 | fi |
760 | .endif | | 760 | .endif |
761 | | | 761 | |
762 | .if !target(show-license-status) | | 762 | .if !target(show-license-status) |
763 | show-license-status show-licence-status: .PHONY | | 763 | show-license-status show-licence-status: .PHONY |
764 | @${ECHO} "The license of this package is ${LICENSE}." | | 764 | @${ECHO} "The license of this package is ${LICENSE}." |
765 | .if ${DEFAULT_ACCEPTABLE_LICENSES:M${LICENSE}} | | 765 | .if defined(DEFAULT_ACCEPTABLE_LICENSES) && ${DEFAULT_ACCEPTABLE_LICENSES:M${LICENSE}} |
766 | @${ECHO}; \ | | 766 | @${ECHO}; \ |
767 | ${ECHO} "This license is in DEFAULT_ACCEPTABLE_LICENSES." | | 767 | ${ECHO} "This license is in DEFAULT_ACCEPTABLE_LICENSES." |
768 | .endif | | 768 | .endif |
769 | .if ${ACCEPTABLE_LICENSES:M${LICENSE}} | | 769 | .if ${ACCEPTABLE_LICENSES:M${LICENSE}} |
770 | @${ECHO}; \ | | 770 | @${ECHO}; \ |
771 | ${ECHO} "This license is in ACCEPTABLE_LICENSES." | | 771 | ${ECHO} "This license is in ACCEPTABLE_LICENSES." |
772 | .endif | | 772 | .endif |
773 | .endif | | 773 | .endif |
774 | | | 774 | |
775 | # This target is defined in bsd.options.mk for packages that use | | 775 | # This target is defined in bsd.options.mk for packages that use |
776 | # the options framework. | | 776 | # the options framework. |
777 | .if !target(show-options) | | 777 | .if !target(show-options) |
778 | .PHONY: show-options | | 778 | .PHONY: show-options |
779 | show-options: | | 779 | show-options: |
780 | @${ECHO} This package does not use the options framework. | | 780 | @${ECHO} This package does not use the options framework. |
781 | .endif | | 781 | .endif |
782 | | | 782 | |
783 | # Depend is generally meaningless for arbitrary packages, but if someone wants | | 783 | # Depend is generally meaningless for arbitrary packages, but if someone wants |
784 | # one they can override this. This is just to catch people who've gotten into | | 784 | # one they can override this. This is just to catch people who've gotten into |
785 | # the habit of typing `${MAKE} depend all install' as a matter of course. | | 785 | # the habit of typing `${MAKE} depend all install' as a matter of course. |
786 | # | | 786 | # |
787 | .PHONY: depend | | 787 | .PHONY: depend |
788 | .if !target(depend) | | 788 | .if !target(depend) |
789 | depend: | | 789 | depend: |
790 | .endif | | 790 | .endif |
791 | | | 791 | |
792 | # Same goes for tags | | 792 | # Same goes for tags |
793 | .PHONY: tags | | 793 | .PHONY: tags |
794 | .if !target(tags) | | 794 | .if !target(tags) |
795 | tags: | | 795 | tags: |
796 | .endif | | 796 | .endif |
797 | | | 797 | |
798 | .include "plist/bsd.plist.mk" | | 798 | .include "plist/bsd.plist.mk" |
799 | | | 799 | |
800 | .include "bsd.utils.mk" | | 800 | .include "bsd.utils.mk" |
801 | | | 801 | |
802 | .include "subst.mk" | | 802 | .include "subst.mk" |
803 | | | 803 | |
804 | # README generation code. | | 804 | # README generation code. |
805 | .include "bsd.pkg.readme.mk" | | 805 | .include "bsd.pkg.readme.mk" |
806 | | | 806 | |
807 | # Create a PKG_ERROR_HANDLER shell command for each class listed in | | 807 | # Create a PKG_ERROR_HANDLER shell command for each class listed in |
808 | # PKG_ERROR_CLASSES. The error handler is meant to be invoked within | | 808 | # PKG_ERROR_CLASSES. The error handler is meant to be invoked within |
809 | # a make target. | | 809 | # a make target. |
810 | # | | 810 | # |
811 | .for _class_ in ${PKG_ERROR_CLASSES} | | 811 | .for _class_ in ${PKG_ERROR_CLASSES} |
812 | PKG_ERROR_HANDLER.${_class_}?= \ | | 812 | PKG_ERROR_HANDLER.${_class_}?= \ |
813 | { \ | | 813 | { \ |
814 | ec=$$?; \ | | 814 | ec=$$?; \ |
815 | for str in ${PKG_ERROR_MSG.${_class_}}; do \ | | 815 | for str in ${PKG_ERROR_MSG.${_class_}}; do \ |
816 | ${PHASE_MSG} "$$str"; \ | | 816 | ${PHASE_MSG} "$$str"; \ |
817 | done; \ | | 817 | done; \ |
818 | exit $$ec; \ | | 818 | exit $$ec; \ |
819 | } | | 819 | } |
820 | .endfor | | 820 | .endfor |
821 | | | 821 | |
822 | # Cache variables listed in MAKEVARS in a phase-specific "makevars.mk" | | 822 | # Cache variables listed in MAKEVARS in a phase-specific "makevars.mk" |
823 | # file. These variables are effectively passed to sub-make processes | | 823 | # file. These variables are effectively passed to sub-make processes |
824 | # that are invoked on the same Makefile. | | 824 | # that are invoked on the same Makefile. |
825 | # | | 825 | # |
826 | .for _phase_ in ${_ALL_PHASES} | | 826 | .for _phase_ in ${_ALL_PHASES} |
827 | ${_MAKEVARS_MK.${_phase_}}: ${WRKDIR} | | 827 | ${_MAKEVARS_MK.${_phase_}}: ${WRKDIR} |
828 | ${RUN} { \ | | 828 | ${RUN} { \ |
829 | ${ECHO} ".if !defined(_MAKEVARS_MK)"; \ | | 829 | ${ECHO} ".if !defined(_MAKEVARS_MK)"; \ |
830 | ${ECHO} "_MAKEVARS_MK= defined"; \ | | 830 | ${ECHO} "_MAKEVARS_MK= defined"; \ |
831 | ${ECHO} ""; \ | | 831 | ${ECHO} ""; \ |
832 | ${MAKEVARS:O:u:@_v_@ \ | | 832 | ${MAKEVARS:O:u:@_v_@ \ |
833 | ${${_v_}:D${ECHO} ${_v_}"= "${${_v_}:Q};} \ | | 833 | ${${_v_}:D${ECHO} ${_v_}"= "${${_v_}:Q};} \ |
834 | @} \ | | 834 | @} \ |
835 | ${ECHO} ""; \ | | 835 | ${ECHO} ""; \ |
836 | ${ECHO} ".endif # _MAKEVARS_MK"; \ | | 836 | ${ECHO} ".endif # _MAKEVARS_MK"; \ |
837 | } > ${.TARGET} | | 837 | } > ${.TARGET} |
838 | .endfor | | 838 | .endfor |
839 | | | 839 | |
840 | .if make(pbulk-index) || make(pbulk-index-item) || make(pbulk-save-wrkdir) | | 840 | .if make(pbulk-index) || make(pbulk-index-item) || make(pbulk-save-wrkdir) |
841 | .include "pbulk/pbulk-index.mk" | | 841 | .include "pbulk/pbulk-index.mk" |
842 | .endif | | 842 | .endif |
843 | | | 843 | |
844 | .if defined(_OPSYS_REQUIRE_UAC_MANIFEST) && !empty(_OPSYS_REQUIRE_UAC_MANIFEST:M[Yy][Ee][Ss]) | | 844 | .if defined(_OPSYS_REQUIRE_UAC_MANIFEST) && !empty(_OPSYS_REQUIRE_UAC_MANIFEST:M[Yy][Ee][Ss]) |
845 | . if defined(UAC_REQD_EXECS) && !empty(UAC_REQD_EXECS) | | 845 | . if defined(UAC_REQD_EXECS) && !empty(UAC_REQD_EXECS) |
846 | .include "misc/uac-manifest.mk" | | 846 | .include "misc/uac-manifest.mk" |
847 | . endif | | 847 | . endif |
848 | .endif | | 848 | .endif |
849 | | | 849 | |
850 | .if ${PKG_DEVELOPER:Uno} != "no" | | 850 | .if ${PKG_DEVELOPER:Uno} != "no" |
851 | . include "misc/developer.mk" | | 851 | . include "misc/developer.mk" |
852 | .endif | | 852 | .endif |
853 | .include "misc/show.mk" | | 853 | .include "misc/show.mk" |
854 | .if make(debug) | | 854 | .if make(debug) |
855 | . include "bsd.pkg.debug.mk" | | 855 | . include "bsd.pkg.debug.mk" |
856 | .endif | | 856 | .endif |
857 | .include "misc/warnings.mk" | | 857 | .include "misc/warnings.mk" |
858 | .include "misc/can-be-built-here.mk" | | 858 | .include "misc/can-be-built-here.mk" |
859 | .include "misc/cpe.mk" | | 859 | .include "misc/cpe.mk" |