Ticket #12399: pycrypto-2.1.0.p0.diff

File pycrypto-2.1.0.p0.diff, 3.9 KB (added by Jean-Pierre Flori, 9 years ago)

Spkg diff, for review only.

  • SPKG.txt

    diff --git a/SPKG.txt b/SPKG.txt
    a b  
    2727
    2828== Special Update/Build Instructions ==
    2929
    30  * None
     30=== Patches ===
     31
     32 * freebsd.patch: let pycrypto build on FreeBSD.
    3133
    3234== Changelog ==
    3335
     36=== pycrypto-2.1.0.p0 (Jean-Pierre Flori, 4 July 2013) ===
     37 * #12399: Let pycrypto build on FreeBSD.
     38
    3439=== pycrypto-2.1.0 (Minh Van Nguyen, June 26th, 2010) ===
    3540
    3641 * Ticket #9338; upgrade to PyCrypto 2.1.0.
  • new file patches/freebsd.patch

    diff --git a/patches/freebsd.patch b/patches/freebsd.patch
    new file mode 100644
    - +  
     1--- pycrypto-2.1.0/src/src/libtom/tomcrypt_pk.h-orig    2012-01-21
     219:43:56.000000000 +0000
     3+++ pycrypto-2.1.0/src/src/libtom/tomcrypt_pk.h 2012-01-21
     419:45:01.000000000 +0000
     5@@ -496,7 +496,7 @@
     6 int der_printable_value_decode(int v);
     7 
     8 /* UTF-8 */
     9-#if (defined(SIZE_MAX) || __STDC_VERSION__ >= 199901L || defined(WCHAR_MAX) || defined(_WCHAR_T) || defined(_WCHAR_T_DEFINED)) && !defined(LTC_NO_WCHAR)
     10+#if (defined(SIZE_MAX) || __STDC_VERSION__ >= 199901L || defined(WCHAR_MAX) || defined(_WCHAR_T) || defined(_WCHAR_T_DEFINED) || defined(_GCC_WCHAR_T)) && !defined(LTC_NO_WCHAR)
     11 #include <wchar.h>
     12 #else
     13 typedef ulong32 wchar_t;
  • spkg-check

    diff --git a/spkg-check b/spkg-check
    a b  
    11#!/usr/bin/env bash
    22
    3 if [ -z $SAGE_LOCAL ]; then
    4     echo "SAGE_LOCAL undefined... exiting"
    5     echo "Maybe run 'sage -sh'?"
     3if [ -z "$SAGE_LOCAL" ]; then
     4    echo >&2 "SAGE_LOCAL undefined ... exiting"
     5    echo >&2 "Maybe run 'sage --sh'?"
    66    exit 1
    77fi
    88
    9 # Let the user set an environment variable CFLAG64 to indicate the flag
    10 # for the C compiler to build 64-bit code. If not set, assume it is -m64
    11 # as that is what is used by both GCC and SunStudio, but -m64 is not used
    12 # by IBM's compiler on AIX or HP's compiler on HP-UX.
    13 
    14 if [ -z $CFLAG64 ]; then
    15     # -m64 is used by gcc and SunStudio
    16     CFLAG64=-m64
    17 fi
    18 
    19 # Likewise to build C++ code.
    20 if [ -z $CXXFLAG64 ]; then
    21     # -m64 is used by gcc and SunStudio
    22     CXXFLAG64=-m64
    23 fi
    24 
    25 if [ "x$SAGE64" = xyes ]; then
    26     CFLAGS="$CFLAGS $CFLAG64" && export CFLAGS
    27     CXXFLAGS="$CXXFLAGS $CXXFLAG64" && export CXXFLAGS
    28     LDFLAGS="$LDFLAGS $CFLAG64" && export LDFLAGS
    29     # Very rare is CPPFLAGS needed, but sometimes it is.
    30     CPPFLAGS="$CPPFLAGS $CFLAG64" && export CPPFLAGS
    31 fi
    32 
    339cd src
    3410
    3511echo "PyCrypto will now be tested"
    3612python setup.py test
    3713
    3814if [ $? -ne 0 ]; then
    39     echo "An error occurred while testing PyCrypto... exiting"
     15    echo >&2 "Error: PyCrypto failed to pass its test suite."
    4016    exit 1
    4117fi
  • spkg-install

    diff --git a/spkg-install b/spkg-install
    a b  
    11#!/usr/bin/env bash
    22
    3 if [ "$SAGE_LOCAL" = "" ]; then
    4     echo "SAGE_LOCAL undefined... exiting"
    5     echo "Maybe run 'sage -sh'?"
     3if [ -z "$SAGE_LOCAL" ]; then
     4    echo >&2 "SAGE_LOCAL undefined ... exiting"
     5    echo >&2 "Maybe run 'sage --sh'?"
    66    exit 1
    77fi
    88
    9 if [ "x$SAGE64" = xyes ]; then
    10     echo "64-bit build"
    11     CFLAGS="-O2 -g -m64 "; export CFLAGS
    12     LDFLAGS="-m64 "; export LDFLAGS
     9cd src
     10
     11# Apply patches.  See SPKG.txt for information about what each patch
     12# does.
     13for patch in ../patches/*.patch; do
     14    [ -r "$patch" ] || continue  # Skip non-existing or non-readable patches
     15    patch -p1 <"$patch"
     16    if [ $? -ne 0 ]; then
     17        echo >&2 "Error applying '$patch'"
     18        exit 1
     19    fi
     20done
     21
     22if [ "$SAGE_DEBUG" = "yes" ]; then
     23    echo "Building a debug version of gf2x."
     24    export CFLAGS="-O0 -g $CFLAGS"
     25else
     26    export CFLAGS="-O2 -g $CFLAGS"
     27fi
     28
     29if [ "$SAGE64" = "yes" ]; then
     30    echo "Building a 64-bit version of gf2x."
     31    export ABI=64
     32    CFLAGS="-m64 $CFLAGS"
    1333fi
    1434
    1535CFLAGS="-I$SAGE_LOCAL/include -L$SAGE_LOCAL/lib $CFLAGS"
    16 export CFLAGS
    17 
    18 cd src
    1936
    2037python setup.py install
    2138if [ $? -ne 0 ]; then
    22     echo "Error installing PyCrypto... exiting"
     39    echo >&2 "Error: Failed to install PyCrypto."
    2340    exit 1
    2441fi