Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: append ${ZPFX}/lib/pkg-config to $PKG_CONFIG_PATH #333

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions share/config.site
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Prepend directories carrying libs and headers to appropriate vars
export CPPFLAGS="-I$ZPFX/include $CPPFLAGS"
export LDFLAGS="-L$ZPFX/lib -L$ZPFX/lib64 $LDFLAGS"

29 changes: 25 additions & 4 deletions zinit.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ export ZPFX=${~ZPFX} ZSH_CACHE_DIR="${ZSH_CACHE_DIR:-${XDG_CACHE_HOME:-$HOME/.ca
PMSPEC=0uUpiPsf
[[ -z ${path[(re)$ZPFX/bin]} ]] && [[ -d "$ZPFX/bin" ]] && path=( "$ZPFX/bin" "${path[@]}" )
[[ -z ${path[(re)$ZPFX/sbin]} ]] && [[ -d "$ZPFX/sbin" ]] && path=( "$ZPFX/sbin" "${path[@]}" )
typeset -gU PATH path

# Add completions directory to fpath.
[[ -z ${fpath[(re)${ZINIT[COMPLETIONS_DIR]}]} ]] && fpath=( "${ZINIT[COMPLETIONS_DIR]}" "${fpath[@]}" )
Expand Down Expand Up @@ -1267,7 +1268,7 @@ builtin setopt noaliases
# For compaudit.
command chmod go-w "${ZINIT[HOME_DIR]}"
# Also set up */bin and ZPFX in general.
command mkdir 2>/dev/null -p $ZPFX/bin
command mkdir 2>/dev/null -p $ZPFX/bin $ZPFX/share
}
[[ ! -d ${ZINIT[PLUGINS_DIR]}/_local---zinit ]] && {
command rm -rf "${ZINIT[PLUGINS_DIR]:-${TMPDIR:-/tmp}/132bcaCAB}/_local---zplugin"
Expand All @@ -1276,7 +1277,7 @@ builtin setopt noaliases
command ln -s "${ZINIT[BIN_DIR]}/_zinit" "${ZINIT[PLUGINS_DIR]}/_local---zinit"

# Also set up */bin and ZPFX in general.
command mkdir 2>/dev/null -p $ZPFX/bin
command mkdir 2>/dev/null -p $ZPFX/bin $ZPFX/share

(( ${+functions[.zinit-setup-plugin-dir]} )) || builtin source "${ZINIT[BIN_DIR]}/zinit-install.zsh" || return 1
(( ${+functions[.zinit-confirm]} )) || builtin source "${ZINIT[BIN_DIR]}/zinit-autoload.zsh" || return 1
Expand All @@ -1292,7 +1293,7 @@ builtin setopt noaliases
command ln -s "${ZINIT[PLUGINS_DIR]}/_local---zinit/_zinit" "${ZINIT[COMPLETIONS_DIR]}"

# Also set up */bin and ZPFX in general.
command mkdir 2>/dev/null -p $ZPFX/bin
command mkdir 2>/dev/null -p $ZPFX/bin $ZPFX/share

(( ${+functions[.zinit-setup-plugin-dir]} )) || builtin source "${ZINIT[BIN_DIR]}/zinit-install.zsh" || return 1
.zinit-compinit &>/dev/null
Expand All @@ -1307,7 +1308,7 @@ builtin setopt noaliases
command chmod go-w "${ZINIT[SERVICES_DIR]}"

# Also set up */bin and ZPFX in general.
command mkdir 2>/dev/null -p $ZPFX/bin
command mkdir 2>/dev/null -p $ZPFX/bin $ZPFX/share
}
[[ ! -d ${~ZINIT[MAN_DIR]}/man9 ]] && {
# Create ZINIT[MAN_DIR]/man{1..9}
Expand All @@ -1319,6 +1320,11 @@ builtin setopt noaliases
command mkdir -p $ZINIT[MAN_DIR]/man1
command cp -f $ZINIT[BIN_DIR]/doc/zinit.1 $ZINIT[MAN_DIR]/man1
}
# Copy Autotools compilation options setting
[[ ! -f $ZPFX/share/config.site ]] && {
command mkdir -p $ZPFX/share
command cp $ZINIT[BIN_DIR]/share/config.site $ZPFX/share
}
} # ]]]
# FUNCTION: .zinit-load-object [[[
.zinit-load-object() {
Expand Down Expand Up @@ -1367,6 +1373,9 @@ builtin setopt noaliases
local -a opts
zparseopts -E -D -a opts f -command || { +zinit-message "{u-warn}Error{b-warn}:{rst} Incorrect options (accepted ones: {opt}-f{rst}, {opt}--command{rst})."; return 1; }
local url="$1" limit="$3"
# Ensure that configuration prepared for configure script
local -x CONFIG_SITE="$ZPFX/share/config.site"

[[ -n ${ICE[teleid]} ]] && url="${ICE[teleid]}"
# Hide arguments from sourced scripts. Without this calls our "$@" are visible as "$@"
# within scripts that we `source`.
Expand Down Expand Up @@ -1723,6 +1732,9 @@ builtin setopt noaliases
builtin set --
[[ -o ksharrays ]] && ___correct=1

# Configuration prepared for configure script
local -x CONFIG_SITE="$ZPFX/share/config.site"

[[ -n ${ICE[(i)(\!|)(sh|bash|ksh|csh)]}${ICE[opts]} ]] && {
local -a ___precm
___precm=(
Expand Down Expand Up @@ -3321,9 +3333,18 @@ zle -N zi-browse-symbol
zle -N zi-browse-symbol-backwards zi-browse-symbol
zle -N zi-browse-symbol-pbackwards zi-browse-symbol
zle -N zi-browse-symbol-pforwards zi-browse-symbol

zstyle -s ':zinit:browse-symbol' key ZINIT_TMP || ZINIT_TMP='\eQ'
[[ -n $ZINIT_TMP ]] && bindkey $ZINIT_TMP zi-browse-symbol

# Add $ZPFX/lib/pkg-config to PKG_CONFIG_PATH, so that libraries
# installed locally can be found by autotools and cmake. There
# is also $ZPFX/share/config.site file with autotools settings.

[[ $PKG_CONFIG_PATH != (|*:)$ZPFX/lib(|64)/pkgconfig(|:*) ]]&&PKG_CONFIG_PATH="$ZPFX/lib/pkgconfig:$ZPFX/lib64/pkgconfig:$PKG_CONFIG_PATH"
[[ $CMAKE_PREFIX_PATH != (|*\;)$ZPFX(|\;*) ]]&&CMAKE_PREFIX_PATH="$ZPFX:$CMAKE_PREFIX_PATH"
[[ $LD_LIBRARY_PATH != (|*:)$ZPFX/lib(|64)(|:*) ]]&&LD_LIBRARY_PATH="$ZPFX/lib:$ZPFX/lib64:$LD_LIBRARY_PATH"

# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
Expand Down