From nobody Thu Feb 29 20:24:11 2024 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Tm2kM4CNrz5CrS9; Thu, 29 Feb 2024 20:24:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Tm2kM3dLnz4gpj; Thu, 29 Feb 2024 20:24:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1709238251; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tZIjdgwPgqmx++zmBd4NjXVerHxT2zjBlU27HPnw84s=; b=VcZy/ZcSgtldZS6+2gIU0xxKNLnPgDFcJj0gvpZlYXQCHnILxtttosYZHozhpB5EW8bmZ9 5iFKWhNrdvYAyFahsc/FYFQSuCT9Q8shQplIGMnXUPPalR2NmOTowGXG5UIinIMa2YMnLu WB4MdFKGPqiuhJHLs2fR5c29EPdKKyln6FbNLEviCHMEtm03IR7Cy+SnXvNCQPOgcfze1J NX1ny9HoxQkwyYeOO4pS1p7IGjE5UGKyLZEru6NaPFNuMvdme/FM5pYnwshIJEIiPzboyY 84LnockWJ1HSd2S+rGGJsq8n5HWHNG4EpI5AEjQIFIbf2H2jgC6lu3993zWl9g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1709238251; a=rsa-sha256; cv=none; b=MJlz3MNntCLiGGw8sQiXsThZafqm4QcnMwXBvYddK79Othwx2PCdD4+QIbuhIIAaCaibTV quKG8F195wPPrXTll3/SF8tDkxfLX9Nv0/8Y79bYRkM2oucyQE3vOPG5hn8KRe0WthxQzo QgzZ3edttw2JDe7P7vDO2IY+IEQEXFoJJxBA8WPso3HWb8AH/jxMBBvnGN/wkgRPbqM63u 43nKsgMPWte3NpQ9uI7QhbFe4DUW+E39ZFRZB2V5bjgYttBquKhypwm9aPd1c6voOk5c6c IgbH7OnK00KqIJBF/UADtVgkXiFHp1JJPSGgVgmBc8qj0kbTU4EF4aMiSLUfnw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1709238251; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tZIjdgwPgqmx++zmBd4NjXVerHxT2zjBlU27HPnw84s=; b=t5MZNF+UW/5RyECcXTuZms45Xi89/Q19yrIYNfGMOziNhKiv5/HGjC8Y8o1xCqYS95hr6Z aeIEKxPxdlo0koG38/z1Iy58EqCCXPiNNtscuYB8dr39DDiOz9gmuUVsyl/5wchzkIean5 lZCbYbhDc29aF/iLCgRhMWodO6+zkM8ua2iZchJW0VA1XuA1PhMoxEsQCUmjHRbNOEcKNR enPhsEaIyj/aDq3OFwzhlqGZy1zwsIOoEtnhaxuXHJy7yKpbqHN48AdGw7QDzGrCeccmEw rDiFj8ISfIMQu/W38SP5SgBBAhREbnGJVz2MYUWPyxg24ZxPh/KzCoxJL02ttw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Tm2kM3DRhzwXR; Thu, 29 Feb 2024 20:24:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41TKOBaW030845; Thu, 29 Feb 2024 20:24:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41TKOB2Y030842; Thu, 29 Feb 2024 20:24:11 GMT (envelope-from git) Date: Thu, 29 Feb 2024 20:24:11 GMT Message-Id: <202402292024.41TKOB2Y030842@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Tijl Coosemans Subject: git: 572f23616926 - main - Mk/*: Build with a clean environment List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tijl X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 572f2361692640bc27729191b1267aa3fcc354a7 Auto-Submitted: auto-generated The branch main has been updated by tijl: URL: https://cgit.FreeBSD.org/ports/commit/?id=572f2361692640bc27729191b1267aa3fcc354a7 commit 572f2361692640bc27729191b1267aa3fcc354a7 Author: Tijl Coosemans AuthorDate: 2024-01-20 11:38:46 +0000 Commit: Tijl Coosemans CommitDate: 2024-02-29 20:21:37 +0000 Mk/*: Build with a clean environment Both our make and gmake use the MAKEFLAGS environment variable but the values aren't compatible and the latest version of gmake complains about that. To rule out that any environment variable can cause problems like this, add a new command SETENVI=/usr/bin/env -i that clears the environment, and use it to run upstream build systems with a clean environment. Introduce a new variable WRK_ENV that contains the environment to use with SETENVI in all targets that run upstream build commands. Variables that are common between CONFIGURE_ENV and MAKE_ENV could be moved to WRK_ENV but for now it just contains a minimal environment: HOME=${WRKDIR}: Fixes USES=elixir ports that were using the user's HOME. OSVERSION: For cross building; determines the output of uname -K and getosreldate(3); affects net/freebsd-telnetd for example. PATH: Fixes USES=gem ports that were using the user's PATH. PWD=$${PWD}: Preserve current working directory; affects USES=go ports. TERM: To preserve colored output to terminals. TMPDIR: For users who define that. UNAME_*: For cross building; determines the output of uname(1); affects lang/python* for example. This commit deals with everything under Mk/. Ports that have their own targets running upstream build commands can switch to SETENVI later. The ports tree adds its definition of ARCH to the MAKEFLAGS environment variable, which is interpreted by sub-makes as command line arguments, which means that any definition of ARCH in upstream makefiles was overridden. The following ports required fixes now that this is no longer the case. games/iortcw, games/q3cellshading, games/tremulous: These use Quake 3 engine code. Fix use of ARCH. Reduce diff between FreeBSD code and Linux code. games/legesmotus: Remove ARCH related patches. lang/ocaml: Patch configure script so it detects amd64 correctly. Also make the powerpc case consistent with the other architectures. This also affects other ocaml ports like devel/ocaml-ocamlbuild and math/ocaml-num that include a Makefile.config installed by lang/ocaml. While here, use SETENVI in check-test target. net/libnatpmp: Use of upstream definition of ARCH triggers installation in PREFIX/lib64 on amd64. Disable this. PR: 276478 Approved by: portmgr (antoine) Exp-run by: antoine --- CHANGES | 17 +- Mk/Uses/angr.mk | 2 +- Mk/Uses/cabal.mk | 16 +- Mk/Uses/cargo.mk | 5 +- Mk/Uses/cmake.mk | 9 +- Mk/Uses/elixir.mk | 2 +- Mk/Uses/erlang.mk | 2 +- Mk/Uses/gem.mk | 8 +- Mk/Uses/go.mk | 16 +- Mk/Uses/imake.mk | 2 +- Mk/Uses/lazarus.mk | 2 +- Mk/Uses/mate.mk | 2 +- Mk/Uses/perl5.mk | 10 +- Mk/Uses/pyqt.mk | 4 +- Mk/Uses/pytest.mk | 2 +- Mk/Uses/python.mk | 20 +- Mk/Uses/qmake.mk | 2 +- Mk/Uses/ruby.mk | 10 +- Mk/bsd.commands.mk | 1 + Mk/bsd.java.mk | 8 +- Mk/bsd.port.mk | 25 +- games/iortcw/Makefile | 6 +- games/iortcw/files/patch-MP_Makefile | 73 ++++++ .../files/patch-MP_code_qcommon_q__platform.h | 42 ++-- games/iortcw/files/patch-SP_Makefile | 73 ++++++ .../files/patch-SP_code_qcommon_q__platform.h | 42 ++-- games/legesmotus/files/patch-Makefile | 11 - games/legesmotus/files/patch-common.mk | 18 +- games/q3cellshading/Makefile | 19 +- games/q3cellshading/files/patch-code-unix-Makefile | 268 ++++++++------------- games/tremulous/Makefile | 4 +- games/tremulous/files/patch-Makefile | 124 +++++----- lang/ocaml/Makefile | 16 +- lang/ocaml/files/patch-configure | 34 ++- net/libnatpmp/files/patch-Makefile | 10 + 35 files changed, 487 insertions(+), 418 deletions(-) diff --git a/CHANGES b/CHANGES index 710d36ae6446..b840bc11fdeb 100644 --- a/CHANGES +++ b/CHANGES @@ -10,7 +10,22 @@ in the release notes and/or placed into UPDATING. All ports committers are allowed to commit to this file. -20230111: +20240229: +AUTHOR: tijl@FreeBSD.org + + A new command SETENVI that clears the environment and a new variable + WRK_ENV that contains a basic environment to use with SETENVI have + been added. + Ports that run (parts of) the upstream build system directly using + commands like "${SETENV} ${MAKE_ENV} ${MAKE_CMD} ..." should change + that to "${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${MAKE_CMD} ...". This way + the build system runs with a clean environment without interference + from the user environment or ports framework environment. Ports can + add extra environment variables to WRK_ENV similar to CONFIGURE_ENV, + MAKE_ENV, TEST_ENV, and so on, but WRK_ENV is used in all targets + while the latter are target-specific. + +20240111: AUTHOR: bapt@FreeBSD.org MAN[1-8LN]PREFIX variable has been removed from the framework, use PREFIX diff --git a/Mk/Uses/angr.mk b/Mk/Uses/angr.mk index a1e41b042dae..6a5ae2a433ea 100644 --- a/Mk/Uses/angr.mk +++ b/Mk/Uses/angr.mk @@ -59,7 +59,7 @@ TEST_WRKSRC?= ${WRKSRC}/tests ANGR_NOSETESTS?= nosetests-${PYTHON_VER} do-test: - @(cd ${TEST_WRKSRC} && ${SETENV} ${TEST_ENV} ${ANGR_NOSETESTS}) + @(cd ${TEST_WRKSRC} && ${SETENVI} ${WRK_ENV} ${TEST_ENV} ${ANGR_NOSETESTS}) . endif # "${angr_ARGS:Mnose}" != "" .endif diff --git a/Mk/Uses/cabal.mk b/Mk/Uses/cabal.mk index e91e4522e8f7..2ee0596e0a6e 100644 --- a/Mk/Uses/cabal.mk +++ b/Mk/Uses/cabal.mk @@ -202,14 +202,14 @@ cabal-extract: check-cabal ${RM} -r ${CABAL_HOME} . endif @${ECHO_MSG} "===> Fetching Hackage index into ${CABAL_HOME}/.cabal" - ${SETENV} ${CABAL_HOME_ENV} ${CABAL_CMD} update + ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${CABAL_HOME_ENV} ${CABAL_CMD} update . if ${_hackage_is_default} == yes cd ${WRKDIR} && \ - ${SETENV} ${MAKE_ENV} ${CABAL_HOME_ENV} ${CABAL_CMD} get ${HACKAGE_DISTNAME} + ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${CABAL_HOME_ENV} ${CABAL_CMD} get ${HACKAGE_DISTNAME} . else . if ${cabal_ARGS:Mhpack} @${ECHO_MSG} "===> Running ${HPACK_CMD} to generate .cabal file" - cd ${WRKSRC} && ${SETENV} ${CABAL_HOME_ENV} ${HPACK_CMD} + cd ${WRKSRC} && ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${CABAL_HOME_ENV} ${HPACK_CMD} . endif . endif # Remove Haskell dependencies that come from GH_TUPLE @@ -217,7 +217,7 @@ cabal-extract: check-cabal . ifdef CABAL_REPOSITORIES @${ECHO_MSG} "===> Fetching additional Cabal repositories index into ${CABAL_HOME}/.cabal" @cd ${WRKSRC} && \ - ${SETENV} ${CABAL_HOME_ENV} ${CABAL_CMD} update + ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${CABAL_HOME_ENV} ${CABAL_CMD} update . endif # Create a cookie for cabal-post-patch @${TOUCH} ${EXTRACT_COOKIE} ${CABAL_COOKIE} @@ -227,12 +227,12 @@ cabal-extract: check-cabal # This pulls in all source dependencies, resolves them and generates build plan cabal-configure: check-cabal cd ${WRKSRC} && \ - ${SETENV} ${MAKE_ENV} ${CABAL_HOME_ENV} ${CABAL_CMD} build --dry-run --disable-benchmarks --disable-tests --flags="${CABAL_FLAGS}" ${CABAL_WITH_ARGS} ${CABAL_LTO_ARGS} ${BUILD_ARGS} ${BUILD_TARGET} + ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${CABAL_HOME_ENV} ${CABAL_CMD} build --dry-run --disable-benchmarks --disable-tests --flags="${CABAL_FLAGS}" ${CABAL_WITH_ARGS} ${CABAL_LTO_ARGS} ${BUILD_ARGS} ${BUILD_TARGET} # Calls cabal build on the Haskell package located in ${WRKSRC} cabal-build: check-cabal cd ${WRKSRC} && \ - ${SETENV} ${MAKE_ENV} ${CABAL_HOME_ENV} ${CABAL_CMD} build --disable-benchmarks --disable-tests ${CABAL_WITH_ARGS} ${CABAL_LTO_ARGS} ${BUILD_ARGS} ${BUILD_TARGET} + ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${CABAL_HOME_ENV} ${CABAL_CMD} build --disable-benchmarks --disable-tests ${CABAL_WITH_ARGS} ${CABAL_LTO_ARGS} ${BUILD_ARGS} ${BUILD_TARGET} # Generates USE_CABAL= ... line ready to be pasted into the port based on the plan.json file generated by cabal configure. make-use-cabal: check-cabal2tuple @@ -312,13 +312,13 @@ cabal-post-patch: cabal-pre-configure: # Generate .cabal file with hpack if requested . if ${cabal_ARGS:Mhpack} - cd ${WRKSRC} && ${SETENV} ${CABAL_HOME_ENV} hpack + cd ${WRKSRC} && ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${CABAL_HOME_ENV} hpack . endif . if !target(do-build) do-build: cd ${WRKSRC} && \ - ${SETENV} ${MAKE_ENV} ${CABAL_HOME_ENV} ${CABAL_CMD} build --offline --disable-benchmarks --disable-tests ${CABAL_WITH_ARGS} ${CABAL_LTO_ARGS} --flags "${CABAL_FLAGS}" ${BUILD_ARGS} ${BUILD_TARGET} + ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${CABAL_HOME_ENV} ${CABAL_CMD} build --offline --disable-benchmarks --disable-tests ${CABAL_WITH_ARGS} ${CABAL_LTO_ARGS} --flags "${CABAL_FLAGS}" ${BUILD_ARGS} ${BUILD_TARGET} . endif . if !target(do-install) diff --git a/Mk/Uses/cargo.mk b/Mk/Uses/cargo.mk index ea012141d66b..ca0a4fef23bd 100644 --- a/Mk/Uses/cargo.mk +++ b/Mk/Uses/cargo.mk @@ -154,8 +154,9 @@ RUSTFLAGS+= ${CFLAGS:M-mcpu=*:S/-mcpu=/-C target-cpu=/} . endif # Helper to shorten cargo calls. -_CARGO_RUN= ${SETENV} ${MAKE_ENV} ${CARGO_ENV} ${CARGO} -CARGO_CARGO_RUN= cd ${WRKSRC}; ${SETENV} CARGO_FREEBSD_PORTS_SKIP_GIT_UPDATE=1 ${_CARGO_RUN} +_CARGO_RUN= ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${CARGO_ENV} ${CARGO} +CARGO_CARGO_RUN= cd ${WRKSRC}; ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${CARGO_ENV} \ + CARGO_FREEBSD_PORTS_SKIP_GIT_UPDATE=1 ${CARGO} # User arguments for cargo targets. CARGO_BUILD_ARGS?= diff --git a/Mk/Uses/cmake.mk b/Mk/Uses/cmake.mk index d8a13e8f7e7a..8229fa9cbb55 100644 --- a/Mk/Uses/cmake.mk +++ b/Mk/Uses/cmake.mk @@ -153,7 +153,8 @@ BROKEN= USES=emacs is incompatible with cmake's ninja-generator (try cmake:noni do-configure: @${ECHO_MSG} ${_CMAKE_MSG} ${MKDIR} ${CONFIGURE_WRKSRC} - @cd ${CONFIGURE_WRKSRC}; ${SETENV} ${CONFIGURE_ENV} ${CMAKE_BIN} ${CMAKE_ARGS} ${CMAKE_SOURCE_PATH} + @cd ${CONFIGURE_WRKSRC}; ${SETENVI} ${WRK_ENV} ${CONFIGURE_ENV} ${CMAKE_BIN} \ + ${CMAKE_ARGS} ${CMAKE_SOURCE_PATH} . endif . if !target(do-test) && ${cmake_ARGS:Mtesting} @@ -169,9 +170,9 @@ CMAKE_TESTING_ARGS+= ${CMAKE_TESTING_${_bool_kind}:C/.*/-D&:BOOL=${_bool_kind}/ do-test: @cd ${BUILD_WRKSRC} && \ - ${SETENV} ${CONFIGURE_ENV} ${CMAKE_BIN} ${CMAKE_ARGS} ${CMAKE_TESTING_ARGS} ${CMAKE_SOURCE_PATH} && \ - ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${_MAKE_JOBS} ${MAKE_ARGS} ${ALL_TARGET} && \ - ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} ${CMAKE_TESTING_TARGET} + ${SETENVI} ${WRK_ENV} ${CONFIGURE_ENV} ${CMAKE_BIN} ${CMAKE_ARGS} ${CMAKE_TESTING_ARGS} ${CMAKE_SOURCE_PATH} && \ + ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${MAKE_CMD} ${_MAKE_JOBS} ${MAKE_ARGS} ${ALL_TARGET} && \ + ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} ${CMAKE_TESTING_TARGET} . endif . endif diff --git a/Mk/Uses/elixir.mk b/Mk/Uses/elixir.mk index fbfe407907d6..89d29aa9c46d 100644 --- a/Mk/Uses/elixir.mk +++ b/Mk/Uses/elixir.mk @@ -42,7 +42,7 @@ ELIXIR_APP_ROOT?= ${PREFIX}/lib/elixir/lib/${ELIXIR_APP_NAME} ELIXIR_HIDDEN?= "^${ELIXIR_APP_NAME}$$" ELIXIR_LOCALE?= en_US.UTF-8 MIX_CMD?= ${LOCALBASE}/bin/mix -MIX_COMPILE?= ${SETENV} ${MIX_ENV} LANG=${ELIXIR_LOCALE} LC_ALL=${ELIXIR_LOCALE} MIX_ENV=${MIX_ENV_NAME} ELIXIR_HIDDEN=${ELIXIR_HIDDEN} ${MIX_CMD} ${MIX_TARGET} +MIX_COMPILE?= ${SETENVI} ${WRK_ENV} ${MIX_ENV} LANG=${ELIXIR_LOCALE} LC_ALL=${ELIXIR_LOCALE} MIX_ENV=${MIX_ENV_NAME} ELIXIR_HIDDEN=${ELIXIR_HIDDEN} ${MIX_CMD} ${MIX_TARGET} MIX_REWRITE?= MIX_BUILD_DEPS?= MIX_RUN_DEPS?= diff --git a/Mk/Uses/erlang.mk b/Mk/Uses/erlang.mk index 62e9e6e34f29..acdd6c031cdd 100644 --- a/Mk/Uses/erlang.mk +++ b/Mk/Uses/erlang.mk @@ -97,7 +97,7 @@ do-build: . for target in ${REBAR_TARGETS} # Remove rebar.lock every time - it can be created again after each run of rebar3 @${RM} ${WRKSRC}/rebar.lock - @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} REBAR_PROFILE=${REBAR_PROFILE} ${ERLANG_COMPILE} ${target} + @cd ${WRKSRC} && ${SETENVI} ${WRK_ENV} ${MAKE_ENV} REBAR_PROFILE=${REBAR_PROFILE} ${ERLANG_COMPILE} ${target} . endfor . endif # !target(do-build) diff --git a/Mk/Uses/gem.mk b/Mk/Uses/gem.mk index 8c4539a274ca..e085c45fcab0 100644 --- a/Mk/Uses/gem.mk +++ b/Mk/Uses/gem.mk @@ -93,8 +93,8 @@ RUBYGEM_ARGS+= --no-document _USES_extract+= 590:gem-extract gem-extract: - @${SETENV} ${GEM_ENV} ${RUBYGEMBIN} unpack --target=${WRKDIR} ${DISTDIR}/${DIST_SUBDIR}/${GEMFILES} - @(cd ${BUILD_WRKSRC}; if ! ${SETENV} ${GEM_ENV} ${RUBYGEMBIN} spec --ruby ${DISTDIR}/${DIST_SUBDIR}/${GEMFILES} > ${GEMSPEC} ; then \ + @${SETENVI} ${WRK_ENV} ${GEM_ENV} ${RUBYGEMBIN} unpack --target=${WRKDIR} ${DISTDIR}/${DIST_SUBDIR}/${GEMFILES} + @(cd ${BUILD_WRKSRC}; if ! ${SETENVI} ${WRK_ENV} ${GEM_ENV} ${RUBYGEMBIN} spec --ruby ${DISTDIR}/${DIST_SUBDIR}/${GEMFILES} > ${GEMSPEC} ; then \ if [ -n "${BUILD_FAIL_MESSAGE}" ] ; then \ ${ECHO_MSG} "===> Extraction failed unexpectedly."; \ (${ECHO_CMD} "${BUILD_FAIL_MESSAGE}") | ${FMT_80} ; \ @@ -104,7 +104,7 @@ gem-extract: . if !target(do-build) do-build: - @(cd ${BUILD_WRKSRC}; if ! ${SETENV} ${GEM_ENV} ${RUBYGEMBIN} build --force ${GEMSPEC} ; then \ + @(cd ${BUILD_WRKSRC}; if ! ${SETENVI} ${WRK_ENV} ${GEM_ENV} ${RUBYGEMBIN} build --force ${GEMSPEC} ; then \ if [ -n "${BUILD_FAIL_MESSAGE}" ] ; then \ ${ECHO_MSG} "===> Compilation failed unexpectedly."; \ (${ECHO_CMD} "${BUILD_FAIL_MESSAGE}") | ${FMT_80} ; \ @@ -115,7 +115,7 @@ do-build: . if !target(do-install) do-install: - (cd ${BUILD_WRKSRC}; ${SETENV} ${GEM_ENV} ${RUBYGEMBIN} install ${RUBYGEM_ARGS} ${GEMFILES} -- ${CONFIGURE_ARGS}) + (cd ${BUILD_WRKSRC}; ${SETENVI} ${WRK_ENV} ${GEM_ENV} ${RUBYGEMBIN} install ${RUBYGEM_ARGS} ${GEMFILES} -- ${CONFIGURE_ARGS}) ${RM} -r ${STAGEDIR}${PREFIX}/${GEMS_BASE_DIR}/build_info/ ${FIND} ${STAGEDIR}${PREFIX}/${GEMS_BASE_DIR} -type f -name '*.so' -exec ${STRIP_CMD} {} + ${FIND} ${STAGEDIR}${PREFIX}/${GEMS_BASE_DIR} -type f \( -name mkmf.log -or -name gem_make.out \) -delete diff --git a/Mk/Uses/go.mk b/Mk/Uses/go.mk index 95af91448885..32884f3f3607 100644 --- a/Mk/Uses/go.mk +++ b/Mk/Uses/go.mk @@ -192,7 +192,7 @@ go-post-fetch: @${ECHO_MSG} "===> Fetching ${GO_MODNAME} dependencies"; @(cd ${DISTDIR}/${DIST_SUBDIR}; \ [ -e go.mod ] || ${RLN} ${GO_MODFILE} go.mod; \ - ${SETENV} ${GO_ENV} GOPROXY=${GO_GOPROXY} ${GO_CMD} mod download -x all) + ${SETENVI} ${WRK_ENV} ${GO_ENV} GOPROXY=${GO_GOPROXY} ${GO_CMD} mod download -x all) . endif _USES_extract+= 800:go-post-extract @@ -201,9 +201,9 @@ _USES_extract+= 800:go-post-extract # already in MODCACHE), vendor them so we can patch them if needed. go-post-extract: @${ECHO_MSG} "===> Tidying ${GO_MODNAME} dependencies"; - @(cd ${GO_WRKSRC}; ${SETENV} ${MAKE_ENV} ${GO_ENV} GOPROXY=${GO_MODCACHE} ${GO_CMD} mod tidy -e) + @(cd ${GO_WRKSRC}; ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${GO_ENV} GOPROXY=${GO_MODCACHE} ${GO_CMD} mod tidy -e) @${ECHO_MSG} "===> Vendoring ${GO_MODNAME} dependencies"; - @(cd ${GO_WRKSRC}; ${SETENV} ${MAKE_ENV} ${GO_ENV} GOPROXY=${GO_MODCACHE} ${GO_CMD} mod vendor -e) + @(cd ${GO_WRKSRC}; ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${GO_ENV} GOPROXY=${GO_MODCACHE} ${GO_CMD} mod vendor -e) . else # Legacy (GOPATH) build mode, setup directory structure expected by Go for the main module. go-post-extract: @@ -220,7 +220,7 @@ do-build: pkg=$$(${ECHO_CMD} $${t} | \ ${SED} -Ee 's/^([^:]*).*$$/\1/' -e 's/^${PORTNAME}$$/./'); \ ${ECHO_MSG} "===> Building $${out} from $${pkg}"; \ - ${SETENV} ${MAKE_ENV} ${GO_ENV} GOMAXPROCS=${MAKE_JOBS_NUMBER} GOPROXY=off ${GO_CMD} build ${GO_BUILDFLAGS} \ + ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${GO_ENV} GOMAXPROCS=${MAKE_JOBS_NUMBER} GOPROXY=off ${GO_CMD} build ${GO_BUILDFLAGS} \ -o ${GO_WRKDIR_BIN}/$${out} \ $${pkg}; \ done) @@ -246,7 +246,7 @@ do-test: (cd ${GO_WRKSRC}; \ for t in ${GO_TESTTARGET}; do \ ${ECHO_MSG} "===> Testing $${t}"; \ - ${SETENV} ${MAKE_ENV} ${GO_ENV} GOPROXY=off ${GO_CMD} test ${GO_TESTFLAGS} $${t}; \ + ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${GO_ENV} GOPROXY=off ${GO_CMD} test ${GO_TESTFLAGS} $${t}; \ done) . endif @@ -254,7 +254,7 @@ do-test: gomod-clean: . if exists(${GO_CMD}) @${ECHO_MSG} "===> Cleaning Go module cache" - @${SETENV} ${GO_ENV} ${GO_CMD} clean -modcache + @${SETENVI} ${WRK_ENV} ${GO_ENV} ${GO_CMD} clean -modcache . else @${ECHO_MSG} "===> Skipping since ${GO_CMD} is not installed" . endif @@ -279,11 +279,11 @@ gomod-vendor-deps: fi gomod-vendor: gomod-vendor-deps patch - @cd ${WRKSRC}; ${SETENV} ${GO_ENV} ${GO_CMD} mod vendor; \ + @cd ${WRKSRC}; ${SETENVI} ${WRK_ENV} ${GO_ENV} ${GO_CMD} mod vendor; \ [ -r vendor/modules.txt ] && ${_MODULES2TUPLE_CMD} vendor/modules.txt gomod-vendor-diff: gomod-vendor-deps patch - @cd ${WRKSRC}; ${SETENV} ${GO_ENV} ${GO_CMD} mod vendor; \ + @cd ${WRKSRC}; ${SETENVI} ${WRK_ENV} ${GO_ENV} ${GO_CMD} mod vendor; \ [ -r vendor/modules.txt ] && ${_MODULES2TUPLE_CMD} vendor/modules.txt | ${SED} 's|GH_TUPLE=| |; s| \\$$||' | ${GREP} -v ' \\' > ${WRKDIR}/GH_TUPLE-new.txt && \ echo ${GH_TUPLE} | ${TR} -s " " "\n" | ${SED} "s|^| |" > ${WRKDIR}/GH_TUPLE-old.txt && \ ${DIFF} ${WRKDIR}/GH_TUPLE-old.txt ${WRKDIR}/GH_TUPLE-new.txt || exit 0 diff --git a/Mk/Uses/imake.mk b/Mk/Uses/imake.mk index 06981bc9f819..6848907e8934 100644 --- a/Mk/Uses/imake.mk +++ b/Mk/Uses/imake.mk @@ -36,7 +36,7 @@ XMKMF_ARGS+= -a . if ! ${imake_ARGS:Menv} . if !target(do-configure) do-configure: - @(cd ${CONFIGURE_WRKSRC} && ${SETENV} ${MAKE_ENV} ${XMKMF} ${XMKMF_ARGS}) + @(cd ${CONFIGURE_WRKSRC} && ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${XMKMF} ${XMKMF_ARGS}) . endif . if ! ${imake_ARGS:Mnoman} diff --git a/Mk/Uses/lazarus.mk b/Mk/Uses/lazarus.mk index 6088ea029b23..ef5569ab8eb9 100644 --- a/Mk/Uses/lazarus.mk +++ b/Mk/Uses/lazarus.mk @@ -144,7 +144,7 @@ _INCLUDE_USES_LAZARUS_POST_MK= yes . if !target(do-build) do-build: . for PROJECT_FILE in ${LAZARUS_PROJECT_FILES} - @(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${LAZBUILD_CMD} \ + @(cd ${BUILD_WRKSRC}; ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${LAZBUILD_CMD} \ ${LAZBUILD_ARGS} --ws=${LCL_PLATFORM} --lazarusdir=${LAZARUS_DIR} ${PROJECT_FILE}) . endfor . endif # !target(do-build) diff --git a/Mk/Uses/mate.mk b/Mk/Uses/mate.mk index 34ccb7d831c3..dc4272bb90a0 100644 --- a/Mk/Uses/mate.mk +++ b/Mk/Uses/mate.mk @@ -210,7 +210,7 @@ CONFIGURE_ENV+= NOCONFIGURE=yes _USES_configure+= 295:mate-pre-configure mate-pre-configure: - @(cd ${CONFIGURE_WRKSRC} ; ${SETENV} ${CONFIGURE_ENV} ./autogen.sh) + @(cd ${CONFIGURE_WRKSRC} ; ${SETENVI} ${WRK_ENV} ${CONFIGURE_ENV} ./autogen.sh) . endif . if defined(MATE_PRE_PATCH) diff --git a/Mk/Uses/perl5.mk b/Mk/Uses/perl5.mk index 8c266cdfafee..e7c5fd5b5068 100644 --- a/Mk/Uses/perl5.mk +++ b/Mk/Uses/perl5.mk @@ -261,7 +261,7 @@ do-configure: ${SCRIPTDIR}/configure; \ fi @cd ${CONFIGURE_WRKSRC} && \ - ${SETENV} ${CONFIGURE_ENV} \ + ${SETENVI} ${WRK_ENV} ${CONFIGURE_ENV} \ ${PERL5} ${CONFIGURE_CMD} ${CONFIGURE_ARGS} . if !${_USE_PERL5:Mmodbuild*} @cd ${CONFIGURE_WRKSRC} && \ @@ -273,13 +273,13 @@ do-configure: . if ${_USE_PERL5:Mmodbuild*} . if !target(do-build) do-build: - @(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${PERL5} ${PL_BUILD} ${ALL_TARGET} ${MAKE_ARGS}) + @(cd ${BUILD_WRKSRC}; ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${PERL5} ${PL_BUILD} ${ALL_TARGET} ${MAKE_ARGS}) . endif # !target(do-build) . if !${USES:Mgmake} . if !target(do-install) do-install: - @(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${PERL5} ${PL_BUILD} ${INSTALL_TARGET} ${MAKE_ARGS}) + @(cd ${BUILD_WRKSRC}; ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${PERL5} ${PL_BUILD} ${INSTALL_TARGET} ${MAKE_ARGS}) . endif # !target(do-install) . endif # ! USES=gmake . endif # modbuild @@ -325,9 +325,9 @@ TEST_TARGET?= test TEST_WRKSRC?= ${BUILD_WRKSRC} do-test: . if ${USE_PERL5:Mmodbuild*} - @cd ${TEST_WRKSRC}/ && ${SETENV} ${TEST_ENV} ${PERL5} ${PL_BUILD} ${TEST_TARGET} ${TEST_ARGS} + @cd ${TEST_WRKSRC}/ && ${SETENVI} ${WRK_ENV} ${TEST_ENV} ${PERL5} ${PL_BUILD} ${TEST_TARGET} ${TEST_ARGS} . elif ${USE_PERL5:Mconfigure} - @cd ${TEST_WRKSRC}/ && ${SETENV} ${TEST_ENV} ${MAKE_CMD} ${TEST_ARGS} ${TEST_TARGET} + @cd ${TEST_WRKSRC}/ && ${SETENVI} ${WRK_ENV} ${TEST_ENV} ${MAKE_CMD} ${TEST_ARGS} ${TEST_TARGET} . endif # USE_PERL5:Mmodbuild* . endif # do-test .endif # defined(_POSTMKINCLUDED) diff --git a/Mk/Uses/pyqt.mk b/Mk/Uses/pyqt.mk index 18196b6768a1..b197f1ffcfb5 100644 --- a/Mk/Uses/pyqt.mk +++ b/Mk/Uses/pyqt.mk @@ -228,13 +228,13 @@ post-patch: . if !target(do-build) do-build: - (cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${SIP} ${SIP_ARGS}; ${SETENV} ${MAKE_ENV} ${MAKE} ${_MAKE_JOBS} -C ./build) + (cd ${WRKSRC}; ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${SIP} ${SIP_ARGS}; ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${MAKE} ${_MAKE_JOBS} -C ./build) . endif # !target(do-build) . if !target(do-install) do-install: - (cd ${WRKSRC} ; ${SETENV} ${MAKE_ENV} ${MAKE} -C ./build install INSTALL_ROOT=${STAGEDIR} ) + (cd ${WRKSRC} ; ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${MAKE} -C ./build install INSTALL_ROOT=${STAGEDIR} ) . endif # !target(do-install) . endif # defined(PYQT_DIST) diff --git a/Mk/Uses/pytest.mk b/Mk/Uses/pytest.mk index 62e435270cbd..4d0a0039672f 100644 --- a/Mk/Uses/pytest.mk +++ b/Mk/Uses/pytest.mk @@ -60,7 +60,7 @@ _PYTEST_FILTER_EXPRESSION= ${_PYTEST_ALL_IGNORED_TESTS:C/^(.)/and not \1/:tW:C/^ . if !target(do-test) do-test: - @cd ${TEST_WRKSRC} && ${SETENV} ${TEST_ENV} ${PYTHON_CMD} -m pytest \ + @cd ${TEST_WRKSRC} && ${SETENVI} ${WRK_ENV} ${TEST_ENV} ${PYTHON_CMD} -m pytest \ -k '${_PYTEST_FILTER_EXPRESSION}' \ -v -rs -o addopts= \ ${PYTEST_ARGS} diff --git a/Mk/Uses/python.mk b/Mk/Uses/python.mk index 5ef639cf7907..dad34dac322e 100644 --- a/Mk/Uses/python.mk +++ b/Mk/Uses/python.mk @@ -905,17 +905,17 @@ MAKE_ENV+= LDSHARED="${LDSHARED}" PYTHONDONTWRITEBYTECODE= PYTHONOPTIMIZE= . if !target(do-configure) && !defined(HAS_CONFIGURE) && !defined(GNU_CONFIGURE) do-configure: - @(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} ${PYDISTUTILS_SETUP} ${PYDISTUTILS_CONFIGURE_TARGET} ${PYDISTUTILS_CONFIGUREARGS}) + @(cd ${BUILD_WRKSRC}; ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${PYTHON_CMD} ${PYDISTUTILS_SETUP} ${PYDISTUTILS_CONFIGURE_TARGET} ${PYDISTUTILS_CONFIGUREARGS}) . endif . if !target(do-build) do-build: - @(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} ${PYDISTUTILS_SETUP} ${PYDISTUTILS_BUILD_TARGET} ${PYDISTUTILS_BUILDARGS}) + @(cd ${BUILD_WRKSRC}; ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${PYTHON_CMD} ${PYDISTUTILS_SETUP} ${PYDISTUTILS_BUILD_TARGET} ${PYDISTUTILS_BUILDARGS}) . endif . if !target(do-install) do-install: - @(cd ${INSTALL_WRKSRC}; ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} ${PYDISTUTILS_SETUP} ${PYDISTUTILS_INSTALL_TARGET} ${PYDISTUTILS_INSTALLARGS}) + @(cd ${INSTALL_WRKSRC}; ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${PYTHON_CMD} ${PYDISTUTILS_SETUP} ${PYDISTUTILS_INSTALL_TARGET} ${PYDISTUTILS_INSTALLARGS}) . endif . endif # defined(_PYTHON_FEATURE_DISTUTILS) @@ -934,13 +934,13 @@ do-configure: . if !target(do-build) do-build: - @cd ${BUILD_WRKSRC} && ${SETENV} ${MAKE_ENV} ${PEP517_BUILD_CMD} + @cd ${BUILD_WRKSRC} && ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${PEP517_BUILD_CMD} . endif . if !target(do-install) do-install: @${MKDIR} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR} - @cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${PEP517_INSTALL_CMD} + @cd ${INSTALL_WRKSRC} && ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${PEP517_INSTALL_CMD} @${PYTHON_CMD} -B ${PORTSDIR}/Mk/Scripts/strip_RECORD.py \ ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/${PORTNAME:C|[-_]+|_|g}-${DISTVERSION}*.dist-info/RECORD >> ${_PYTHONPKGLIST} @${REINPLACE_CMD} \ @@ -963,35 +963,35 @@ do-install: . if defined(_PYTHON_FEATURE_NOSE) . if !target(do-test) do-test: - cd ${TEST_WRKSRC} && ${SETENV} ${TEST_ENV} ${PYTHON_CMD} -m nose ${TEST_ARGS:NDESTDIR=*} -v + cd ${TEST_WRKSRC} && ${SETENVI} ${WRK_ENV} ${TEST_ENV} ${PYTHON_CMD} -m nose ${TEST_ARGS:NDESTDIR=*} -v . endif . endif # defined(_PYTHON_FEATURE_NOSE) . if defined(_PYTHON_FEATURE_NOSE2) . if !target(do-test) do-test: - cd ${TEST_WRKSRC} && ${SETENV} ${TEST_ENV} ${PYTHON_CMD} -m nose2 ${TEST_ARGS:NDESTDIR=*} -v + cd ${TEST_WRKSRC} && ${SETENVI} ${WRK_ENV} ${TEST_ENV} ${PYTHON_CMD} -m nose2 ${TEST_ARGS:NDESTDIR=*} -v . endif . endif # defined(_PYTHON_FEATURE_NOSE2) . if defined(_PYTHON_FEATURE_PYTEST) || defined(_PYTHON_FEATURE_PYTEST4) . if !target(do-test) do-test: - cd ${TEST_WRKSRC} && ${SETENV} ${TEST_ENV} ${PYTHON_CMD} -m pytest -k '${_PYTEST_FILTER_EXPRESSION}' -rs -v -o addopts= ${TEST_ARGS:NDESTDIR=*} + cd ${TEST_WRKSRC} && ${SETENVI} ${WRK_ENV} ${TEST_ENV} ${PYTHON_CMD} -m pytest -k '${_PYTEST_FILTER_EXPRESSION}' -rs -v -o addopts= ${TEST_ARGS:NDESTDIR=*} . endif . endif # defined(_PYTHON_FEATURE_PYTEST) || defined(_PYTHON_FEATURE_PYTEST4) . if defined(_PYTHON_FEATURE_UNITTEST) . if !target(do-test) do-test: - cd ${TEST_WRKSRC} && ${SETENV} ${TEST_ENV} ${PYTHON_CMD} -m unittest ${TEST_ARGS:NDESTDIR=*} -v + cd ${TEST_WRKSRC} && ${SETENVI} ${WRK_ENV} ${TEST_ENV} ${PYTHON_CMD} -m unittest ${TEST_ARGS:NDESTDIR=*} -v . endif . endif # defined(_PYTHON_FEATURE_UNITTEST) . if defined(_PYTHON_FEATURE_UNITTEST2) . if !target(do-test) do-test: - cd ${TEST_WRKSRC} && ${SETENV} ${TEST_ENV} ${PYTHON_CMD} -m unittest2 ${TEST_ARGS:NDESTDIR=*} -v + cd ${TEST_WRKSRC} && ${SETENVI} ${WRK_ENV} ${TEST_ENV} ${PYTHON_CMD} -m unittest2 ${TEST_ARGS:NDESTDIR=*} -v . endif . endif # defined(_PYTHON_FEATURE_UNITTEST2) diff --git a/Mk/Uses/qmake.mk b/Mk/Uses/qmake.mk index e6fc0758026a..926d98002b53 100644 --- a/Mk/Uses/qmake.mk +++ b/Mk/Uses/qmake.mk @@ -139,7 +139,7 @@ _QMAKE_MK_POST_INCLUDED= qmake.mk qmake-configure: @${MKDIR} ${_QMAKE_WRKSRC} @cd ${_QMAKE_WRKSRC} && \ - ${SETENV} ${QMAKE_ENV} ${_QMAKE} ${QMAKE_ARGS} \ + ${SETENVI} ${WRK_ENV} ${QMAKE_ENV} ${_QMAKE} ${QMAKE_ARGS} \ ${QMAKE_SOURCE_PATH} \ ${QMAKE_CONFIGURE_ARGS:?--:} ${QMAKE_CONFIGURE_ARGS} diff --git a/Mk/Uses/ruby.mk b/Mk/Uses/ruby.mk index c4631b64d2a9..8900de1ef1d9 100644 --- a/Mk/Uses/ruby.mk +++ b/Mk/Uses/ruby.mk @@ -311,12 +311,12 @@ ruby-extconf-configure: . for d in ${RUBY_EXTCONF_SUBDIRS} @${ECHO_MSG} "===> Running ${RUBY_EXTCONF} in ${d} to configure" @cd ${CONFIGURE_WRKSRC}/${d}; \ - ${SETENV} ${CONFIGURE_ENV} ${RUBY} ${RUBY_FLAGS} ${RUBY_EXTCONF} ${CONFIGURE_ARGS} + ${SETENVI} ${WRK_ENV} ${CONFIGURE_ENV} ${RUBY} ${RUBY_FLAGS} ${RUBY_EXTCONF} ${CONFIGURE_ARGS} . endfor . else @${ECHO_MSG} "===> Running ${RUBY_EXTCONF} to configure" @cd ${CONFIGURE_WRKSRC}; \ - ${SETENV} ${CONFIGURE_ENV} ${RUBY} ${RUBY_FLAGS} ${RUBY_EXTCONF} ${CONFIGURE_ARGS} + ${SETENVI} ${WRK_ENV} ${CONFIGURE_ENV} ${RUBY} ${RUBY_FLAGS} ${RUBY_EXTCONF} ${CONFIGURE_ARGS} . endif . endif @@ -331,21 +331,21 @@ do-configure: ruby-setup-configure ruby-setup-configure: @${ECHO_MSG} "===> Running ${RUBY_SETUP} to configure" @cd ${BUILD_WRKSRC}; \ - ${SETENV} ${CONFIGURE_ENV} ${RUBY} ${RUBY_FLAGS} ${RUBY_SETUP} config ${CONFIGURE_ARGS} + ${SETENVI} ${WRK_ENV} ${CONFIGURE_ENV} ${RUBY} ${RUBY_FLAGS} ${RUBY_SETUP} config ${CONFIGURE_ARGS} do-build: ruby-setup-build ruby-setup-build: @${ECHO_MSG} "===> Running ${RUBY_SETUP} to build" @cd ${BUILD_WRKSRC}; \ - ${SETENV} ${MAKE_ENV} ${RUBY} ${RUBY_FLAGS} ${RUBY_SETUP} setup + ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${RUBY} ${RUBY_FLAGS} ${RUBY_SETUP} setup do-install: ruby-setup-install ruby-setup-install: @${ECHO_MSG} "===> Running ${RUBY_SETUP} to install" @cd ${INSTALL_WRKSRC}; \ - ${SETENV} ${MAKE_ENV} ${RUBY} ${RUBY_FLAGS} ${RUBY_SETUP} install --prefix=${STAGEDIR} + ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${RUBY} ${RUBY_FLAGS} ${RUBY_SETUP} install --prefix=${STAGEDIR} . endif . if !${ruby_ARGS:Mbuild} && !${ruby_ARGS:Mrun} && !${ruby_ARGS:Mnone} diff --git a/Mk/bsd.commands.mk b/Mk/bsd.commands.mk index 069b5e4c6030..8ab99a18e22b 100644 --- a/Mk/bsd.commands.mk +++ b/Mk/bsd.commands.mk @@ -83,6 +83,7 @@ RM?= /bin/rm -f RMDIR?= /bin/rmdir SED?= /usr/bin/sed SETENV?= /usr/bin/env +SETENVI?= /usr/bin/env -i SH?= /bin/sh SORT?= /usr/bin/sort STRIP_CMD?= /usr/bin/strip diff --git a/Mk/bsd.java.mk b/Mk/bsd.java.mk index 162e2836e236..91ea9516c846 100644 --- a/Mk/bsd.java.mk +++ b/Mk/bsd.java.mk @@ -396,15 +396,15 @@ BUILD_DEPENDS+= ${ANT}:devel/apache-ant ALL_TARGET?= . if !target(do-build) do-build: - @(cd ${BUILD_WRKSRC}; \ - ${SETENV} ${MAKE_ENV} ${ANT} ${MAKE_ARGS} ${ALL_TARGET}) + @(cd ${BUILD_WRKSRC}; ${SETENVI} ${WRK_ENV} ${MAKE_ENV} \ + ${ANT} ${MAKE_ARGS} ${ALL_TARGET}) . endif . if !target(do-test) && defined(TEST_TARGET) TEST_DEPENDS+= ${DEPEND_JAVA} TEST_DEPENDS+= ${ANT}:devel/apache-ant do-test: - @(cd ${TEST_WRKSRC}; \ - ${SETENV} ${MAKE_ENV} ${ANT} ${MAKE_ARGS} ${TEST_TARGET}) + @(cd ${TEST_WRKSRC}; ${SETENVI} ${WRK_ENV} ${MAKE_ENV} \ + ${ANT} ${MAKE_ARGS} ${TEST_TARGET}) . endif . endif diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk index 1ec1e6c52c66..0671ec0d817d 100644 --- a/Mk/bsd.port.mk +++ b/Mk/bsd.port.mk @@ -669,6 +669,10 @@ FreeBSD_MAINTAINER= portmgr@FreeBSD.org # # For options see bsd.options.mk # +# WRK_ENV - Environment used when running the upstream build system. +# Target-specific environment variables can be defined using +# CONFIGURE_ENV, MAKE_ENV, TEST_ENV, and similar variables. +# # For fetch: # # FETCH_BINARY - Path to ftp/http fetch command if not in $PATH. @@ -1630,6 +1634,16 @@ PKG_NOTES+= flavor PKG_NOTE_flavor= ${FLAVOR} . endif +WRK_ENV+= HOME=${WRKDIR} \ + PWD="$${PWD}" +. for e in OSVERSION PATH TERM TMPDIR \ + UNAME_b UNAME_i UNAME_K UNAME_m UNAME_n \ + UNAME_p UNAME_r UNAME_s UNAME_U UNAME_v +. ifdef ${e} +WRK_ENV+= ${e}=${${e}:Q} +. endif +. endfor + TEST_ARGS?= ${MAKE_ARGS} TEST_ENV?= ${MAKE_ENV} @@ -3335,7 +3349,7 @@ do-configure: @${MKDIR} ${CONFIGURE_WRKSRC} @(cd ${CONFIGURE_WRKSRC} && \ ${SET_LATE_CONFIGURE_ARGS} \ - if ! ${SETENV} CC="${CC}" CPP="${CPP}" CXX="${CXX}" \ + if ! ${SETENVI} ${WRK_ENV} CC="${CC}" CPP="${CPP}" CXX="${CXX}" \ CFLAGS="${CFLAGS}" CPPFLAGS="${CPPFLAGS}" CXXFLAGS="${CXXFLAGS}" \ LDFLAGS="${LDFLAGS}" LIBS="${LIBS}" \ INSTALL="/usr/bin/install -c" \ @@ -3352,7 +3366,8 @@ do-configure: . endif # Build -DO_MAKE_BUILD?= ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_FLAGS} ${MAKEFILE} ${_MAKE_JOBS} ${MAKE_ARGS:N${DESTDIRNAME}=*} +DO_MAKE_BUILD?= ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_FLAGS} \ + ${MAKEFILE} ${_MAKE_JOBS} ${MAKE_ARGS:N${DESTDIRNAME}=*} . if !target(do-build) do-build: @(cd ${BUILD_WRKSRC}; if ! ${DO_MAKE_BUILD} ${ALL_TARGET}; then \ @@ -3443,13 +3458,15 @@ check-install-conflicts: . if !target(do-install) && !defined(NO_INSTALL) do-install: - @(cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${FAKEROOT} ${MAKE_CMD} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${INSTALL_TARGET}) + @(cd ${INSTALL_WRKSRC} && ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${FAKEROOT} \ + ${MAKE_CMD} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${INSTALL_TARGET}) . endif # Test . if !target(do-test) && defined(TEST_TARGET) -DO_MAKE_TEST?= ${SETENV} ${TEST_ENV} ${MAKE_CMD} ${MAKE_FLAGS} ${MAKEFILE} ${TEST_ARGS:N${DESTDIRNAME}=*} +DO_MAKE_TEST?= ${SETENVI} ${WRK_ENV} ${TEST_ENV} ${MAKE_CMD} ${MAKE_FLAGS} \ + ${MAKEFILE} ${TEST_ARGS:N${DESTDIRNAME}=*} do-test: @(cd ${TEST_WRKSRC}; if ! ${DO_MAKE_TEST} ${TEST_TARGET}; then \ if [ -n "${TEST_FAIL_MESSAGE}" ] ; then \ diff --git a/games/iortcw/Makefile b/games/iortcw/Makefile index 910beccfd637..9c20425cd256 100644 --- a/games/iortcw/Makefile +++ b/games/iortcw/Makefile @@ -1,6 +1,6 @@ PORTNAME= iortcw PORTVERSION= 1.51c -PORTREVISION= 3 +PORTREVISION= 4 PORTEPOCH= 1 CATEGORIES= games @@ -30,11 +30,11 @@ MAKE_ARGS= BINDIR="${STAGEDIR}${PREFIX}/bin" \ LDFLAGS_i386= -Wl,-znotext -PLIST_SUB= ARCH="${ARCH}" \ +PLIST_SUB= ARCH="${ARCH:S/amd64/x86_64/:S/i386/x86/:S/powerpc/ppc/}" \ WOLFDIR="${WOLFDIR}" SUB_FILES= iowolfded iowolfmp iowolfsp pkg-message -SUB_LIST= ARCH="${ARCH}" \ +SUB_LIST= ARCH="${ARCH:S/amd64/x86_64/:S/i386/x86/:S/powerpc/ppc/}" \ DISTVERSION="${DISTVERSION}" \ WOLFDIR="${PREFIX}/${WOLFDIR}" diff --git a/games/iortcw/files/patch-MP_Makefile b/games/iortcw/files/patch-MP_Makefile new file mode 100644 index 000000000000..be11bab35ea7 --- /dev/null +++ b/games/iortcw/files/patch-MP_Makefile @@ -0,0 +1,73 @@ +--- MP/Makefile.orig 2019-03-16 18:09:48 UTC ++++ MP/Makefile +@@ -101,14 +101,6 @@ export ARCH + endif + export ARCH + +-# For historical compatibility reasons on non-windows +-# platform output files use i386 instead of x86 +-ifeq ($(ARCH),x86) +- ifndef MINGW +- FILE_ARCH=i386 +- endif +-endif +- + ifndef FILE_ARCH + FILE_ARCH=$(ARCH) + endif +@@ -369,7 +361,7 @@ CLIENT_EXTRA_FILES= + EXTRA_FILES= + CLIENT_EXTRA_FILES= + +-ifneq (,$(findstring "$(COMPILE_PLATFORM)", "linux" "gnu_kfreebsd" "kfreebsd-gnu" "gnu")) ++ifneq (,$(findstring "$(COMPILE_PLATFORM)", "linux" "gnu_kfreebsd" "kfreebsd-gnu" "gnu" "freebsd" "netbsd" "openbsd")) + TOOLS_CFLAGS += -DARCH_STRING=\"$(COMPILE_ARCH)\" + endif + +@@ -752,7 +744,7 @@ ifneq (,$(findstring "$(PLATFORM)", "freebsd" "openbsd + ifneq (,$(findstring "$(PLATFORM)", "freebsd" "openbsd" "netbsd")) + + BASE_CFLAGS = -Wall -fno-strict-aliasing \ +- -pipe -DUSE_ICON -DMAP_ANONYMOUS=MAP_ANON ++ -pipe -DUSE_ICON -DARCH_STRING=\\\"$(FILE_ARCH)\\\" -DMAP_ANONYMOUS=MAP_ANON + CLIENT_CFLAGS += $(SDL_CFLAGS) + + OPTIMIZEVM = -O3 +@@ -761,7 +753,6 @@ ifneq (,$(findstring "$(PLATFORM)", "freebsd" "openbsd + ifeq ($(ARCH),x86_64) + OPTIMIZEVM = -O3 + OPTIMIZE = $(OPTIMIZEVM) -ffast-math +- FILE_ARCH = amd64 + endif + ifeq ($(ARCH),x86) + OPTIMIZEVM = -O3 -march=i586 +@@ -787,13 +778,8 @@ ifneq (,$(findstring "$(PLATFORM)", "freebsd" "openbsd + OPTIMIZE = $(OPTIMIZEVM) + endif + +- ifeq ($(USE_CURL),1) +- CLIENT_CFLAGS += $(CURL_CFLAGS) +- USE_CURL_DLOPEN=0 +- endif +- + SHLIBEXT=so +- SHLIBCFLAGS=-fPIC ++ SHLIBCFLAGS=-fPIC -fvisibility=hidden + SHLIBLDFLAGS=-shared $(LDFLAGS) + + THREAD_LIBS=-lpthread +@@ -805,12 +791,14 @@ ifneq (,$(findstring "$(PLATFORM)", "freebsd" "openbsd + RENDERER_LIBS = $(SDL_LIBS) + + ifeq ($(USE_OPENAL),1) ++ CLIENT_CFLAGS += $(OPENAL_CFLAGS) + ifneq ($(USE_OPENAL_DLOPEN),1) + CLIENT_LIBS += $(THREAD_LIBS) $(OPENAL_LIBS) + endif + endif + + ifeq ($(USE_CURL),1) ++ CLIENT_CFLAGS += $(CURL_CFLAGS) + ifneq ($(USE_CURL_DLOPEN),1) + CLIENT_LIBS += $(CURL_LIBS) + endif diff --git a/games/iortcw/files/patch-MP_code_qcommon_q__platform.h b/games/iortcw/files/patch-MP_code_qcommon_q__platform.h index 770e384a9750..1e6322c627c0 100644 --- a/games/iortcw/files/patch-MP_code_qcommon_q__platform.h +++ b/games/iortcw/files/patch-MP_code_qcommon_q__platform.h @@ -1,32 +1,22 @@ --- MP/code/qcommon/q_platform.h.orig 2019-03-16 18:09:48 UTC +++ MP/code/qcommon/q_platform.h -@@ -35,11 +35,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +@@ -221,14 +221,13 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + #define ID_INLINE inline + #define PATH_SEP '/' - #else - --#if (defined _M_IX86 || defined __i386__) && !defined(C_ONLY) --#define id386 1 --#else - #define id386 0 --#endif - - #if (defined(powerc) || defined(powerpc) || defined(ppc) || \ - defined(__ppc) || defined(__ppc__)) && !defined(C_ONLY) -@@ -224,11 +220,15 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, - #ifdef __i386__ - #define ARCH_STRING "i386" - #elif defined __amd64__ --#undef idx64 --#define idx64 1 - #define ARCH_STRING "amd64" - #elif defined __axp__ - #define ARCH_STRING "alpha" -+#elif defined __powerpc64__ -+#define ARCH_STRING "powerpc64" -+#elif defined __powerpc__ -+#define ARCH_STRING "powerpc" -+#elif defined __riscv -+#define ARCH_STRING "riscv64" +-#ifdef __i386__ +-#define ARCH_STRING "i386" +-#elif defined __amd64__ ++#if !defined(ARCH_STRING) ++# error ARCH_STRING should be defined by the Makefile ++#endif ++ ++#if defined __x86_64__ + #undef idx64 + #define idx64 1 +-#define ARCH_STRING "amd64" +-#elif defined __axp__ +-#define ARCH_STRING "alpha" #endif #if BYTE_ORDER == BIG_ENDIAN diff --git a/games/iortcw/files/patch-SP_Makefile b/games/iortcw/files/patch-SP_Makefile new file mode 100644 index 000000000000..294a9b7c76d6 --- /dev/null +++ b/games/iortcw/files/patch-SP_Makefile @@ -0,0 +1,73 @@ +--- SP/Makefile.orig 2019-03-16 18:09:48 UTC ++++ SP/Makefile +@@ -98,14 +98,6 @@ export ARCH + endif + export ARCH + +-# For historical compatibility reasons on non-windows +-# platform output files use i386 instead of x86 +-ifeq ($(ARCH),x86) +- ifndef MINGW +- FILE_ARCH=i386 +- endif +-endif +- + ifndef FILE_ARCH + FILE_ARCH=$(ARCH) + endif +@@ -358,7 +350,7 @@ CLIENT_EXTRA_FILES= + EXTRA_FILES= + CLIENT_EXTRA_FILES= + +-ifneq (,$(findstring "$(COMPILE_PLATFORM)", "linux" "gnu_kfreebsd" "kfreebsd-gnu" "gnu")) ++ifneq (,$(findstring "$(COMPILE_PLATFORM)", "linux" "gnu_kfreebsd" "kfreebsd-gnu" "gnu" "freebsd" "netbsd" "openbsd")) + TOOLS_CFLAGS += -DARCH_STRING=\"$(COMPILE_ARCH)\" + endif + +@@ -741,7 +733,7 @@ ifneq (,$(findstring "$(PLATFORM)", "freebsd" "openbsd + ifneq (,$(findstring "$(PLATFORM)", "freebsd" "openbsd" "netbsd")) + + BASE_CFLAGS = -Wall -fno-strict-aliasing \ +- -pipe -DUSE_ICON -DMAP_ANONYMOUS=MAP_ANON ++ -pipe -DUSE_ICON -DARCH_STRING=\\\"$(FILE_ARCH)\\\" -DMAP_ANONYMOUS=MAP_ANON + CLIENT_CFLAGS += $(SDL_CFLAGS) + + OPTIMIZEVM = -O3 +@@ -750,7 +742,6 @@ ifneq (,$(findstring "$(PLATFORM)", "freebsd" "openbsd + ifeq ($(ARCH),x86_64) + OPTIMIZEVM = -O3 + OPTIMIZE = $(OPTIMIZEVM) -ffast-math +- FILE_ARCH = amd64 + endif + ifeq ($(ARCH),x86) + OPTIMIZEVM = -O3 -march=i586 +@@ -776,13 +767,8 @@ ifneq (,$(findstring "$(PLATFORM)", "freebsd" "openbsd + OPTIMIZE = $(OPTIMIZEVM) + endif + +- ifeq ($(USE_CURL),1) +- CLIENT_CFLAGS += $(CURL_CFLAGS) +- USE_CURL_DLOPEN=0 +- endif +- + SHLIBEXT=so +- SHLIBCFLAGS=-fPIC ++ SHLIBCFLAGS=-fPIC -fvisibility=hidden + SHLIBLDFLAGS=-shared $(LDFLAGS) + + THREAD_LIBS=-lpthread +@@ -794,12 +780,14 @@ ifneq (,$(findstring "$(PLATFORM)", "freebsd" "openbsd + RENDERER_LIBS = $(SDL_LIBS) + + ifeq ($(USE_OPENAL),1) ++ CLIENT_CFLAGS += $(OPENAL_CFLAGS) + ifneq ($(USE_OPENAL_DLOPEN),1) + CLIENT_LIBS += $(THREAD_LIBS) $(OPENAL_LIBS) + endif + endif + + ifeq ($(USE_CURL),1) ++ CLIENT_CFLAGS += $(CURL_CFLAGS) + ifneq ($(USE_CURL_DLOPEN),1) + CLIENT_LIBS += $(CURL_LIBS) + endif diff --git a/games/iortcw/files/patch-SP_code_qcommon_q__platform.h b/games/iortcw/files/patch-SP_code_qcommon_q__platform.h index 84d7ad28d17e..5c657c98badd 100644 --- a/games/iortcw/files/patch-SP_code_qcommon_q__platform.h +++ b/games/iortcw/files/patch-SP_code_qcommon_q__platform.h @@ -1,32 +1,22 @@ --- SP/code/qcommon/q_platform.h.orig 2019-03-16 18:09:48 UTC +++ SP/code/qcommon/q_platform.h -@@ -35,11 +35,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +@@ -221,14 +221,13 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + #define ID_INLINE inline + #define PATH_SEP '/' - #else - --#if (defined _M_IX86 || defined __i386__) && !defined(C_ONLY) --#define id386 1 --#else - #define id386 0 --#endif *** 1062 LINES SKIPPED ***