gcc: add support for SOURCE_DATE_EPOCH environment

+ Create symlinks from gcc/patches/libcpp-source_date_epoch.patch to cross-*/files/
+ Make all the _apply_patch() functions the same
This commit is contained in:
Jürgen Buchmüller 2016-03-08 05:22:12 +01:00
parent f0affd9a3b
commit c459dade15
48 changed files with 257 additions and 99 deletions

View file

@ -1,27 +0,0 @@
# Remove leaked CFLAGS and CXXFLAGS parts which were defined
# by common/hooks/pre-configure/03-timestamp-macros.sh
# from shell scripts, perl scripts, package config files etc.
hook() {
local f mimetype
local strip=" -Wno-builtin-macro-redefined -include${XBPS_BUILDDIR}/\.xbps-.*/timestamp-macros\.h"
[ -n "$XBPS_USE_BUILD_MTIME" ] && return 0
[ -z "$SOURCE_DATE_EPOCH" ] && return 0
# Clean up shell scripts, perl files, pkgconfig files etc.
for f in $(grep -r -l -e "$strip" "$PKGDESTDIR" ); do
mimetype=$(file --mime-type "$f" | awk '{ print $2 }')
if [ "$mimetype" == "text/plain" -o \
"$mimetype" == "text/x-makefile" -o \
"$mimetype" == "text/x-shellscript" -o \
"$mimetype" == "application/xml" ]; then
sed -i "$f" -e "s;$strip;;"
msg_warn "Cleaned up ${f#${PKGDESTDIR}} ...\n"
else
# Unhandled mime-type file contains the $strip string
# E.g. binaries containing the build environment as a string
msg_warn "Can't clean ${f#${PKGDESTDIR}} (mime-type: $mimetype) ...\n"
fi
done
}