Dependencies/phases/build_otr.sh
author Evan Schoenberg
Thu, 14 Nov 2019 18:14:36 -0500
branchadium-1.5.10.5
changeset 6005 26c3002a50ed
parent 2710 14cef01e09dc
permissions -rw-r--r--
Make OTR version match reality
2710
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
     1
#!/bin/bash -eu
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
     2
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
     3
##
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
     4
# gpg-error
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
     5
#
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
     6
build_libgpgerror(){
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
     7
	prereq "gpgerror" \
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
     8
		"ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.7.tar.bz2"
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
     9
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    10
	quiet pushd "${ROOTDIR}/source/gpgerror"
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    11
	
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    12
	if needsconfigure $@; then
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    13
	(
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    14
		status "Configuring libgpg-error"
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    15
		export CFLAGS="$ARCH_CFLAGS -Os"
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    16
		export LDFLAGS="$ARCH_LDFLAGS"
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    17
		log ./configure --prefix="$ROOTDIR/build" \
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    18
			--disable-shared \
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    19
			--enable-static \
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    20
			--disable-dependency-tracking
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    21
	)
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    22
	fi
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    23
	
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    24
	status "Building and installing gpg-error"
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    25
	log make -j $NUMBER_OF_CORES
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    26
	log make install
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    27
	
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    28
	quiet popd
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    29
}
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    30
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    31
##
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    32
# gcrypt
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    33
#
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    34
# disable assembly to help build universal.
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    35
#
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    36
build_libgcrypt(){
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    37
	build_libgpgerror
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    38
	prereq "libgcrypt" \
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    39
		"ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.4.4.tar.gz"
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    40
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    41
	quiet pushd "${ROOTDIR}/source/libgcrypt"
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    42
	
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    43
	if needsconfigure $@; then
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    44
	(
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    45
		status "Configuring libgcrypt"
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    46
		CONFIG_CMD="./configure --prefix=$ROOTDIR/build \
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    47
			--disable-shared \
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    48
			--enable-static \
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    49
			--disable-asm \
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    50
			--enable-ciphers=arcfour:blowfish:cast5:des:aes:twofish:serpent:rfc2268 \
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    51
			--enable-pubkey-ciphers=dsa:elgamal:rsa \
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    52
			--enable-digests=crc:md4:md5:rmd160:sha1:sha256:sha512:tiger \
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    53
			--disable-endian-check \
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    54
			--disable-dependency-tracking"
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    55
		xconfigure "${BASE_CFLAGS} -Os" "${BASE_LDFLAGS}" "${CONFIG_CMD}" \
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    56
			"${ROOTDIR}/source/libgcrypt/config.h"
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    57
	)
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    58
	fi
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    59
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    60
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    61
	status "Building and installing libgcrypt"
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    62
	log make -j $NUMBER_OF_CORES
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    63
	log make install
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    64
	
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    65
	quiet popd
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    66
}
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    67
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    68
##
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    69
# Libotr
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    70
#
6005
26c3002a50ed Make OTR version match reality
Evan Schoenberg
parents: 2710
diff changeset
    71
OTR_VERSION=3.2.0
2710
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    72
build_otr(){
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    73
	build_libgcrypt
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    74
	prereq "otr" \
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    75
		"http://www.cypherpunks.ca/otr/libotr-3.2.0.tar.gz"
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    76
	
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    77
	quiet pushd "${ROOTDIR}/source/otr"
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    78
	
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    79
	if needsconfigure $@; then
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    80
	(
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    81
		status "Configuring libotr"
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    82
		export CFLAGS="$ARCH_CFLAGS -Os"
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    83
		export LDFLAGS="$ARCH_LDFLAGS"
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    84
		log ./configure --prefix="$ROOTDIR/build" \
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    85
			--disable-dependency-tracking
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    86
	)	
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    87
	fi
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    88
	status "Building and installing libotr"
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    89
	log make -j $NUMBER_OF_CORES
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    90
	log make install
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    91
	
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    92
	quiet popd
14cef01e09dc Swap between Libotr and Libpurple builds with an option. Build Libpurple by default.
Stephen Holt <sholt@adium.im>
parents:
diff changeset
    93
}