Diff

Differences From Artifact [e69d6c7eca]:

To Artifact [1916312581]:


     1      1   #! /usr/bin/env bash
     2      2   
     3      3   # BuildCompatible: KitCreator
     4      4   
     5         -version="1.6.7"
     6         -url="http://sourceforge.net/projects/tls/files/tls/${TLSVERS}/tls${TLSVERS}-src.tar.gz"
     7         -sha256='5119de3e5470359b97a8a00d861c9c48433571ee0167af0a952de66c99d3a3b8'
            5  +version="1.7.8"
            6  +url="http://tcltls.rkeene.org/uv/tcltls-${version}.tar.gz"
            7  +sha256='30ee49330db795f86bc850487421ea923fba7d95d4758b2a61eef3baf0fe0f9e'
            8  +configure_extra=('--enable-deterministic')
     8      9   
     9     10   function buildSSLLibrary() {
    10     11   	local version url hash
    11     12   	local archive
    12     13   
    13     14   	version='2.4.2'
    14     15   	url="http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-${version}.tar.gz"
................................................................................
    43     44   	@echo Nothing to do
    44     45   _EOF_
    45     46   
    46     47   		${MAKE:-make} V=1 || exit 1
    47     48   
    48     49   		${MAKE:-make} V=1 install || exit 1
    49     50   	) || return 1
           51  +
           52  +	PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:${SSLDIR}/lib/pkgconfig"
           53  +	export PKG_CONFIG_PATH
    50     54   
    51     55   	SSLDIR="$(pwd)/libressl-${version}/INST"
    52         -	addlibs_LOCALSSL="$(PKG_CONFIG_PATH="${SSLDIR}/lib/pkgconfig" "${PKG_CONFIG:-pkg-config}" libssl libcrypto --libs --static)"
           56  +
           57  +	return 0
    53     58   }
    54     59   
    55     60   function preconfigure() {
    56     61   	# Determine SSL directory
    57     62   	if [ -z "${CPP}" ]; then
    58     63   		CPP="${CC:-cc} -E"
    59     64   	fi
................................................................................
    75     80   			echo "Unable to find OpenSSL, aborting." >&2
    76     81   
    77     82   			return 1
    78     83   		fi
    79     84   	fi
    80     85   
    81     86   	# Add SSL library to configure options
    82         -	configure_extra=(--with-ssl-dir="${SSLDIR}")
    83         -
    84         -	# Disable SSLv2, newer SSL libraries drop support for it entirely
    85         -	CFLAGS="${CFLAGS} -DNO_SSL2=1"
    86         -
    87         -	# Disable SSLv3, newer SSL libraries drop support for it entirely
    88         -	CFLAGS="${CFLAGS} -DNO_SSL3=1"
    89         -	export CFLAGS
    90         -}
    91         -
    92         -function postconfigure() {
    93         -	local linkaddfile
    94         -	local addlibs
    95         -
    96         -	# Determine SSL library directory
    97         -	SSL_LIB_DIR="$(${MAKE:-make} --print-data-base | awk '/^SSL_LIB_DIR = /{ print }' | sed 's@^SSL_LIB_DIR = *@@')"
    98         -
    99         -	echo "SSL_LIB_DIR = ${SSL_LIB_DIR}"
           87  +	configure_extra=("${configure_extra[@]}" --with-openssl-dir="${SSLDIR}")
   100     88   }
   101     89   
   102     90   function postinstall() {
   103         -	# Create pkgIndex if needed
   104         -	if [ ! -e "${installdir}/lib/tls${version}/pkgIndex.tcl" ]; then
   105         -		cat << _EOF_ > "${installdir}/lib/tls${version}/pkgIndex.tcl"
   106         -package ifneeded tls ${version} \
   107         -    "[list source [file join \$dir tls.tcl]] ; \
   108         -     [list load {} tls]"
   109         -_EOF_
   110         -	fi
   111         -
   112         -	# Determine name of static object
   113         -	linkaddfile="$(find "${installdir}" -name '*.a' | head -n 1)"
   114         -	if [ -n "${linkaddfile}" ]; then
   115         -		linkaddfile="${linkaddfile}.linkadd"
   116         -
   117         -		if [ -n "${addlibs_LOCALSSL}" ]; then
   118         -			addlibs="${addlibs_LOCALSSL}"
           91  +	for file in *.linkadd; do
           92  +		if [ ! -e "${file}" ]; then
           93  +			continue
   119     94   		fi
   120     95   
   121         -		if [ -z "${addlibs}" ]; then
   122         -			if [ "${KC_TLS_LINKSSLSTATIC}" = '1' ]; then
   123         -				addlibs="$("${PKG_CONFIG:-pkg-config}" libssl libcrypto --libs --static)"
   124         -			else
   125         -				addlibs="$("${PKG_CONFIG:-pkg-config}" libssl libcrypto --libs)"
   126         -			fi
   127         -		fi
   128         -
   129         -		if [ -z "${addlibs}" ]; then
   130         -			addlibs="-L${SSL_LIB_DIR:-/lib} -lssl -lcrypto"
   131         -			addlibs_staticOnly=""
   132         -		fi
   133         -
   134         -		addlibs="${addlibs} ${KC_TLS_LINKADD}"
   135         -
   136         -		if [ "${KC_TLS_LINKSSLSTATIC}" = '1' ]; then
   137         -			echo "#STATIC ${addlibs} ${addlibs_staticOnly}"
   138         -		else
   139         -			echo "${addlibs}"
   140         -		fi > "${linkaddfile}"
   141         -	fi
           96  +		cp "${file}" "${installdir}/lib"/*/
           97  +	done
   142     98   }