Skip to content

Commit

Permalink
Framework: partially sync with upstream
Browse files Browse the repository at this point in the history
Taken from: HardenedBSD
  • Loading branch information
fichtner committed Jan 10, 2020
1 parent 1fb1bba commit e55ff61
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 56 deletions.
1 change: 0 additions & 1 deletion MOVED
Original file line number Diff line number Diff line change
Expand Up @@ -13287,7 +13287,6 @@ net-mgmt/pixilate||2019-10-16|Has expired: Unfetchable, unmaintained
net-mgmt/slate||2019-10-16|Has expired: Unfetchable, unmaintained
net-mgmt/weplab||2019-10-16|Has expired: Unfetchable, unmaintained
net-p2p/bnbt||2019-10-16|Has expired: Unfetchable, unmaintained
net-p2p/btpd||2019-10-16|Has expired: Unfetchable, unmaintained
net-p2p/gkremldk||2019-10-16|Has expired: Unfetchable, unmaintained
news/newscache||2019-10-16|Has expired: Unfetchable, unmaintained
news/nntpbtr||2019-10-16|Has expired: Unfetchable, unmaintained
Expand Down
10 changes: 9 additions & 1 deletion Mk/Scripts/qa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1004,10 +1004,18 @@ pkgmessage()
return 0
}

reinplace()
{
if [ -f ${REWARNFILE} ]; then
warn "Possible REINPLACE_CMD issues"
cat ${REWARNFILE}
fi
}

checks="shebang symlinks paths stripped desktopfileutils sharedmimeinfo"
checks="$checks suidfiles libtool libperl prefixvar baselibs terminfo"
checks="$checks proxydeps sonames perlcore no_arch gemdeps gemfiledeps flavors"
checks="$checks license depends_blacklist pkgmessage"
checks="$checks license depends_blacklist pkgmessage reinplace"

ret=0
cd ${STAGEDIR} || exit 1
Expand Down
2 changes: 1 addition & 1 deletion Mk/Uses/charsetfix.mk
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ CHARSETFIX_MAKEFILEIN?= Makefile.in

_USES_patch+= 600:charsetfix-post-patch
charsetfix-post-patch:
@${FIND} ${WRKSRC} -name "${CHARSETFIX_MAKEFILEIN}" -type f | ${XARGS} ${REINPLACE_CMD} \
@${FIND} ${WRKSRC} -name "${CHARSETFIX_MAKEFILEIN}" -type f | ${XARGS} ${FRAMEWORK_REINPLACE_CMD} \
-e 's|need_charset_alias=true|need_charset_alias=false|g ; \
s|test -f $$(charset_alias)|false|g ;\
s|test -f $$(DESTDIR)$$(libdir)/charset.alias|false|g'
Expand Down
6 changes: 3 additions & 3 deletions Mk/Uses/gnome.mk
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ USE_LOCALE?= en_US.UTF-8
GNOME_MAKEFILEIN?= Makefile.in
SCROLLKEEPER_DIR= /var/db/rarian

referencehack_PRE_PATCH= ${FIND} ${WRKSRC} -name "Makefile.in" -type f | ${XARGS} ${REINPLACE_CMD} -e \
referencehack_PRE_PATCH= ${FIND} ${WRKSRC} -name "Makefile.in" -type f | ${XARGS} ${FRAMEWORK_REINPLACE_CMD} -e \
"s|test \"\$$\$$installfiles\" = '\$$(srcdir)/html/\*'|:|"

GNOME_HTML_DIR?= ${PREFIX}/share/doc
Expand Down Expand Up @@ -313,12 +313,12 @@ pygnome2_USE_GNOME_IMPL=libgnomeui pygtk2

intltool_BUILD_DEPENDS= ${LOCALBASE}/bin/intltool-extract:textproc/intltool

