Skip to content

Commit

Permalink
Framework: sync with upstream
Browse files Browse the repository at this point in the history
Taken from: FreeBSD
  • Loading branch information
fichtner committed Jul 2, 2015
1 parent 0a6f188 commit 2bf36c7
Show file tree
Hide file tree
Showing 11 changed files with 136 additions and 95 deletions.
32 changes: 32 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,38 @@ in the release notes and/or placed into UPDATING.

All ports committers are allowed to commit to this file.

20150701:
AUTHOR: [email protected]

Make option target helpers have been added, it allows replacing:

.include <bsd.port.options.mk>

post-patch:
${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \
${WRKSRC}/Configure ${WRKSRC}/hints/freebsd.sh
.if ${PORT_OPTIONS:MPTHREAD}
${REINPLACE_CMD} -e 's|%%PTHREAD_LIBS%%|-lpthread|g;' \
${WRKSRC}/hints/freebsd.sh
.else
${REINPLACE_CMD} -e 's|%%PTHREAD_LIBS%%||g;' \
${WRKSRC}/hints/freebsd.sh
.endif

with:

post-patch:
${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \
${WRKSRC}/Configure ${WRKSRC}/hints/freebsd.sh

post-patch-PTHREAD-on:
${REINPLACE_CMD} -e 's|%%PTHREAD_LIBS%%|-lpthread|g;' \
${WRKSRC}/hints/freebsd.sh

post-patch-PTHREAD-off:
${REINPLACE_CMD} -e 's|%%PTHREAD_LIBS%%||g;' \
${WRKSRC}/hints/freebsd.sh

20150622:
AUTHOR: [email protected]

Expand Down
39 changes: 39 additions & 0 deletions Mk/Scripts/all-depends-list.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/sh
# MAINTAINER: [email protected]
# $FreeBSD$

set -e

. ${dp_SCRIPTSDIR}/functions.sh

validate_env dp_ALLDEPENDS dp_PORTSDIR dp_PKGNAME dp_MAKE

set -u

check_dep() {
for _dep ; do
myifs=${IFS}
IFS=:
set -- ${_dep}
IFS=${myifs}

case "${2}" in
/*) d=${2} ;;
*) d=${dp_PORTSDIR}/${2} ;;
esac

case " ${checked} " in
*\ ${d}\ *) continue ;; # Already checked
esac
checked="${checked} ${d}"
if [ ! -d ${d} ]; then
echo "${dp_PKGNAME}: \"${d}\" non-existent -- dependency list incomplete" >&2
continue
fi
echo ${d}
check_dep $(${dp_MAKE} -C ${d} -V_UNIFIED_DEPENDS)
done
}

checked=
check_dep ${dp_ALLDEPENDS}
16 changes: 2 additions & 14 deletions Mk/Scripts/check-stagedir.sh
Original file line number Diff line number Diff line change
Expand Up @@ -224,20 +224,8 @@ case "$1" in
esac

# validate environment
envfault=
for i in STAGEDIR PREFIX LOCALBASE WRKDIR WRKSRC MTREE_FILE \
TMPPLIST PLIST_SUB_SED SCRIPTSDIR \
PORT_OPTIONS NO_PREFIX_RMDIR
do
if ! ( eval ": \${${i}?}" ) 2>/dev/null ; then
envfault="${envfault}${envfault:+" "}${i}"
fi
done
if [ -n "$envfault" ] ; then
echo "Environment variables $envfault undefined. Aborting." \
| fmt >&2
exit 1
fi
validate_env STAGEDIR PREFIX LOCALBASE WRKDIR WRKSRC MTREE_FILE \
TMPPLIST PLIST_SUB_SED SCRIPTSDIR PORT_OPTIONS NO_PREFIX_RMDIR

set -u

Expand Down
13 changes: 1 addition & 12 deletions Mk/Scripts/do-depends.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,11 @@ set -e

. ${dp_SCRIPTSDIR}/functions.sh

envfault=
for i in dp_RAWDEPENDS dp_DEPTYPE dp_DEPENDS_TARGET dp_DEPENDS_PRECLEAN \
validate_env dp_RAWDEPENDS dp_DEPTYPE dp_DEPENDS_TARGET dp_DEPENDS_PRECLEAN \
dp_DEPENDS_CLEAN dp_DEPENDS_ARGS dp_USE_PACKAGE_DEPENDS \
dp_USE_PACKAGE_DEPENDS_ONLY dp_PKG_ADD dp_PKG_INFO dp_WRKDIR \
dp_PKGNAME dp_STRICT_DEPENDS dp_LOCALBASE dp_LIB_DIRS dp_SH \
dp_SCRIPTSDIR dp_PORTSDIR dp_MAKE
do
if ! (eval ": \${${i}?}" ) >/dev/null; then
envfault="${envfault}${envfault:+" "}${i}"
fi
done
if [ -n "${envfault}" ]; then
echo "Environment variable ${envfault} undefined. Aborting." \
| fmt >&2
exit 1
fi

set -u

Expand Down
14 changes: 14 additions & 0 deletions Mk/Scripts/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,17 @@ parse_plist() {
esac
done
}

validate_env() {
local envfault
for i ; do
if ! (eval ": \${${i}?}" ) >/dev/null; then
envfault="${envfault}${envfault:+" "}${i}"
fi
done
if [ -n "${envfault}" ]; then
echo "Environment variable ${envfault} undefined. Aborting." \
| fmt >&2
exit 1
fi
}
23 changes: 0 additions & 23 deletions Mk/Scripts/pkgencode.awk

This file was deleted.

6 changes: 5 additions & 1 deletion Mk/Uses/gnustep.mk
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,13 @@ GNUSTEP_LOCAL_TOOLS= ${GNUSTEP_LOCAL_ROOT}/Tools
LIB_DIRS+= ${GNUSTEP_SYSTEM_LIBRARIES} \
${GNUSTEP_LOCAL_LIBRARIES}

.for a in FLAGS CFLAGS CPPFLAGS OBJCFLAGS INCLUDE_DIRS LDFLAGS LIB_DIRS
.for a in CFLAGS CPPFLAGS CXXFLAGS OBJCCFLAGS OBJCFLAGS LDFLAGS
MAKE_ENV+= ADDITIONAL_${a}="${ADDITIONAL_${a}} ${${a}}"
.endfor
.for a in FLAGS INCLUDE_DIRS LIB_DIRS
MAKE_ENV+= ADDITIONAL_${a}="${ADDITIONAL_${a}}"
.endfor
MAKE_ARGS+=messages=yes

MAKEFILE= GNUmakefile
#MAKE_ENV+= GNUSTEP_CONFIG_FILE=${PORTSDIR}/devel/gnustep-make/files/GNUstep.conf
Expand Down
1 change: 1 addition & 0 deletions Mk/Uses/iconv.mk
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ BUILD_DEPENDS+= libiconv>=1.14_8:${PORTSDIR}/converters/libiconv
CPPFLAGS+= -DLIBICONV_PLUG
CFLAGS+= -DLIBICONV_PLUG
CXXFLAGS+= -DLIBICONV_PLUG
OBJCFLAGS+= -DLIBICONV_PLUG
.endif

.endif
Expand Down
7 changes: 5 additions & 2 deletions Mk/Uses/objc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
.if !defined(_INCLUDE_USES_OBJC_MK)
_INCLUDE_USES_OBJC_MK= yes

.if !empty(objc_ARGS)
IGNORE= USES=objc takes no arguments
objc_ARGS?=
.if !empty(objc_ARGS) && ! ${objc_ARGS:Mcompiler}
IGNORE= USES=objc only accepts no arguments or 'compiler'
.endif

_CCVERSION!= ${CC} --version
Expand Down Expand Up @@ -56,9 +57,11 @@ LDFLAGS+= -B${LOCALBASE}/bin
.endif
.endif

.if ! ${objc_ARGS:Mcompiler}
LIB_DEPENDS+= libobjc.so.4.6:${PORTSDIR}/lang/libobjc2
OBJCFLAGS+= -I${LOCALBASE}/include
LDFLAGS+= -L${LOCALBASE}/lib
.endif
CONFIGURE_ENV+= OBJC="${CC}" OBJCFLAGS="${OBJCFLAGS}"
MAKE_ENV+= OBJC="${CC}" OBJCFLAGS="${OBJCFLAGS}"

Expand Down
17 changes: 17 additions & 0 deletions Mk/bsd.options.mk
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ _OPTIONS_FLAGS= ALL_TARGET CATEGORIES CFLAGS CONFIGURE_ENV CONFLICTS \
MAKE_ENV PATCHFILES PATCH_SITES PLIST_DIRS PLIST_DIRSTRY \
PLIST_FILES PLIST_SUB SUB_FILES SUB_LIST USES
_OPTIONS_DEPENDS= PKG FETCH EXTRACT PATCH BUILD LIB RUN
_OPTIONS_TARGETS= fetch extract patch configure build install package stage

# Set the default values for the global options, as defined by portmgr
.if !defined(NOPORTDOCS)
Expand Down Expand Up @@ -410,6 +411,12 @@ WITH_DEBUG= yes
ALL_OPTIONS= ${OPTIONS_DEFINE}
.endif

.for target in ${_OPTIONS_TARGETS}
.for prepost in pre post
_OPTIONS_${prepost}_${target}?=
.endfor
.endfor

.for opt in ${COMPLETE_OPTIONS_LIST} ${OPTIONS_SLAVE} ${OPTIONS_EXCLUDE_${ARCH}} ${OPTIONS_EXCLUDE}
# PLIST_SUB
PLIST_SUB?=
Expand Down Expand Up @@ -463,6 +470,11 @@ ${flags}+= ${${opt}_${flags}}
${deptype}_DEPENDS+= ${${opt}_${deptype}_DEPENDS}
. endif
. endfor
. for target in ${_OPTIONS_TARGETS}
. for prepost in pre post
_OPTIONS_${prepost}_${target}+= ${prepost}-${target}-${opt}-on
. endfor
. endfor
. else
. if defined(${opt}_USE_OFF)
. for option in ${${opt}_USE_OFF}
Expand Down Expand Up @@ -495,6 +507,11 @@ ${flags}+= ${${opt}_${flags}_OFF}
${deptype}_DEPENDS+= ${${opt}_${deptype}_DEPENDS_OFF}
. endif
. endfor
. for target in ${_OPTIONS_TARGETS}
. for prepost in pre post
_OPTIONS_${prepost}_${target}+= ${prepost}-${target}-${opt}-off
. endfor
. endfor
. endif
.endfor

Expand Down
63 changes: 20 additions & 43 deletions Mk/bsd.port.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4368,35 +4368,12 @@ all-depends-list:
@${ALL-DEPENDS-LIST}

ALL-DEPENDS-LIST= \
L="${_DEPEND_DIRS}"; \
checked=""; \
while [ -n "$$L" ]; do \
l=""; \
for d in $$L; do \
case $$checked in \
$$d\ *|*\ $$d\ *|*\ $$d) \
continue;; \
esac; \
checked="$$checked $$d"; \
if [ ! -d $$d ]; then \
${ECHO_MSG} "${PKGNAME}: \"$$d\" non-existent -- dependency list incomplete" >&2; \
continue; \
fi; \
${ECHO_CMD} $$d; \
if ! children=$$(cd $$d && ${MAKE} -V _DEPEND_DIRS); then\
${ECHO_MSG} "${PKGNAME}: \"$$d\" erroneous -- dependency list incomplete" >&2; \
continue; \
fi; \
for child in $$children; do \
case "$$checked $$l" in \
$$child\ *|*\ $$child\ *|*\ $$child) \
continue;; \
esac; \
l="$$l $$child"; \
done; \
done; \
L=$$l; \
done
${SETENV} dp_ALLDEPENDS="${_UNIFIED_DEPENDS}" \
dp_PORTSDIR="${PORTSDIR}" \
dp_MAKE="${MAKE}" \
dp_PKGNAME="${PKGNAME}" \
dp_SCRIPTSDIR="${SCRIPTSDIR}" \
${SH} ${SCRIPTSDIR}/all-depends-list.sh

CLEAN-DEPENDS-FULL= \
L="${_DEPEND_DIRS}"; \
Expand Down Expand Up @@ -5721,33 +5698,33 @@ _SANITY_SEQ= post-chroot pre-everything check-makefile \
_PKG_DEP= check-sanity
_PKG_SEQ= pkg-depends
_FETCH_DEP= pkg
_FETCH_SEQ= fetch-depends pre-fetch pre-fetch-script \
do-fetch fetch-specials post-fetch post-fetch-script
_FETCH_SEQ= fetch-depends pre-fetch ${_OPTIONS_pre_fetch} pre-fetch-script \
do-fetch fetch-specials post-fetch ${_OPTIONS_post_fetch} post-fetch-script
_EXTRACT_DEP= fetch
_EXTRACT_SEQ= check-build-conflicts extract-message checksum extract-depends \
clean-wrkdir ${WRKDIR} pre-extract pre-extract-script do-extract \
post-extract post-extract-script
clean-wrkdir ${WRKDIR} pre-extract ${_OPTIONS_pre_extract} pre-extract-script do-extract \
post-extract ${_OPTIONS_post_extract} post-extract-script
_PATCH_DEP= extract
_PATCH_SEQ= ask-license patch-message patch-depends pathfix dos2unix fix-shebang \
pre-patch \
pre-patch-script do-patch charsetfix-post-patch post-patch post-patch-script
pre-patch ${_OPTIONS_pre_patch} \
pre-patch-script do-patch charsetfix-post-patch post-patch ${_OPTIONS_post_patch} post-patch-script
_CONFIGURE_DEP= patch
_CONFIGURE_SEQ= build-depends lib-depends configure-message \
pre-configure pre-configure-script \
pre-configure ${_OPTIONS_pre_configure} pre-configure-script \
run-autotools do-autoreconf patch-libtool run-autotools-fixup do-configure \
post-configure post-configure-script
post-configure ${_OPTIONS_post_configure} post-configure-script
_BUILD_DEP= configure
_BUILD_SEQ= build-message pre-build pre-build-script do-build \
post-build post-build-script
_BUILD_SEQ= build-message pre-build ${_OPTIONS_pre_build} pre-build-script do-build \
post-build ${_OPTIONS_post_build} post-build-script

_STAGE_DEP= build
_STAGE_SEQ= stage-message stage-dir run-depends lib-depends apply-slist pre-install generate-plist \
_STAGE_SEQ= stage-message stage-dir run-depends lib-depends apply-slist pre-install ${_OPTIONS_pre_install} ${_OPTIONS_pre_stage} generate-plist \
pre-su-install
# ${POST_PLIST} must be after anything that modifies TMPPLIST
_STAGE_SEQ+= create-users-groups do-install \
kmod-post-install fix-perl-things \
webplugin-post-install post-install post-install-script \
move-uniquefiles patch-lafiles post-stage compress-man \
webplugin-post-install post-install ${_OPTIONS_post_install} post-install-script \
move-uniquefiles patch-lafiles post-stage ${_OPTIONS_post_stage} compress-man \
install-rc-script install-ldconfig-file install-license \
install-desktop-entries add-plist-info add-plist-docs \
add-plist-examples add-plist-data add-plist-post \
Expand All @@ -5760,7 +5737,7 @@ _INSTALL_SEQ= install-message run-depends lib-depends check-already-installed
_INSTALL_SUSEQ= fake-pkg security-check

_PACKAGE_DEP= stage
_PACKAGE_SEQ= package-message pre-package pre-package-script do-package post-package-script
_PACKAGE_SEQ= package-message pre-package ${_OPTIONS_pre_package} pre-package-script do-package ${_OPTIONS_post_package} post-package-script

# Enforce order for -jN builds

Expand Down

0 comments on commit 2bf36c7

Please sign in to comment.