diff --git a/Mk/Scripts/qa.sh b/Mk/Scripts/qa.sh index 781143db972e..cb55befee64d 100644 --- a/Mk/Scripts/qa.sh +++ b/Mk/Scripts/qa.sh @@ -1,1066 +1,1065 @@ #!/bin/sh # MAINTAINER: portmgr@FreeBSD.org set -o pipefail if [ -z "${STAGEDIR}" -o -z "${PREFIX}" -o -z "${LOCALBASE}" ]; then echo "STAGEDIR, PREFIX, LOCALBASE required in environment." >&2 exit 1 fi [ -n "${DEBUG_MK_SCRIPTS}" -o -n "${DEBUG_MK_SCRIPTS_QA}" ] && set -x LF=$(printf '\nX') LF=${LF%X} notice() { echo "Notice: $*" >&2 } warn() { echo "Warning: $*" >&2 } err() { echo "Error: $*" >&2 } list_stagedir_elfs() { cd ${STAGEDIR} && find -s . -type f \( -perm +111 -o -name '*.so*' \) "$@" } shebangonefile() { local f interp interparg badinterp rc f="$*" rc=0 # whitelist some files case "${f}" in *.pm|*.pod|*.txt|${STAGEDIR}${LINUXBASE}/*) return 0 ;; esac interp=$(sed -n -e '1s/^#![[:space:]]*\([^[:space:]]*\).*/\1/p;2q' "${f}") badinterp="" case "${interp}" in "") ;; /bin/rc) # whitelist some interpreters ;; ${LOCALBASE}/bin/python|${PREFIX}/bin/python|${LOCALBASE}/bin/python2|${PREFIX}/bin/python2|${LOCALBASE}/bin/python3|${PREFIX}/bin/python3) badinterp="${interp}" ;; ${LINUXBASE}/*) ;; ${LOCALBASE}/bin/perl5.* | ${PREFIX}/bin/perl5.*) # lang/perl5* are allowed to have these shebangs. if ! expr ${PKGORIGIN} : '^lang/perl5.*' > /dev/null; then err "'${interp}' is an invalid shebang for '${f#${STAGEDIR}${PREFIX}/}' you must use ${LOCALBASE}/bin/perl." err "Either pass \${PERL} to the build or use USES=shebangfix" rc=1 fi ;; ${LOCALBASE}/*) ;; ${PREFIX}/*) ;; /bin/csh) ;; /bin/sh) ;; /bin/tcsh) ;; /usr/bin/awk) ;; /usr/bin/env) interparg=$(sed -n -e '1s/^#![[:space:]]*[^[:space:]]*[[:space:]]*\([^[:space:]]*\).*/\1/p;2q' "${f}") case "${interparg}" in python|python2|python3) badinterp="${interp} ${interparg}" ;; esac ;; /usr/bin/nawk) ;; /usr/bin/sed) ;; /usr/sbin/dtrace) ;; /usr/bin/make) ;; /usr/libexec/atf-sh) ;; *) badinterp="${interp}" ;; esac if [ -n "${badinterp}" ]; then err "'${badinterp}' is an invalid shebang you need USES=shebangfix for '${f#${STAGEDIR}${PREFIX}/}'" rc=1 fi return ${rc} } shebang() { local f l link rc rc=0 while read -r f; do # No results presents a blank line from heredoc. [ -z "${f}" ] && continue shebangonefile "${f}" || rc=1 # Use heredoc to avoid losing rc from find|while subshell done <<-EOF $(find ${STAGEDIR}${PREFIX} \ -type f -perm +111 2>/dev/null) EOF return ${rc} } baselibs() { local rc local found_openssl local file [ "${PKGBASE}" = "pkg" -o "${PKGBASE}" = "pkg-devel" ] && return while read -r f; do case ${f} in File:\ .*) file=${f#File: .} ;; *NEEDED*\[libarchive.so.[56]]) err "Bad linking on ${f##* } for ${file} please add USES=libarchive" rc=1 ;; *NEEDED*\[libedit.so.7]) err "Bad linking on ${f##* } for ${file} please add USES=libedit" rc=1 ;; *NEEDED*\[libcrypto.so.*]|*NEEDED*\[libssl.so.*]) found_openssl=1 ;; esac done <<-EOF $(list_stagedir_elfs -exec readelf -d {} + 2>/dev/null) EOF if ! list_stagedir_elfs | egrep -q 'lib(crypto|ssl).so*'; then if [ -z "${USESSSL}" -a -n "${found_openssl}" ]; then warn "you need USES=ssl" elif [ -n "${USESSSL}" -a -z "${found_openssl}" ]; then warn "you may not need USES=ssl" fi fi return ${rc} } symlinks() { local rc rc=0 # Split stat(1) result into 2 lines and read each line separately to # retain spaces in filenames. while read -r l; do # No results presents a blank line from heredoc. [ -z "${l}" ] && continue read -r link case "${link}" in ${STAGEDIR}*) err "Bad symlink '${l#${STAGEDIR}${PREFIX}/}' pointing inside the stage directory" rc=1 ;; /*) # Only warn for symlinks within the package. if [ -e "${STAGEDIR}${link}" ]; then warn "Bad symlink '${l#${STAGEDIR}}' pointing to an absolute pathname '${link}'" fi # Also warn if the symlink exists nowhere. if [ ! -e "${STAGEDIR}${link}" -a ! -e "${link}" ]; then warn "Symlink '${l#${STAGEDIR}}' pointing to '${link}' which does not exist in the stage directory or in localbase" fi ;; esac # Use heredoc to avoid losing rc from find|while subshell. done <<-EOF $(find ${STAGEDIR} -type l -exec stat -f "%N${LF}%Y" {} +) EOF return ${rc} } paths() { local rc rc=0 while read -r f; do # No results presents a blank line from heredoc. [ -z "${f}" ] && continue # Ignore false-positive/harmless files case "${f}" in */lib/ruby/gems/*) continue ;; */share/texmf-var/web2c/*/*.fmt) continue ;; */share/texmf-var/web2c/*/*.log) continue ;; esac err "'${f#${STAGEDIR}${PREFIX}/}' is referring to ${STAGEDIR}" rc=1 # Use heredoc to avoid losing rc from find|while subshell done <<-EOF $(find ${TMPPLIST} ${STAGEDIR} -type f -exec grep -l "${STAGEDIR}" {} +) EOF return ${rc} } # For now do not raise an error, just warnings stripped() { [ -x /usr/bin/file ] || return # this is fatal [ -n "${STRIP}" ] || return 0 # Split file and result into 2 lines and read separately to ensure # files with spaces are kept intact. # Using readelf -h ... /ELF Header:/ will match on all ELF files. find ${STAGEDIR} -type f ! -name '*.a' ! -name '*.o' \ -exec sh -c 'readelf -S -- /dev/null "$0" "$@" || :' -- {} + 2>/dev/null | awk ' /File:/ {sub(/File: /, "", $0); file=$0} /[[:space:]]\.debug_info[[:space:]]*PROGBITS/ {print file}' | while read -r f; do warn "'${f#${STAGEDIR}${PREFIX}/}' is not stripped consider trying INSTALL_TARGET=install-strip or using \${STRIP_CMD}" done } desktopfileutils() { if [ -z "${USESDESKTOPFILEUTILS}" ]; then grep -q MimeType= ${STAGEDIR}${PREFIX}/share/applications/*.desktop 2>/dev/null && warn "you need USES=desktop-file-utils" else grep -q MimeType= ${STAGEDIR}${PREFIX}/share/applications/*.desktop 2>/dev/null || warn "you may not need USES=desktop-file-utils" fi return 0 } sharedmimeinfo() { local f found found=0 for f in ${STAGEDIR}${PREFIX}/share/mime/packages/*.xml; do [ "${f}" = "${STAGEDIR}${PREFIX}/share/mime/packages/*.xml" ] && break #no matches [ "${f}" = "${STAGEDIR}${PREFIX}/share/mime/packages/freedesktop.org.xml" ] && continue found=1 break done if [ -z "${USESSHAREDMIMEINFO}" -a ${found} -eq 1 ]; then warn "you need USES=shared-mime-info" elif [ -n "${USESSHAREDMIMEINFO}" -a ${found} -eq 0 ]; then warn "you may not need USES=shared-mime-info" fi return 0 } suidfiles() { local filelist filelist=$(find ${STAGEDIR} -type f \ \( -perm -u+x -or -perm -g+x -or -perm -o+x \) \ \( -perm -u+s -or -perm -g+s \)) if [ -n "${filelist}" ]; then warn "setuid files in the stage directory (are these necessary?):" ls -liTd ${filelist} fi return 0 } libtool() { if [ -z "${USESLIBTOOL}" ]; then find ${STAGEDIR} -name '*.la' | while read -r f; do if grep -q 'libtool library' "${f}"; then err ".la libraries found, port needs USES=libtool" return 1 fi done # The return above continues here. fi } libperl() { local has_some_libperl_so files found if [ -n "${SITE_ARCH_REL}" -a -d "${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}" ]; then has_some_libperl_so=0 files=0 while read -r f; do # No results presents a blank line from heredoc. [ -z "${f}" ] && continue files=$((files+1)) found=$(readelf -d ${f} | awk "BEGIN {libperl=1} /NEEDED.*${LIBPERL}/ { libperl = 0 } END {print libperl} ") case "${found}" in 1) warn "${f} is not linked with ${LIBPERL}, not respecting lddlflags?" ;; 0) has_some_libperl_so=1 ;; esac # Use heredoc to avoid losing rc from find|while subshell done <<-EOT $(find ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL} -name '*.so') EOT if [ ${files} -gt 0 -a ${has_some_libperl_so} -eq 0 ]; then err "None of the ${files} .so in ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL} are linked with ${LIBPERL}, see above for the full list." return 1 else return 0 fi fi } prefixvar() { if [ ${PREFIX} != ${LINUXBASE} -a -d ${STAGEDIR}${PREFIX}/var ]; then warn "port uses ${PREFIX}/var instead of /var" fi } terminfo() { local f found for f in ${STAGEDIR}${PREFIX}/share/misc/*.terminfo; do [ "${f}" = "${STAGEDIR}${PREFIX}/share/misc/*.terminfo" ] && break #no matches found=1 break done for f in ${STAGEDIR}${PREFIX}/share/misc/terminfo.db*; do [ "${f}" = "${STAGEDIR}${PREFIX}/share/misc/terminfo.db*" ] && break #no matches found=1 break done if [ -z "${USESTERMINFO}" -a -n "${found}" ]; then warn "you need USES=terminfo" elif [ -n "${USESTERMINFO}" -a -z "${found}" ]; then warn "you may not need USES=terminfo" fi return 0 } listcontains() { local str lst elt str=$1 lst=$2 for elt in ${lst} ; do if [ ${elt} = ${str} ]; then return 0 fi done return 1 } proxydeps_suggest_uses() { local pkg=$1 local lib_file=$2 # miscellaneous USE clauses if [ ${pkg} = 'devel/gettext-runtime' ]; then warn "you need USES+=gettext-runtime" elif [ ${pkg} = 'databases/sqlite3' ]; then warn "you need USES+=sqlite" elif [ ${pkg} = 'databases/sqlite2' ]; then warn "you need USES+=sqlite:2" # Gnome -> same as port # grep LIB_DEPENDS= Mk/Uses/gnome.mk |sed -e 's|\(.*\)_LIB_DEPENDS.*:\(.*\)\/\(.*\)|[ "\1" = "\3" ] \&\& echo "\\${pkg} = \\\"\2/\3\\\" -o \\\\"|'|sort|sh elif [ ${pkg} = "accessibility/atk" -o \ ${pkg} = "accessibility/atkmm" -o \ ${pkg} = "graphics/cairo" -o \ ${pkg} = "graphics/cairomm" -o \ ${pkg} = "devel/dconf" -o \ ${pkg} = "devel/gconf2" -o \ - ${pkg} = "devel/gconfmm26" -o \ ${pkg} = "devel/glib20" -o \ ${pkg} = "devel/glibmm" -o \ ${pkg} = "audio/gsound" -o \ ${pkg} = "x11-toolkits/gtk20" -o \ ${pkg} = "x11-toolkits/gtk30" -o \ ${pkg} = "www/gtkhtml4" -o \ ${pkg} = "x11-toolkits/gtkmm20" -o \ ${pkg} = "x11-toolkits/gtkmm24" -o \ ${pkg} = "x11-toolkits/gtkmm30" -o \ ${pkg} = "x11-toolkits/gtksourceview2" -o \ ${pkg} = "x11-toolkits/gtksourceview3" -o \ ${pkg} = "x11-toolkits/gtksourceviewmm3" -o \ ${pkg} = "databases/libgda5" -o \ ${pkg} = "databases/libgda5-ui" -o \ ${pkg} = "databases/libgdamm5" -o \ ${pkg} = "devel/libglade2" -o \ ${pkg} = "graphics/libgnomecanvas" -o \ ${pkg} = "x11/libgnomekbd" -o \ ${pkg} = "devel/libgsf" -o \ ${pkg} = "graphics/librsvg2" -o \ ${pkg} = "devel/libsigc++12" -o \ ${pkg} = "devel/libsigc++20" -o \ ${pkg} = "x11-toolkits/libwnck" -o \ ${pkg} = "x11-toolkits/libwnck3" -o \ ${pkg} = "textproc/libxml++26" -o \ ${pkg} = "textproc/libxml2" -o \ ${pkg} = "textproc/libxslt" -o \ ${pkg} = "x11-toolkits/pango" -o \ ${pkg} = "x11-toolkits/pangomm" -o \ ${pkg} = "x11-toolkits/pangox-compat" -o \ ${pkg} = "x11-toolkits/vte" -o \ ${pkg} = "x11-toolkits/vte3" ]; then warn "you need USE_GNOME+=${pkg#*/}" # Gnome different as port # grep LIB_DEPENDS= Mk/Uses/gnome.mk |sed -e 's|\(.*\)_LIB_DEPENDS.*:\(.*\)\/\(.*\)|[ "\1" = "\3" ] \|\| echo "elif [ \\${pkg} = \\\"\2/\3\\\" ]; then; warn \\\"you need USE_GNOME+=\1\\\""|'|sort|sh elif [ ${pkg} = "databases/evolution-data-server" ]; then warn "you need USE_GNOME+=evolutiondataserver3" elif [ ${pkg} = "graphics/gdk-pixbuf" ]; then warn "you need USE_GNOME+=gdkpixbuf" elif [ ${pkg} = "graphics/gdk-pixbuf2" ]; then warn "you need USE_GNOME+=gdkpixbuf" elif [ ${pkg} = "x11/gnome-desktop" ]; then warn "you need USE_GNOME+=gnomedesktop3" elif [ ${pkg} = "devel/gobject-introspection" ]; then warn "you need USE_GNOME+=introspection" elif [ ${pkg} = "graphics/libart_lgpl" ]; then warn "you need USE_GNOME+=libartlgpl2" elif [ ${pkg} = "devel/libIDL" ]; then warn "you need USE_GNOME+=libidl" elif [ ${pkg} = "x11-fm/nautilus" ]; then warn "you need USE_GNOME+=nautilus4" elif [ ${pkg} = "graphics/librsvg2-rust" ]; then warn "you need USE_GNOME+=librsvg2" # mate # grep LIB_DEPENDS= Mk/Uses/mate.mk |sed -e 's|\(.*\)_LIB_DEPENDS.*:\(.*\)\/\(.*\)|elif [ ${pkg} = "\2/\3" ]; then warn "you need USE_MATE+=\1"|' elif [ ${pkg} = "x11-fm/caja" ]; then warn "you need USE_MATE+=caja" elif [ ${pkg} = "sysutils/mate-control-center" ]; then warn "you need USE_MATE+=controlcenter" elif [ ${pkg} = "x11/mate-desktop" ]; then warn "you need USE_MATE+=desktop" elif [ ${pkg} = "x11/libmatekbd" ]; then warn "you need USE_MATE+=libmatekbd" elif [ ${pkg} = "net/libmateweather" ]; then warn "you need USE_MATE+=libmateweather" elif [ ${pkg} = "x11-wm/marco" ]; then warn "you need USE_MATE+=marco" elif [ ${pkg} = "x11/mate-menus" ]; then warn "you need USE_MATE+=menus" elif [ ${pkg} = "x11/mate-panel" ]; then warn "you need USE_MATE+=panel" elif [ ${pkg} = "sysutils/mate-polkit" ]; then warn "you need USE_MATE+=polkit" # KDE # grep -B1 _LIB= Mk/Uses/kde.mk | grep _PORT=|sed -e 's/^kde-\(.*\)_PORT=[[:space:]]*\([^[:space:]]*\).*/elif [ ${pkg} = "\2" ]; then warn "you need to use USE_KDE+=\1"/' # KDE Applications elif [ ${pkg} = "net/akonadi-contacts" ]; then warn "you need to use USE_KDE+=akonadicontacts" elif [ ${pkg} = "deskutils/akonadi-import-wizard" ]; then warn "you need to use USE_KDE+=akonadiimportwizard" elif [ ${pkg} = "net/akonadi-mime" ]; then warn "you need to use USE_KDE+=akonadimime" elif [ ${pkg} = "net/akonadi-notes" ]; then warn "you need to use USE_KDE+=akonadinotes" elif [ ${pkg} = "net/akonadi-calendar" ]; then warn "you need to use USE_KDE+=akonadicalendar" elif [ ${pkg} = "net/akonadi-search" ]; then warn "you need to use USE_KDE+=akonadisearch" elif [ ${pkg} = "net/calendarsupport" ]; then warn "you need to use USE_KDE+=calendarsupport" elif [ ${pkg} = "net/kcalcore" ]; then warn "you need to use USE_KDE+=calendarcore" elif [ ${pkg} = "net/kcalutils" ]; then warn "you need to use USE_KDE+=calendarutils" elif [ ${pkg} = "net/kcontacts" ]; then warn "you need to use USE_KDE+=contacts" elif [ ${pkg} = "net/eventviews" ]; then warn "you need to use USE_KDE+=eventviews" elif [ ${pkg} = "net/libkgapi" ]; then warn "you need to use USE_KDE+=gapi" elif [ ${pkg} = "deskutils/grantleetheme" ]; then warn "you need to use USE_KDE+=grantleetheme" elif [ ${pkg} = "net/libgravatar" ]; then warn "you need to use USE_KDE+=gravatar" elif [ ${pkg} = "net/kidentitymanagement" ]; then warn "you need to use USE_KDE+=identitymanagement" elif [ ${pkg} = "net/kimap" ]; then warn "you need to use USE_KDE+=imap" elif [ ${pkg} = "net/incidenceeditor" ]; then warn "you need to use USE_KDE+=incidenceeditor" elif [ ${pkg} = "deskutils/kdepim-apps-libs" ]; then warn "you need to use USE_KDE+=kdepim-apps-libs" elif [ ${pkg} = "net/kitinerary" ]; then warn "you need to use USE_KDE+=kitinerary" elif [ ${pkg} = "net/kontactinterface" ]; then warn "you need to use USE_KDE+=kontactinterface" elif [ ${pkg} = "net/kf5-kdav" ]; then warn "you need to use USE_KDE+=kdav" elif [ ${pkg} = "security/kpkpass" ]; then warn "you need to use USE_KDE+=kpkpass" elif [ ${pkg} = "net/ksmtp" ]; then warn "you need to use USE_KDE+=ksmtp" elif [ ${pkg} = "net/kldap" ]; then warn "you need to use USE_KDE+=ldap" elif [ ${pkg} = "deskutils/libkdepim" ]; then warn "you need to use USE_KDE+=libkdepim" elif [ ${pkg} = "security/libkleo" ]; then warn "you need to use USE_KDE+=libkleo" elif [ ${pkg} = "net/libksieve" ]; then warn "you need to use USE_KDE+=libksieve" elif [ ${pkg} = "net/mailcommon" ]; then warn "you need to use USE_KDE+=mailcommon" elif [ ${pkg} = "net/mailimporter" ]; then warn "you need to use USE_KDE+=mailimporter" elif [ ${pkg} = "net/kmailtransport" ]; then warn "you need to use USE_KDE+=mailtransport" elif [ ${pkg} = "net/kmbox" ]; then warn "you need to use USE_KDE+=mbox" elif [ ${pkg} = "net/messagelib" ]; then warn "you need to use USE_KDE+=messagelib" elif [ ${pkg} = "net/kmime" ]; then warn "you need to use USE_KDE+=mime" elif [ ${pkg} = "net/pimcommon" ]; then warn "you need to use USE_KDE+=pimcommon" elif [ ${pkg} = "net/kpimtextedit" ]; then warn "you need to use USE_KDE+=pimtextedit" elif [ ${pkg} = "net/ktnef" ]; then warn "you need to use USE_KDE+=tnef" elif [ ${pkg} = "databases/akonadi" ]; then warn "you need to use USE_KDE+=akonadi" elif [ ${pkg} = "sysutils/baloo-widgets" ]; then warn "you need to use USE_KDE+=baloo-widgets" elif [ ${pkg} = "audio/libkcddb" ]; then warn "you need to use USE_KDE+=libkcddb" elif [ ${pkg} = "audio/libkcompactdisc" ]; then warn "you need to use USE_KDE+=libkcompactdisc" elif [ ${pkg} = "graphics/libkdcraw" ]; then warn "you need to use USE_KDE+=libkdcraw" elif [ ${pkg} = "games/libkdegames" ]; then warn "you need to use USE_KDE+=libkdegames" elif [ ${pkg} = "misc/libkeduvocdocument" ]; then warn "you need to use USE_KDE+=libkeduvocdocument" elif [ ${pkg} = "graphics/libkexiv2" ]; then warn "you need to use USE_KDE+=libkexiv2" elif [ ${pkg} = "graphics/libksane" ]; then warn "you need to use USE_KDE+=libksane" elif [ ${pkg} = "astro/marble" ]; then warn "you need to use USE_KDE+=marble" elif [ ${pkg} = "graphics/okular" ]; then warn "you need to use USE_KDE+=okular" # KDE Plasma elif [ ${pkg} = "x11/plasma5-kactivitymanagerd" ]; then warn "you need to use USE_KDE+=activitymanagerd" elif [ ${pkg} = "x11-wm/plasma5-kdecoration" ]; then warn "you need to use USE_KDE+=decoration" elif [ ${pkg} = "devel/plasma5-khotkeys" ]; then warn "you need to use USE_KDE+=hotkeys" elif [ ${pkg} = "sysutils/plasma5-kmenuedit" ]; then warn "you need to use USE_KDE+=kmenuedit" elif [ ${pkg} = "security/plasma5-kscreenlocker" ]; then warn "you need to use USE_KDE+=kscreenlocker" elif [ ${pkg} = "x11/plasma5-libkscreen" ]; then warn "you need to use USE_KDE+=libkscreen" elif [ ${pkg} = "sysutils/plasma5-libksysguard" ]; then warn "you need to use USE_KDE+=libksysguard" elif [ ${pkg} = "deskutils/plasma5-milou" ]; then warn "you need to use USE_KDE+=milou" elif [ ${pkg} = "x11-themes/plasma5-oxygen" ]; then warn "you need to use USE_KDE+=oxygen" elif [ ${pkg} = "x11/plasma5-plasma-workspace" ]; then warn "you need to use USE_KDE+=plasma-workspace" elif [ ${pkg} = "sysutils/plasma5-powerdevil" ]; then warn "you need to use USE_KDE+=powerdevil" # KDE Frameworks elif [ ${pkg} = "x11-toolkits/kf5-attica" ]; then warn "you need to use USE_KDE+=attica" elif [ ${pkg} = "sysutils/kf5-baloo" ]; then warn "you need to use USE_KDE+=baloo" elif [ ${pkg} = "x11/kf5-frameworkintegration" ]; then warn "you need to use USE_KDE+=frameworkintegration" elif [ ${pkg} = "devel/kf5-kcmutils" ]; then warn "you need to use USE_KDE+=kcmutils" elif [ ${pkg} = "devel/kf5-kdeclarative" ]; then warn "you need to use USE_KDE+=kdeclarative" elif [ ${pkg} = "x11/kf5-kded" ]; then warn "you need to use USE_KDE+=kded" elif [ ${pkg} = "x11/kf5-kdelibs4support" ]; then warn "you need to use USE_KDE+=kdelibs4support" elif [ ${pkg} = "security/kf5-kdesu" ]; then warn "you need to use USE_KDE+=kdesu" elif [ ${pkg} = "www/kf5-khtml" ]; then warn "you need to use USE_KDE+=khtml" elif [ ${pkg} = "devel/kf5-kio" ]; then warn "you need to use USE_KDE+=kio" elif [ ${pkg} = "lang/kf5-kross" ]; then warn "you need to use USE_KDE+=kross" elif [ ${pkg} = "x11/kf5-plasma-framework" ]; then warn "you need to use USE_KDE+=plasma-framework" elif [ ${pkg} = "graphics/kf5-prison" ]; then warn "you need to use USE_KDE+=prison" elif [ ${pkg} = "misc/kf5-purpose" ]; then warn "you need to use USE_KDE+=purpose" elif [ ${pkg} = "devel/kf5-solid" ]; then warn "you need to use USE_KDE+=solid" elif [ ${pkg} = "textproc/kf5-sonnet" ]; then warn "you need to use USE_KDE+=sonnet" elif [ ${pkg} = "net/kf5-syndication" ]; then warn "you need to use USE_KDE+=syndication" elif [ ${pkg} = "textproc/kf5-syntax-highlighting" ]; then warn "you need to use USE_KDE+=syntaxhighlighting" elif [ ${pkg} = "devel/kf5-threadweaver" ]; then warn "you need to use USE_KDE+=threadweaver" elif expr ${pkg} : '.*/kf5-.*' > /dev/null; then warn "you need USE_KDE+=$(echo ${pkg} | sed -E 's|.*/kf5-k||')" # GStreamer 0.10 elif [ ${pkg} = "multimedia/gstreamer" ]; then warn "you need to use USE_GSTREAMER+=yes" elif [ ${pkg} = "multimedia/gstreamer-plugins" ]; then warn "you need to use USE_GSTREAMER+=yes" elif [ ${pkg} = "multimedia/gstreamer-plugins-bad" ]; then warn "you need to use USE_GSTREAMER+=bad" # GStreamer 1 elif [ ${pkg} = "multimedia/gstreamer1" ]; then warn "you need to use USE_GSTREAMER1+=yes" elif [ ${pkg} = "multimedia/gstreamer1-plugins" ]; then warn "you need to use USE_GSTREAMER1+=yes" elif [ ${pkg} = "multimedia/gstreamer1-plugins-bad" ]; then warn "you need to use USE_GSTREAMER1+=bad" # boost related elif [ ${pkg} = "devel/boost-python-libs" ]; then warn "you need to add LIB_DEPENDS+=\${PY_BOOST} and maybe USES+=python" # sdl-related elif [ ${pkg} = 'devel/sdl12' ]; then warn "you need USE_SDL+=sdl" elif echo ${pkg} | grep -E '/sdl_(console|gfx|image|mixer|mm|net|pango|sound|ttf)$' > /dev/null; then warn "you need USE_SDL+=$(echo ${pkg} | sed -E 's|.*/sdl_||')" elif [ ${pkg} = 'devel/sdl20' ]; then warn "you need USE_SDL+=sdl2" elif echo ${pkg} | grep -E '/sdl2_(gfx|image|mixer|net|ttf)$' > /dev/null; then warn "you need USE_SDL+=$(echo ${pkg} | sed -E 's|.*/sdl2_||')2" # gl-related elif expr ${lib_file} : "${LOCALBASE}/lib/libGL.so.*$" > /dev/null; then warn "you need USE_GL+=gl" elif expr ${lib_file} : "${LOCALBASE}/lib/libGLX.so.*$" > /dev/null; then warn "you need USE_GL+=gl" elif expr ${lib_file} : "${LOCALBASE}/lib/libgbm.so.*$" > /dev/null; then warn "you need USE_GL+=gbm" elif expr ${lib_file} : "${LOCALBASE}/lib/libGLESv2.so.*$" > /dev/null; then warn "you need USE_GL+=glesv2" elif expr ${lib_file} : "${LOCALBASE}/lib/libEGL.so.*$" > /dev/null; then warn "you need USE_GL+=egl" elif expr ${lib_file} : "${LOCALBASE}/lib/libOpenGL.so.*$" > /dev/null; then warn "you need USE_GL+=opengl" elif [ ${pkg} = 'graphics/glew' ]; then warn "you need USE_GL+=glew" elif [ ${pkg} = 'graphics/libGLU' ]; then warn "you need USE_GL+=glu" elif [ ${pkg} = 'graphics/libGLw' ]; then warn "you need USE_GL+=glw" elif [ ${pkg} = 'graphics/freeglut' ]; then warn "you need USE_GL+=glut" # Xorg-libraries: this should be by XORG_MODULES @ bsd.xorg.mk elif echo ${pkg} | grep -E '/lib(X11|Xau|Xdmcp|Xext|SM|ICE|Xfixes|Xft|Xdamage|Xcomposite|Xcursor|Xinerama|Xmu|Xmuu|Xpm|Xt|Xtst|Xi|Xrandr|Xrender|Xres|XScrnSaver|Xv|Xxf86vm|Xxf86dga|Xxf86misc|xcb)$' > /dev/null; then warn "you need USE_XORG+=$(echo ${pkg} | sed -E 's|.*/lib||' | tr '[:upper:]' '[:lower:]')" elif [ ${pkg} = 'x11/pixman' ]; then warn "you need USE_XORG+=pixman" # Qt5 elif expr ${pkg} : '.*/qt5-.*' > /dev/null; then warn "you need USES=qt:5 and USE_QT+=$(echo ${pkg} | sed -E 's|.*/qt5-||')" # Qt6 elif expr ${pkg} : '.*/qt6-.*' > /dev/null; then warn "you need USES=qt:6 and USE_QT+=$(echo ${pkg} | sed -E 's|.*/qt6-||')" # MySQL elif expr ${lib_file} : "${LOCALBASE}/lib/mysql/[^/]*$" > /dev/null; then warn "you need USES+=mysql" # postgresql elif expr ${pkg} : "^databases/postgresql.*-client" > /dev/null; then warn "you need USES+=pgsql" # bdb elif expr ${pkg} : "^databases/db[456]" > /dev/null; then warn "you need USES+=bdb" # fam/gamin elif [ ${pkg} = "devel/fam" -o ${pkg} = "devel/gamin" ]; then warn "you need USES+=fam" # firebird elif [ ${pkg} = "databases/firebird25-client" ]; then warn "you need USES+=firebird" # fuse elif [ ${pkg} = "filesystems/fusefs-libs" ]; then warn "you need USES+=fuse" # gnustep elif [ ${pkg} = "lang/gnustep-base" ]; then warn "you need USES+=gnustep and USE_GNUSTEP+=base" elif [ ${pkg} = "x11-toolkits/gnustep-gui" ]; then warn "you need USES+=gnustep and USE_GNUSTEP+=gui" # iconv elif [ ${pkg} = "converters/libiconv" ]; then warn "you need USES+=iconv, USES+=iconv:wchar_t, or USES+=iconv:translit depending on needs" # jpeg elif [ ${pkg} = "graphics/jpeg-turbo" ]; then warn "you need USES+=jpeg" # libarchive elif [ ${pkg} = "archivers/libarchive" ]; then warn "you need USES+=libarchive" elif [ ${pkg} = "devel/libedit" ]; then warn "you need USES+=libedit" # lua elif expr ${pkg} : "^lang/lua" > /dev/null; then warn "you need USES+=lua" # magick elif [ ${pkg} = "graphics/ImageMagick6" ] ; then warn "you need USES=magick:6" elif [ ${pkg} = "graphics/ImageMagick6-nox11" ] ; then warn "you need USES=magick:6,nox11" elif [ ${pkg} = "graphics/ImageMagick7" ] ; then warn "you need USES=magick:7" elif [ ${pkg} = "graphics/ImageMagick7-nox11" ] ; then warn "you need USES=magick:7,nox11" # motif elif [ ${pkg} = "x11-toolkits/lesstif" -o ${pkg} = "x11-toolkits/open-motif" ]; then warn "you need USES+=motif" # ncurses elif [ ${pkg} = "devel/ncurses" ]; then warn "you need USES+=ncurses" # objc elif [ ${pkg} = "lang/libobjc2" ]; then warn "you need USES+=objc" # openal elif [ ${pkg} = "audio/openal" -o ${pkg} = "audio/openal-soft" -o ${pkg} = "audio/freealut" ]; then warn "you need USES+=openal" # readline elif [ ${pkg} = "devel/readline" ]; then warn "you need USES+=readline" # ssl # When updating this, please also update the versions list in # bsd.default-versions.mk and ssl.mk! elif [ ${pkg} = "security/openssl" -o ${pkg} = "security/openssl111" \ -o ${pkg} = "security/openssl31" -o ${pkg} = "security/openssl32" \ -o ${pkg} = "security/openssl33" \ -o ${pkg} = "security/libressl" -o ${pkg} = "security/libressl-devel" \ ]; then warn "you need USES=ssl" # Tcl elif expr ${pkg} : "^lang/tcl" > /dev/null; then warn "you need USES+=tcl" # Tk elif expr ${pkg} : "^x11-toolkits/tk" > /dev/null; then warn "you need USES+=tk" # Xfce # grep LIB_DEPENDS= Mk/Uses/xfce.mk |sed -e 's|\(.*\)_LIB_DEPENDS.*:\(.*\)\/\(.*\)|elif [ ${pkg} = "\2/\3" ]; then warn "you need USE_XFCE+=\1"|' elif [ ${pkg} = "sysutils/garcon" ]; then warn "you need USE_XFCE+=garcon" elif [ ${pkg} = "x11/libexo" ]; then warn "you need USE_XFCE+=libexo" elif [ ${pkg} = "x11-toolkits/libxfce4gui" ]; then warn "you need USE_XFCE+=libgui" elif [ ${pkg} = "x11/libxfce4menu" ]; then warn "you need USE_XFCE+=libmenu" elif [ ${pkg} = "x11/libxfce4util" ]; then warn "you need USE_XFCE+=libutil" elif [ ${pkg} = "x11-wm/xfce4-panel" ]; then warn "you need USE_XFCE+=panel" elif [ ${pkg} = "x11-fm/thunar" ]; then warn "you need USE_XFCE+=thunar" elif [ ${pkg} = "x11/xfce4-conf" ]; then warn "you need USE_XFCE+=xfconf" # default elif expr ${lib_file} : "${LOCALBASE}/lib/[^/]*$" > /dev/null; then lib_file=${lib_file#${LOCALBASE}/lib/} lib_file=${lib_file%.so*}.so warn "you need LIB_DEPENDS+=${lib_file}:${pkg}" fi } proxydeps() { local file dep_file dep_file_pkg already rc dep_lib_file dep_lib_files rc=0 # Check all dynamically linked ELF files # Some .so are not executable, but we want to check them too. while read -r file; do # No results presents a blank line from heredoc. [ -z "${file}" ] && continue while read -r dep_file; do # No results presents a blank line from heredoc. [ -z "${dep_file}" ] && continue # Skip files we already checked. if listcontains ${dep_file} "${already}"; then continue fi if pkg which -q ${dep_file} > /dev/null 2>&1; then dep_file_pkg=$(pkg which -qo ${dep_file}) # Check that the .so we need has a SONAME if [ "${dep_file_pkg}" != "${PKGORIGIN}" ]; then # When grep -q finds a match it will close the pipe immediately. # This may cause the test to fail when pipefail is turned on. set +o pipefail if ! readelf -d "${dep_file}" | grep SONAME > /dev/null; then err "${file} is linked to ${dep_file} which does not have a SONAME. ${dep_file_pkg} needs to be fixed." fi set -o pipefail fi # If we don't already depend on it, and we don't provide it if ! listcontains ${dep_file_pkg} "${LIB_RUN_DEPENDS} ${PKGORIGIN}"; then # If the package has a flavor, check that the dependency is not on that particular flavor. flavor=$(pkg annotate -q -S "$(pkg which -q "${dep_file}")" flavor) if [ -n "${flavor}" ]; then if listcontains ${dep_file_pkg}@${flavor} "${LIB_RUN_DEPENDS} ${PKGORIGIN}"; then continue fi fi err "${file} is linked to ${dep_file} from ${dep_file_pkg} but it is not declared as a dependency" proxydeps_suggest_uses ${dep_file_pkg} ${dep_file} rc=1 fi else err "${file} is linked to ${dep_file} that does not belong to any package" rc=1 fi already="${already} ${dep_file}" dep_lib_file=$(basename ${dep_file}) dep_lib_files="${dep_lib_files} ${dep_lib_file%%.so*}.so" done <<-EOT $(env LD_LIBMAP_DISABLE=1 ldd -a "${STAGEDIR}${file}" | \ awk ' BEGIN {section=0} /^\// {section++} !/^\// && section<=1 && ($3 ~ "^'${PREFIX}'" || $3 ~ "^'${LOCALBASE}'") {print $3}') EOT done <<-EOT $(list_stagedir_elfs | \ file -F $'\1' -f - | \ grep -a 'ELF.*FreeBSD.*dynamically linked' | \ cut -f 1 -d $'\1'| \ sed -e 's/^\.//') EOT # Check whether all files in LIB_DEPENDS are actually linked against for _library in ${WANTED_LIBRARIES} ; do if ! listcontains ${_library%%.so*}.so "${dep_lib_files}" ; then warn "you might not need LIB_DEPENDS on ${_library}" fi done [ -z "${PROXYDEPS_FATAL}" ] && return 0 return ${rc} } sonames() { [ ! -d ${STAGEDIR}${PREFIX}/lib -o -n "${BUNDLE_LIBS}" ] && return 0 while read -r f; do # No results presents a blank line from heredoc. [ -z "${f}" ] && continue # Ignore symlinks [ -f "${f}" -a ! -L "${f}" ] || continue # Ignore .debug files [ "${f}" == "${f%.debug}" ] || continue if ! readelf -d ${f} | grep SONAME > /dev/null; then warn "${f} doesn't have a SONAME." warn "pkg(8) will not register it as being provided by the port." warn "If another port depend on it, pkg will not be able to know where it comes from." case "${f}" in ${STAGEDIR}${PREFIX}/lib/*/*) warn "It is in a subdirectory, it may not be used in another port." ;; *) warn "It is directly in ${PREFIX}/lib, it is probably used by other ports." ;; esac fi # Use heredoc to avoid losing rc from find|while subshell done <<-EOT $(find ${STAGEDIR}${PREFIX}/lib -name '*.so.*') EOT } perlcore_port_module_mapping() { case "$1" in Net) echo "Net::Config" ;; libwww) echo "LWP" ;; *) echo "$1" | sed -e 's/-/::/g' ;; esac } perlcore() { local portname version module gotsome [ -x "${LOCALBASE}/bin/corelist" ] || return 0 for dep in ${UNIFIED_DEPENDS}; do portname=$(expr "${dep}" : ".*/p5-\(.*\)") if [ -n "${portname}" ]; then gotsome=1 module=$(perlcore_port_module_mapping "${portname}") version=$(expr "${dep}" : ".*>=*\([^:<]*\)") while read -r l; do case "${l}" in *was\ not\ in\ CORE*) # This never was with Perl # CORE, so nothing to do here ;; *and\ removed*) # This was in Perl CORE but has # been removed since. warn "${dep##*:} was in Perl CORE. Check with \`corelist ${module} ${version}\` and \`corelist -a ${module}\` if it should be conditionally added depending on PERL_LEVEL" ;; *deprecated*in*) # This is in Perl CORE but is # deprecated. warn "${dep##*:} is in Perl CORE but deprecated. Check with \`corelist ${module} ${version}\` and \`corelist -a ${module}\` if the dependency is really needed or if it should be conditionally added depending on PERL_LEVEL" ;; *was\ first\ released*) # This is in Perl CORE and is # maybe not needed. warn "${dep##*:} is present in Perl CORE. Check with \`corelist ${module} ${version}\` and \`corelist -a ${module}\` if the dependency is really needed or if it should be conditionally added depending on PERL_LEVEL" ;; *) err "This line is not handled: \"${l}\"" esac done <<-EOT $(${LOCALBASE}/bin/corelist "${module}"|tail -1) EOT fi done if [ -n "${gotsome}" ] && ! pkg info -e devel/p5-Module-CoreList; then notice "You have some Perl modules as dependencies but you do not have devel/p5-Module-CoreList installed, the perlcore QA check gets better results when using it, especially with older Perl versions." fi } no_arch() { [ -z "$NO_ARCH" ] && return rc=0 while read -r f; do [ -z "$f" ] && continue if [ -n "$NO_ARCH_IGNORE" ]; then skip= for blacklist in $NO_ARCH_IGNORE; do case $f in *$blacklist) skip=1; break;; esac done [ "$skip" ] && continue fi err "'${f#.}' is a architecture specific binary file and you have set NO_ARCH. Either remove NO_ARCH or add '$(basename $f)' to NO_ARCH_IGNORE." rc=1 done <<-EOF $(list_stagedir_elfs \ | file -F $'\1' -f - -N \ | grep -aE 'ELF .* [LM]SB .*, .*, version [0-9]+ \(FreeBSD\)' \ | cut -f 1 -d $'\1') EOF return $rc } gemdeps() { rc=0 if [ "${PKGBASE%%-*}" = "rubygem" ]; then # shellcheck disable=SC2153 # In the heredoc, ${PORTNAME} comes from the environment, not # to be confused with ${portname} while read -r l; do if [ -n "${l}" ]; then name=${l%% *} vers=${l#* } while read -r v; do if ! while read -r p; do ${LOCALBASE}/bin/ruby -e "puts 'OK' if Gem::Dependency.new('${name}','${v}').match?('${name}','${p}')" done | grep -qFx OK; then err RubyGem dependency ${name} ${v} is not satisfied. rc=1 fi <<-EOF $(${LOCALBASE}/bin/gem list -e "${name}" \ | sed "s|.*(\(.*\))|\1|" \ | tr -d ' ' \ | tr , '\n') EOF done <<-EOF $(while echo "${vers}" | grep -q '"'; do echo "${vers}" | cut -d '"' -f2 vers=$(echo "${vers}"|cut -d '"' -f3-) done) EOF fi done <<-EOF $(grep -a 's.add_runtime_dependency' ${STAGEDIR}${PREFIX}/lib/ruby/gems/*/specifications/${PORTNAME}-*.gemspec \ | sed 's|.*<\(.*\)>.*\[\(.*\)\])|\1 \2|' \ | sort -u) EOF fi return $rc } # If an non rubygem-port has a 'Gemfile' file # it is checked with bundle to be sure # all dependencies are satisfied. # Without the check missing/wrong dependencies # are just found when executing the application gemfiledeps() { # skip check if port does not use ruby at all if [ -z "$USE_RUBY" ]; then return 0 fi # skip check if port is a rubygem-* one; they have no Gemfiles if [ "${PKGBASE%%-*}" = "rubygem" ]; then return 0 fi # advise install of bundler if its not present for check if ! type bundle > /dev/null 2>&1; then notice "Please install sysutils/rubygem-bundler for additional Gemfile-checks" return 0 fi # locate the Gemfile(s) while read -r f; do # no results presents a blank line from heredoc [ -z "$f" ] && continue # if there is no Gemfile everything is fine - stop here [ ! -f "$f" ] && return 0; # use bundle to check if Gemfile is satisfied # if bundle returns 1 the Gemfile is not satisfied # and so stage-qa isn't also if ! bundle check --dry-run --gemfile $f > /dev/null 2>&1; then warn "Dependencies defined in ${f} are not satisfied" fi done <<-EOF $(find ${STAGEDIR} -name Gemfile) EOF return 0 } flavors() { local rc pkgnames uniques rc=0 if [ -n "${FLAVOR}" ]; then pkgnames=$(make -C "${CURDIR}" flavors-package-names|sort) uniques=$(echo "${pkgnames}"|uniq) if [ "$pkgnames" != "${uniques}" ]; then err "Package names are not unique with flavors:" make -C "${CURDIR}" pretty-flavors-package-names >&2 err "maybe use _PKGNAMEPREFIX/SUFFIX". rc=1 fi fi return ${rc} } license() { local lic autoaccept pkgmirror #distsell distmirror pkgsell if [ -n "$DISABLE_LICENSES" ]; then warn "You have disabled the licenses framework with DISABLE_LICENSES, unable to run checks" elif [ -n "$LICENSE" ]; then for lic in $LICENSE_PERMS; do case "$lic" in auto-accept) autoaccept=1 ;; #dist-mirror) distmirror=1 ;; #dist-sell) distsell=1 ;; pkg-mirror) pkgmirror=1 ;; #pkg-sell) pkgsell=1 ;; esac done if [ -z "$autoaccept" ]; then warn "License is not auto-accepted, packages will not be built, ports depending on this one will be ignored." fi if [ -z "$pkgmirror" ]; then warn "License does not allow package to be distributed, ports depending on this one will be ignored" fi fi return 0 } # This is to prevent adding dependencies to meta ports that are only there to # improve the end user experience. depends_blacklist() { local dep rc instead rc=0 for dep in ${UNIFIED_DEPENDS}; do origin=$(expr "${dep}" : ".*:\([^@]*\)") instead="" case "$origin" in lang/python|lang/python2|lang/python3) # lang/python depends on lang/pythonX, but it's # ok, it is also in the blacklist. if [ ${PKGORIGIN} != lang/python ]; then instead="USES=python:xy with a specific version" fi ;; lang/gcc) instead="USE_GCC" ;; lang/go) instead="USES=go" ;; lang/mono) instead="USES=mono" ;; devel/llvm) instead="USES=llvm" ;; esac if [ -n "${instead}" ]; then err "$origin should not be depended upon. Instead, use $instead." rc=1 fi done return $rc } pkgmessage() { for message in ${PKGMESSAGES}; do if [ -f "${message}" ]; then if ! head -1 "${message}" | grep -q '^\['; then warn "${message} not in UCL format, will be shown on initial install only." warn "See https://docs.freebsd.org/en/books/porters-handbook/pkg-files/#porting-message" fi fi done return 0 } reinplace() { if [ -f ${REWARNFILE} ]; then warn "Possible REINPLACE_CMD issues:" cat ${REWARNFILE} fi } prefixman() { if [ -d "${STAGEDIR}${PREFIX}/man" ]; then warn "Installing man files in ${PREFIX}/man is no longer supported. Consider installing these files in ${PREFIX}/share/man instead." ls -liTd ${STAGEDIR}${PREFIX}/man fi return 0 } 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 reinplace prefixman" ret=0 cd ${STAGEDIR} || exit 1 for check in ${checks}; do eval check_test="\$IGNORE_QA_$check" if [ -z "${check_test}" ]; then ${check} || ret=1 else warn "Ignoring $check QA test" fi done exit ${ret} diff --git a/Mk/Uses/gnome.mk b/Mk/Uses/gnome.mk index 7d99d5df0bd0..2cb1485313c6 100644 --- a/Mk/Uses/gnome.mk +++ b/Mk/Uses/gnome.mk @@ -1,462 +1,459 @@ #-*- tab-width: 4; -*- # ex:ts=4 # # Please view me with 4 column tabs! # ======================= USERS ================================= # # There are no significant user-definable settings in here. # This file is a framework to make it easier to create GNOME ports. # # ======================= /USERS ================================ # Please make sure all changes to this file are passed through the maintainer. # Do not commit them yourself (unless of course you're the Port's Wraith ;). # This section defines possible names of GNOME components and all information # necessary for ports to use those components. # Ports can use this as follows: # # USE_GNOME= glib20 introspection:build # # .include # # As a result proper LIB_DEPENDS/RUN_DEPENDS will be added and CONFIGURE_ENV # and MAKE_ENV defined. # # # GCONF_SCHEMAS - Set the following to list of all the gconf schema files # that your port installs. These schema files and # %gconf.xml files will be automatically added to # the ${PLIST}. For example, if your port has # "etc/gconf/schemas/(foo.schemas and bar.schemas)", # add the following to your Makefile: # "GCONF_SCHEMAS=foo.schemas bar.schemas". # # GLIB_SCHEMAS - Set the following to list of all gsettings schema files # (*.gschema.xml) that your ports installs. The # schema files will be automatically added to # the ${PLIST}. For example, if your port has # "share/glib-2.0/schemas/(foo.gschema.xml and bar.gschema.xml)", # add the following to your Makefile: # "GLIB_SCHEMAS=foo.gschema.xml bar.gschema.xml". # # INSTALLS_OMF - If set, bsd.gnome.mk will automatically scan pkg-plist # file and add apropriate @postexec/@postunexec directives for # each .omf file found to track OMF registration database. # # MAINTAINER: gnome@FreeBSD.org .if !defined(_INCLUDE_USES_GNOME_MK) _INCLUDE_USES_GNOME_MK= yes _USES_POST+= gnome . if !empty(gnome_ARGS) IGNORE= USES=gnome takes no arguments . endif # non-version specific components _USE_GNOME_ALL= intlhack intltool introspection \ gnomemimedata gnomeprefix # GNOME 2 components _USE_GNOME_ALL+= atk cairo \ gdkpixbuf gdkpixbuf2xlib gdkpixbufextra gconf2 glib20 \ gtk-update-icon-cache gtk20 \ gtksharp20 gtksourceview2 gvfs libartlgpl2 \ libglade2 libgnomecanvas \ libgsf libidl librsvg2 \ libxml2 libxslt \ pango pangoft2 pangox-compat \ vte # GNOME 3 components _USE_GNOME_ALL+=dconf evolutiondataserver3 gnomecontrolcenter3 gnomedesktop3 \ gnomemenus3 gsound gtk30 gtkhtml4 gtksourceview3 \ gtksourceview4 libgda5 \ libgda5-ui libgda6 libgnomekbd libwnck3 \ pygobject3 vte3 # GNOME 40 components _USE_GNOME_ALL+=gtk40 libadwaita gtksourceview5 gnomedesktop4 nautilus4 # C++ bindings -_USE_GNOME_ALL+=atkmm cairomm cairomm11 gconfmm26 glibmm glibmm26 gtkmm24 \ +_USE_GNOME_ALL+=atkmm cairomm cairomm11 glibmm glibmm26 gtkmm24 \ gtkmm30 gtkmm40 gtksourceviewmm3 libgdamm5 libxml++26 libsigc++20 \ libsigc++30 pangomm pangomm24 # glib-mkenums often fails with C locale # https://gitlab.gnome.org/GNOME/glib/issues/1430 USE_LOCALE?= en_US.UTF-8 GNOME_HTML_DIR?= ${PREFIX}/share/doc GCONF_CONFIG_OPTIONS?= merged GCONF_CONFIG_DIRECTORY?=etc/gconf/gconf.xml.defaults GCONF_CONFIG_SOURCE?=xml:${GCONF_CONFIG_OPTIONS}:${PREFIX}/${GCONF_CONFIG_DIRECTORY} GNOME_LOCALSTATEDIR?= ${PREFIX}/share gnomeprefix_CONFIGURE_ENV=GTKDOC="false" gnomeprefix_CONFIGURE_ARGS=--localstatedir=${GNOME_LOCALSTATEDIR} \ --with-html-dir=${GNOME_HTML_DIR} \ --disable-gtk-doc \ --with-gconf-source=${GCONF_CONFIG_SOURCE} atkmm_LIB_DEPENDS= libatkmm-1.6.so:accessibility/atkmm atkmm_USE_GNOME_IMPL= glibmm atk libxml++26_LIB_DEPENDS= libxml++-2.6.so:textproc/libxml++26 libxml++26_USE_GNOME_IMPL= glibmm libxml2 cairo_LIB_DEPENDS= libcairo.so:graphics/cairo cairomm_LIB_DEPENDS= libcairomm-1.0.so:graphics/cairomm cairomm_USE_GNOME_IMPL= cairo libsigc++20 cairomm11_LIB_DEPENDS= libcairomm-1.16.so:graphics/cairomm11 cairomm11_USE_GNOME_IMPL= cairo libsigc++30 -gconfmm26_LIB_DEPENDS= libgconfmm-2.6.so:devel/gconfmm26 -gconfmm26_USE_GNOME_IMPL= glibmm gconf2 - glibmm_LIB_DEPENDS= libglibmm-2.4.so:devel/glibmm glibmm_USE_GNOME_IMPL= libsigc++20 glib20 glibmm26_LIB_DEPENDS= libglibmm-2.68.so:devel/glibmm26 glibmm26_USE_GNOME_IMPL= libsigc++30 glib20 gsound_BUILD_DEPENDS= gsound-play:audio/gsound gsound_LIB_DEPENDS= libgsound.so:audio/gsound gsound_RUN_DEPENDS= gsound-play:audio/gsound gsound_USE_GNOME_IMPL= glib20 gtkmm24_LIB_DEPENDS= libgtkmm-2.4.so:x11-toolkits/gtkmm24 gtkmm24_USE_GNOME_IMPL= glibmm cairomm atkmm pangomm gtk20 gtkmm30_LIB_DEPENDS= libgtkmm-3.0.so:x11-toolkits/gtkmm30 gtkmm30_USE_GNOME_IMPL= atkmm cairomm gdkpixbuf glibmm gtk30 pangomm gtkmm40_LIB_DEPENDS= libgtkmm-4.0.so:x11-toolkits/gtkmm40 gtkmm40_USE_GNOME_IMPL= cairomm11 gdkpixbuf glibmm26 gtk40 pangomm24 gtksourceviewmm3_LIB_DEPENDS= libgtksourceviewmm-3.0.so:x11-toolkits/gtksourceviewmm3 gtksourceviewmm3_USE_GNOME_IMPL= gtkmm30 gtksourceview3 libgdamm5_LIB_DEPENDS= libgdamm-5.0.so:databases/libgdamm5 libgdamm5_USE_GNOME_IMPL= libgda5 glibmm libsigc++20_LIB_DEPENDS= libsigc-2.0.so:devel/libsigc++20 libsigc++30_LIB_DEPENDS= libsigc-3.0.so:devel/libsigc++30 pangomm_LIB_DEPENDS= libpangomm-1.4.so:x11-toolkits/pangomm pangomm_USE_GNOME_IMPL= pango glibmm cairomm pangomm24_LIB_DEPENDS= libpangomm-2.48.so:x11-toolkits/pangomm24 pangomm24_USE_GNOME_IMPL= pango glibmm26 cairomm11 gnomemimedata_BUILD_DEPENDS=${LOCALBASE}/libdata/pkgconfig/gnome-mime-data-2.0.pc:misc/gnome-mime-data gnomemimedata_RUN_DEPENDS=${LOCALBASE}/libdata/pkgconfig/gnome-mime-data-2.0.pc:misc/gnome-mime-data glib20_LIB_DEPENDS= libglib-2.0.so:devel/glib20 \ libintl.so:devel/gettext-runtime atk_LIB_DEPENDS= libatk-1.0.so:accessibility/at-spi2-core atk_USE_GNOME_IMPL= glib20 dconf_BUILD_DEPENDS= dconf:devel/dconf dconf_LIB_DEPENDS= libdconf.so:devel/dconf dconf_RUN_DEPENDS= dconf:devel/dconf dconf_USE_GNOME_IMPL= glib20 pango_LIB_DEPENDS= libharfbuzz.so:print/harfbuzz \ libpango-1.0.so:x11-toolkits/pango pango_USE_GNOME_IMPL= glib20 pangoft2_LIB_DEPENDS= libfontconfig.so:x11-fonts/fontconfig \ libfreetype.so:print/freetype2 pangoft2_USE_GNOME_IMPL=pango pangox-compat_LIB_DEPENDS= libpangox-1.0.so:x11-toolkits/pangox-compat pangox-compat_USE_GNOME_IMPL= glib20 pango gdkpixbuf_LIB_DEPENDS= libgdk_pixbuf-2.0.so:graphics/gdk-pixbuf2 gdkpixbuf_USE_GNOME_IMPL=glib20 gdkpixbuf2xlib_LIB_DEPENDS= libgdk_pixbuf_xlib-2.0.so:graphics/gdk-pixbuf2-xlib gdkpixbuf2xlib_USE_GNOME_IMPL= glib20 gdkpixbuf gdkpixbufextra_BUILD_DEPENDS= gdk-pixbuf-extra>=0.1.0:graphics/gdk-pixbuf-extra gdkpixbufextra_RUN_DEPENDS= gdk-pixbuf-extra>=0.1.0:graphics/gdk-pixbuf-extra gdkpixbufextra_USE_GNOME_IMPL= glib20 gdkpixbuf gtk-update-icon-cache_RUN_DEPENDS= gtk-update-icon-cache:graphics/gtk-update-icon-cache gtk20_LIB_DEPENDS= libgtk-x11-2.0.so:x11-toolkits/gtk20 gtk20_USE_GNOME_IMPL= atk cairo gdkpixbuf pangoft2 GTK2_VERSION= 2.10.0 gtk30_LIB_DEPENDS= libgtk-3.so:x11-toolkits/gtk30 gtk30_USE_GNOME_IMPL= atk cairo gdkpixbuf pango GTK3_VERSION= 3.0.0 gtk40_LIB_DEPENDS= libgtk-4.so:x11-toolkits/gtk40 gtk40_USE_GNOME_IMPL= atk pango GTK4_VERSION= 4.0.0 libidl_LIB_DEPENDS= libIDL-2.so:devel/libIDL libidl_USE_GNOME_IMPL= glib20 libglade2_LIB_DEPENDS= libglade-2.0.so:devel/libglade2 libglade2_USE_GNOME_IMPL=libxml2 gtk20 libxml2_BUILD_DEPENDS= xml2-config:textproc/libxml2 libxml2_LIB_DEPENDS= libxml2.so:textproc/libxml2 libxml2_RUN_DEPENDS= xml2-config:textproc/libxml2 libxslt_BUILD_DEPENDS= xsltproc:textproc/libxslt libxslt_LIB_DEPENDS= libxslt.so:textproc/libxslt libxslt_RUN_DEPENDS= ${libxslt_BUILD_DEPENDS} libxslt_USE_GNOME_IMPL= libxml2 introspection_BUILD_DEPENDS= g-ir-scanner:devel/gobject-introspection introspection_LIB_DEPENDS= libgirepository-1.0.so:devel/gobject-introspection introspection_RUN_DEPENDS= g-ir-scanner:devel/gobject-introspection introspection_USE_GNOME_IMPL= glib20 introspection_MAKE_ENV= GI_SCANNER_DISABLE_CACHE=1 gconf2_LIB_DEPENDS= libgconf-2.so:devel/gconf2 gconf2_USE_GNOME_IMPL= libxml2 libgnomecanvas_LIB_DEPENDS= libgnomecanvas-2.so:graphics/libgnomecanvas libgnomecanvas_USE_GNOME_IMPL= libglade2 libartlgpl2 libartlgpl2_LIB_DEPENDS= libart_lgpl_2.so:graphics/libart_lgpl gnomedesktop3_LIB_DEPENDS= libgnome-desktop-3.so:x11/gnome-desktop gnomedesktop3_USE_GNOME_IMPL= gtk30 gnomedesktop4_LIB_DEPENDS= libgnome-desktop-4.so:x11/gnome-desktop gnomedesktop4_USE_GNOME_IMPL= gtk40 libwnck3_LIB_DEPENDS= libwnck-3.so:x11-toolkits/libwnck3 libwnck3_USE_GNOME_IMPL=gtk30 vte_LIB_DEPENDS= libvte.so:x11-toolkits/vte vte_USE_GNOME_IMPL= gtk20 vte3_LIB_DEPENDS= libvte-2.91.so:x11-toolkits/vte3 vte3_USE_GNOME_IMPL= gtk30 libadwaita_LIB_DEPENDS= libadwaita-1.so:x11-toolkits/libadwaita libadwaita_USE_GNOME_IMPL= gtk40 # Use librsvg2-rust where lang/rust is available . if ${LIBRSVG2_DEFAULT:Mrust} librsvg2_BUILD_DEPENDS= librsvg2-rust>=0:graphics/librsvg2-rust librsvg2_LIB_DEPENDS= librsvg-2.so:graphics/librsvg2-rust librsvg2_RUN_DEPENDS= librsvg2-rust>=0:graphics/librsvg2-rust . else librsvg2_BUILD_DEPENDS= librsvg2>=0:graphics/librsvg2 librsvg2_LIB_DEPENDS= librsvg-2.so:graphics/librsvg2 librsvg2_RUN_DEPENDS= librsvg2>=0:graphics/librsvg2 . endif librsvg2_USE_GNOME_IMPL=cairo gdkpixbuf nautilus4_LIB_DEPENDS= libnautilus-extension.so:x11-fm/nautilus nautilus4_USE_GNOME_IMPL=glib20 gnomecontrolcenter3_BUILD_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/gnome-keybindings.pc:sysutils/gnome-control-center gnomecontrolcenter3_RUN_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/gnome-keybindings.pc:sysutils/gnome-control-center gnomecontrolcenter3_USE_GNOME_IMPL= gnomedesktop4 libgda5_LIB_DEPENDS= libgda-5.0.so:databases/libgda5 libgda5_USE_GNOME_IMPL= glib20 libxslt libgda5-ui_LIB_DEPENDS= libgda-ui-5.0.so:databases/libgda5-ui libgda5-ui_USE_GNOME_IMPL=glib20 libxslt libgda5 libgda6_LIB_DEPENDS= libgda-6.0.so:databases/libgda6 libgda6_USE_GNOME_IMPL= glib20 libxml2 gtksourceview2_LIB_DEPENDS= libgtksourceview-2.0.so:x11-toolkits/gtksourceview2 gtksourceview2_USE_GNOME_IMPL=gtk20 libxml2 gtksourceview3_LIB_DEPENDS= libgtksourceview-3.0.so:x11-toolkits/gtksourceview3 gtksourceview3_USE_GNOME_IMPL=gtk30 libxml2 gtksourceview4_LIB_DEPENDS= libgtksourceview-4.so:x11-toolkits/gtksourceview4 gtksourceview4_USE_GNOME_IMPL=gtk30 libxml2 gtksourceview5_LIB_DEPENDS= libgtksourceview-5.so:x11-toolkits/gtksourceview5 gtksourceview5_USE_GNOME_IMPL=gtk40 libxml2 libgsf_LIB_DEPENDS= libgsf-1.so:devel/libgsf libgsf_USE_GNOME_IMPL= glib20 libxml2 pygobject3_BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pygobject>=0:devel/py-pygobject@${PY_FLAVOR} pygobject3_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pygobject>=0:devel/py-pygobject@${PY_FLAVOR} pygobject3_USE_GNOME_IMPL= glib20 intltool_BUILD_DEPENDS= ${LOCALBASE}/bin/intltool-extract:textproc/intltool 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} ${FRAMEWORK_REINPLACE_CMD} \ 's/DATADIRNAME=lib/DATADIRNAME=share/' intlhack_USE_GNOME_IMPL=intltool gtkhtml4_LIB_DEPENDS= libgtkhtml-4.0.so:www/gtkhtml4 gtkhtml4_USE_GNOME_IMPL=gtk30 libxml2 evolutiondataserver3_LIB_DEPENDS= libedataserver-1.2.so:databases/evolution-data-server evolutiondataserver3_USE_GNOME_IMPL= libxml2 gtk30 gnomemenus3_BUILD_DEPENDS= gnome-menus>=3.2.0:x11/gnome-menus gnomemenus3_RUN_DEPENDS= gnome-menus>=3.2.0:x11/gnome-menus gnomemenus3_USE_GNOME_IMPL= glib20 gtksharp20_BUILD_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/gtk-sharp-2.0.pc:x11-toolkits/gtk-sharp20 gtksharp20_RUN_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/gtk-sharp-2.0.pc:x11-toolkits/gtk-sharp20 gtksharp20_USE_GNOME_IMPL= gtk20 libgnomekbd_LIB_DEPENDS= libgnomekbd.so:x11/libgnomekbd libgnomekbd_USE_GNOME_IMPL= gtk30 libxml2 gvfs_BUILD_DEPENDS= gvfs>=0:filesystems/gvfs gvfs_RUN_DEPENDS= gvfs>=0:filesystems/gvfs # End component definition section . if defined(USE_GNOME) # First of all expand all USE_GNOME_IMPL recursively . for component in ${_USE_GNOME_ALL} . for subcomponent in ${${component}_USE_GNOME_IMPL} ${component}_USE_GNOME_IMPL+=${${subcomponent}_USE_GNOME_IMPL} . endfor . endfor # Then use already expanded USE_GNOME_IMPL to expand USE_GNOME. # Also, check to see if each component has a desktop requirement. If it does, # and if the user's chosen desktop is not of the same version, mark the # port as IGNORE. . for component in ${USE_GNOME:C/^([^:]+).*/\1/} . if ${_USE_GNOME_ALL:M${component}}=="" IGNORE= cannot install: Unknown component ${component} . endif _USE_GNOME+= ${${component}_USE_GNOME_IMPL} ${component} . endfor # Setup the GTK API version for pixbuf loaders, input method modules, # and theme engines. PLIST_SUB+= GTK2_VERSION="${GTK2_VERSION}" \ GTK3_VERSION="${GTK3_VERSION}" \ GTK4_VERSION="${GTK4_VERSION}" . if defined(_USE_GNOME) && empty(_USE_GNOME:Mglib20:u) && defined(GLIB_SCHEMAS) IGNORE= GLIB_SCHEMAS is set, but needs USE_GNOME=glib20 to work . endif . if defined(_USE_GNOME) && empty(_USE_GNOME:Mgconf2:u) && defined(GCONF_SCHEMAS) IGNORE= GCONF_SCHEMAS is set, but needs USE_GNOME=gconf2 to work . endif # Then traverse through all components, check which of them # exist in ${_USE_GNOME} and set variables accordingly . ifdef _USE_GNOME . for component in ${_USE_GNOME:O:u} . if defined(${component}_PATCH_DEPENDS) PATCH_DEPENDS+= ${${component}_PATCH_DEPENDS} . endif . if ${USE_GNOME:M${component}\:build} && defined(${component}_BUILD_DEPENDS) BUILD_DEPENDS+= ${${component}_BUILD_DEPENDS} . elif ${USE_GNOME:M${component}\:run} && defined(${component}_RUN_DEPENDS) RUN_DEPENDS+= ${${component}_RUN_DEPENDS} . else . if defined(${component}_LIB_DEPENDS) LIB_DEPENDS+= ${${component}_LIB_DEPENDS} . else BUILD_DEPENDS+= ${${component}_BUILD_DEPENDS} RUN_DEPENDS+= ${${component}_RUN_DEPENDS} . endif . endif . if defined(${component}_CONFIGURE_ARGS) CONFIGURE_ARGS+=${${component}_CONFIGURE_ARGS} . endif . if defined(${component}_CONFIGURE_ENV) CONFIGURE_ENV+= ${${component}_CONFIGURE_ENV} . endif . if defined(${component}_MAKE_ENV) MAKE_ENV+= ${${component}_MAKE_ENV} . endif . if !defined(CONFIGURE_TARGET) && defined(${component}_CONFIGURE_TARGET) CONFIGURE_TARGET= ${${component}_CONFIGURE_TARGET} . endif . if defined(${component}_PRE_PATCH) GNOME_PRE_PATCH+= ; ${${component}_PRE_PATCH} . endif . endfor . endif . if defined(GCONF_SCHEMAS) MAKE_ENV+= GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1 . endif . endif . if defined(USE_GNOME_SUBR) GNOME_SUBR= ${LOCALBASE}/etc/gnome.subr RUN_DEPENDS+= ${GNOME_SUBR}:sysutils/gnome_subr SUB_LIST+= GNOME_SUBR=${GNOME_SUBR} . endif .endif # end of the part .if defined(_POSTMKINCLUDED) && !defined(_INCLUDE_USES_GNOME_POST_MK) _INCLUDE_USES_GNOME_POST_MK= yes . if defined(GNOME_PRE_PATCH) _USES_patch+= 290:gnome-pre-patch gnome-pre-patch: @${GNOME_PRE_PATCH:C/^;//1} . endif . if defined(GCONF_SCHEMAS) _USES_install+= 690:gnome-post-gconf-schemas gnome-post-gconf-schemas: @for i in ${GCONF_SCHEMAS}; do \ ${ECHO_CMD} "@preunexec env GCONF_CONFIG_SOURCE=xml:${GCONF_CONFIG_OPTIONS}:%D/${GCONF_CONFIG_DIRECTORY} HOME=${WRKDIR} gconftool-2 --makefile-uninstall-rule %D/etc/gconf/schemas/$${i} > /dev/null || /usr/bin/true" \ >> ${TMPPLIST}; \ ${ECHO_CMD} "etc/gconf/schemas/$${i}" >> ${TMPPLIST}; \ ${ECHO_CMD} "@postexec env GCONF_CONFIG_SOURCE=xml:${GCONF_CONFIG_OPTIONS}:%D/${GCONF_CONFIG_DIRECTORY} HOME=${WRKDIR} gconftool-2 --makefile-install-rule %D/etc/gconf/schemas/$${i} > /dev/null || /usr/bin/true" \ >> ${TMPPLIST}; \ done . endif . if defined(GLIB_SCHEMAS) PLIST_FILES+= ${GLIB_SCHEMAS:C,^,share/glib-2.0/schemas/,} . endif . if defined(INSTALLS_OMF) _USES_install+= 690:gnome-post-omf gnome-post-omf: @for i in `${GREP} "\.omf$$" ${TMPPLIST}`; do \ ${ECHO_CMD} "@postexec scrollkeeper-install -q %D/$${i} 2>/dev/null || /usr/bin/true" \ >> ${TMPPLIST}; \ ${ECHO_CMD} "@postunexec scrollkeeper-uninstall -q %D/$${i} 2>/dev/null || /usr/bin/true" \ >> ${TMPPLIST}; \ done . endif .endif # End of use part.