intlhack_PRE_PATCH= ${FIND} ${WRKSRC} -name "intltool-merge.in" | ${XARGS} ${REINPLACE_CMD} \
intlhack_PRE_PATCH= ${FIND} ${WRKSRC} -name "intltool-merge.in" | ${XARGS} ${FRAMEWORK_REINPLACE_CMD} \
's|mkdir $$lang or|mkdir $$lang, 0777 or| ; \
s|^push @INC, "/.*|push @INC, "${LOCALBASE}/share/intltool";| ; \
s|/usr/bin/iconv|${ICONV_CMD}|g ; \
s|unpack *[(]'"'"'U\*'"'"'|unpack ('"'"'C*'"'"'|' ; \
${FIND} ${WRKSRC} -name configure | ${XARGS} ${REINPLACE_CMD} \
${FIND} ${WRKSRC} -name configure | ${XARGS} ${FRAMEWORK_REINPLACE_CMD} \
's/DATADIRNAME=lib/DATADIRNAME=share/'
intlhack_USE_GNOME_IMPL=intltool

Expand Down
4 changes: 2 additions & 2 deletions Mk/Uses/kde.mk
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ KDE_FRAMEWORKS_VERSION?= 5.65.0
KDE_FRAMEWORKS_BRANCH?= stable

# Current KDE applications.
KDE_APPLICATIONS_VERSION?= 19.12.0
KDE_APPLICATIONS_SHLIB_VER?= 5.13.0
KDE_APPLICATIONS_VERSION?= 19.12.1
KDE_APPLICATIONS_SHLIB_VER?= 5.13.1
KDE_APPLICATIONS_BRANCH?= stable
# Upstream moves old software to Attic/. Specify the newest applications release there.
# Only the major version is used for the comparison.
Expand Down
2 changes: 2 additions & 0 deletions Mk/Uses/linux.mk
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ _linux_${linux_ARGS}_icu= linux-${linux_ARGS}-icu>0:devel/linux-${linux_ARGS}-i
_linux_${linux_ARGS}_jasper= linux-${linux_ARGS}-jasper-libs>0:graphics/linux-${linux_ARGS}-jasper
_linux_c7_jbigkit= linux-c7-jbigkit-libs>0:graphics/linux-c7-jbigkit
_linux_${linux_ARGS}_jpeg= linux-${linux_ARGS}-jpeg>0:graphics/linux-${linux_ARGS}-jpeg
_linux_c7_libaio= linux-c7-libaio>0:devel/linux-c7-libaio
_linux_${linux_ARGS}_libasyncns= linux-${linux_ARGS}-libasyncns>0:dns/linux-${linux_ARGS}-libasyncns
_linux_c7_libaudiofile= linux-c7-audiofile>0:audio/linux-c7-audiofile
_linux_c7_libdrm= linux-c7-libdrm>0:graphics/linux-c7-libdrm
Expand All @@ -105,6 +106,7 @@ _linux_c7_make= linux-c7-make>0:devel/linux-c7-make
_linux_c7_nettle= linux-c7-nettle>0:security/linux-c7-nettle
_linux_${linux_ARGS}_nspr= linux-${linux_ARGS}-nspr>0:devel/linux-${linux_ARGS}-nspr
_linux_${linux_ARGS}_nss= linux-${linux_ARGS}-nss>0:security/linux-${linux_ARGS}-nss
_linux_c7_numactl-libs= linux-c7-numactl-libs>0:sysutils/linux-c7-numactl-libs
_linux_${linux_ARGS}_openal-soft= linux-${linux_ARGS}-openal-soft>0:audio/linux-${linux_ARGS}-openal-soft
_linux_${linux_ARGS}_openldap= linux-${linux_ARGS}-openldap>0:net/linux-${linux_ARGS}-openldap
_linux_c7_openmotif= linux-c7-motif>0:x11-toolkits/linux-c7-openmotif
Expand Down
4 changes: 2 additions & 2 deletions Mk/Uses/pathfix.mk
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ _USES_patch+= 190:pathfix
pathfix:
.if ${USES:Mcmake*}
.for file in ${PATHFIX_CMAKELISTSTXT}
@${FIND} ${PATHFIX_WRKSRC} -name "${file}" -type f | ${XARGS} ${REINPLACE_CMD} -e \
@${FIND} ${PATHFIX_WRKSRC} -name "${file}" -type f | ${XARGS} ${FRAMEWORK_REINPLACE_CMD} -e \
's|[{]CMAKE_INSTALL_LIBDIR[}]/pkgconfig|{CMAKE_INSTALL_PREFIX}/libdata/pkgconfig|g ; \
s|[{]CMAKE_INSTALL_DATAROOTDIR[}]/pkgconfig|{CMAKE_INSTALL_PREFIX}/libdata/pkgconfig|g ; \
s|[{]INSTALL_LIB_DIR[}]/pkgconfig|{CMAKE_INSTALL_PREFIX}/libdata/pkgconfig|g ; \
Expand All @@ -43,7 +43,7 @@ pathfix:
.endfor
.else
.for file in ${PATHFIX_MAKEFILEIN}
@${FIND} ${PATHFIX_WRKSRC} -name "${file}" -type f | ${XARGS} ${REINPLACE_CMD} -e \
@${FIND} ${PATHFIX_WRKSRC} -name "${file}" -type f | ${XARGS} ${FRAMEWORK_REINPLACE_CMD} -e \
's|[(]libdir[)]/locale|(prefix)/share/locale|g ; \
s|[(]libdir[)]/pkgconfig|(prefix)/libdata/pkgconfig|g ; \
s|[(]LIBDIR[)]/pkgconfig|(PREFIX)/libdata/pkgconfig|g ; \
Expand Down
45 changes: 2 additions & 43 deletions Mk/Uses/python.mk
Original file line number Diff line number Diff line change
Expand Up @@ -330,26 +330,7 @@ DEV_ERROR+= "USES=python:2 is no longer supported, use USES=python:2.7"
DEV_ERROR+= "USES=python:3 is no longer supported, use USES=python:3.5+ or an appropriate version range"
.endif # ${_PYTHON_ARGS} == "2"

.if defined(PYTHON_VERSION)
# A port/user requests a specific python version for its dependencies via
# DEPENDS_ARGS, since it requires the specific python version itself.
# Several things can happen now:
# a) the dependency supports the requested version -> everything's fine
# b) the dependency does not support the requested version
# 1) the dependency works in a way that the different python
# versions do not matter -> everything's fine
# 2) the dependency is likely to break due to the conflict
# nothing's fine
#
# b.2) needs to be resolved. Due to the complexity of how different pieces of
# software are built, we can't solve this automatically. Instead, let's assume
# that maintainers know what they are doing and assume PYTHON_VERSION to be a
# hint. Just warn maintainers, if the versions do not match
# (_PYTHON_VERSION_NONSUPPORTED).
_PYTHON_VERSION:= ${PYTHON_VERSION:S/^python//}
.else
_PYTHON_VERSION:= ${PYTHON_DEFAULT}
.endif # defined(PYTHON_VERSION)

# Validate Python version whether it meets the version restriction.
_PYTHON_VERSION_CHECK:= ${_PYTHON_ARGS:C/^([1-9]\.[0-9])$/\1-\1/}
Expand All @@ -374,10 +355,6 @@ _PYTHON_VERSION_NONSUPPORTED= ${_PYTHON_VERSION_MAXIMUM} at most

# If we have an unsupported version of Python, try another.
.if defined(_PYTHON_VERSION_NONSUPPORTED)
.if defined(PYTHON_VERSION) || defined(PYTHON_CMD)
_PV:= ${_PYTHON_VERSION} # preserve the specified python version
IGNORE= needs Python ${_PYTHON_VERSION_NONSUPPORTED}, but ${_PV} was specified
.endif # defined(PYTHON_VERSION) || defined(PYTHON_CMD)
.undef _PYTHON_VERSION
.for ver in ${PYTHON2_DEFAULT} ${PYTHON3_DEFAULT} ${_PYTHON_VERSIONS}
__VER= ${ver}
Expand Down Expand Up @@ -454,25 +431,7 @@ PKGNAMESUFFIX= ${PYTHON_PKGNAMESUFFIX}
# - From PYTHON_DEFAULT
PY_FLAVOR= py${_PYTHON_VERSION:S/.//}

# Pass PYTHON_VERSION down the dependency chain. This ensures that
# port A -> B -> C all will use the same python version and do not
# try to find a different one, if the passed version fits into
# the supported version range.
PYTHON_VERSION?= python${_PYTHON_VERSION}
.if !defined(PYTHON_NO_DEPENDS) && \
${PYTHON_VERSION} != python${PYTHON_DEFAULT}
DEPENDS_ARGS+= PYTHON_VERSION=${PYTHON_VERSION}
.endif

# NOTE:
#
# PYTHON_VERSION will hold whatever is passed down the dependency chain.
# If a user runs `make PYTHON_VERSION=python3.5, PYTHON_VERSION will be
# set to 'python3.5'. A port however may require a different version,
# which is stored (above) in _PYTHON_VERSION.
# Every python bit below hence should use python${_PYTHON_VERSION}, since
# this is the value, the _port_ requires
#
PYTHON_VERSION= python${_PYTHON_VERSION}

# Got the correct python version, set some publicly accessible variables
PYTHON_VER= ${_PYTHON_VERSION}
Expand Down Expand Up @@ -557,7 +516,7 @@ DEV_WARNING+= "USE_PYTHON=concurrent when only one of Python 2 or 3 is supported
_USES_POST+= uniquefiles:dirs
.if defined(_PYTHON_FEATURE_FLAVORS) && ${FLAVOR} == ${FLAVORS:[1]}
UNIQUE_DEFAULT_LINKS= yes
.elif !defined(_PYTHON_FEATURE_FLAVORS) && ${PYTHON_VERSION} == python${PYTHON_DEFAULT}
.elif !defined(_PYTHON_FEATURE_FLAVORS) && ${_PYTHON_VERSION} == ${PYTHON_DEFAULT}
UNIQUE_DEFAULT_LINKS= yes
.else
UNIQUE_DEFAULT_LINKS= no
Expand Down
4 changes: 1 addition & 3 deletions Mk/Uses/zope.mk
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ _ZOPE_VERSION= ${_ZOPE_PORTBRANCH} # just to avoid version sanity checking.

ZOPE_VERSION?= ${_ZOPE_VERSION}

.if !defined(PYTHON_VERSION)
PYTHON_VERSION= ${_PYTHON_VER_REQUIRED}
.elif ${PYTHON_VERSION} != ${_PYTHON_VER_REQUIRED}
.if ${PYTHON_VERSION} != ${_PYTHON_VER_REQUIRED}
IGNORE+= Zope requires Python ${_PYTHON_VER_REQUIRED}.\
But you or a port dependency specified ${PYTHON_VERSION}
.endif # !defined(PYTHON_VERSION)
Expand Down
7 changes: 7 additions & 0 deletions Mk/bsd.port.mk
Original file line number Diff line number Diff line change
Expand Up @@ -1032,6 +1032,7 @@ NOTPHONY?=
FLAVORS?=
FLAVOR?=
OVERLAYS?=
REWARNFILE?= ${WRKDIR}/reinplace_warnings.txt
# Disallow forced FLAVOR as make argument since we cannot change it to the
# proper default.
.if empty(FLAVOR) && !empty(.MAKEOVERRIDES:MFLAVOR)
Expand Down Expand Up @@ -1669,6 +1670,7 @@ QA_ENV+= STAGEDIR=${STAGEDIR} \
PREFIX=${PREFIX} \
LINUXBASE=${LINUXBASE} \
LOCALBASE=${LOCALBASE} \
REWARNFILE=${REWARNFILE} \
"STRIP=${STRIP}" \
TMPPLIST=${TMPPLIST} \
CURDIR='${.CURDIR}' \
Expand Down Expand Up @@ -2081,7 +2083,12 @@ MAKE_ENV+= LANG=${USE_LOCALE} LC_ALL=${USE_LOCALE}

# Macro for doing in-place file editing using regexps
REINPLACE_ARGS?= -i.bak
.if defined(DEVELOPER)
REINPLACE_CMD?= ${SETENV} WRKSRC=${WRKSRC} REWARNFILE=${REWARNFILE} ${PORTSDIR}/Tools/scripts/sed_checked.sh
.else
REINPLACE_CMD?= ${SED} ${REINPLACE_ARGS}
.endif
FRAMEWORK_REINPLACE_CMD?= ${SED} -i.bak

# Names of cookies used to skip already completed stages
EXTRACT_COOKIE?= ${WRKDIR}/.extract_done.${PORTNAME}.${PREFIX:S/\//_/g}
Expand Down
13 changes: 13 additions & 0 deletions Tools/scripts/sed_checked.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

set -e
/usr/bin/sed -i.bak "$@"
for x in "${@}" ; do
if [ -f "${x}" ]; then
if cmp -s "${x}" "${x}".bak ; then
if [ ! -z "${REWARNFILE}" ]; then
echo sed failed: backup file same as original: ${x#${WRKSRC}/} >> ${REWARNFILE}
fi
fi
fi
done

0 comments on commit e55ff61

Please sign in to comment.