Ticket #9: pycryptopp-system.patch

File pycryptopp-system.patch, 6.1 KB (added by ruben, at 2008-09-22T20:58:53Z)
  • pycryptopp/cipher/aesmodule.cpp

    diff -rN -u old-pycryptopp/pycryptopp/cipher/aesmodule.cpp new-pycryptopp/pycryptopp/cipher/aesmodule.cpp
    old new  
    99#endif
    1010
    1111/* from Crypto++ */
    12 #include "modes.h"
    13 #include "aes.h"
     12#include <cryptopp/modes.h>
     13#include <cryptopp/aes.h>
    1414
    1515static char aes__doc__[] = "\
    1616aes counter mode cipher\
  • pycryptopp/hash/sha256module.cpp

    diff -rN -u old-pycryptopp/pycryptopp/hash/sha256module.cpp new-pycryptopp/pycryptopp/hash/sha256module.cpp
    old new  
    99#endif
    1010
    1111/* from Crypto++ */
    12 #include "sha.h"
    13 #include "hex.h"
    14 #include "filters.h"
     12#include <cryptopp/sha.h>
     13#include <cryptopp/hex.h>
     14#include <cryptopp/filters.h>
    1515
    1616static char sha256__doc__[] = "\
    1717sha256 hash function\
  • pycryptopp/publickey/ecdsamodule.cpp

    diff -rN -u old-pycryptopp/pycryptopp/publickey/ecdsamodule.cpp new-pycryptopp/pycryptopp/publickey/ecdsamodule.cpp
    old new  
    1515#endif
    1616
    1717/* from Crypto++ */
    18 #include "filters.h"
    19 #include "osrng.h"
    20 #include "eccrypto.h"
    21 #include "oids.h"
     18#include <cryptopp/filters.h>
     19#include <cryptopp/osrng.h>
     20#include <cryptopp/eccrypto.h>
     21#include <cryptopp/oids.h>
    2222
    2323USING_NAMESPACE(CryptoPP)
    2424
  • pycryptopp/publickey/rsamodule.cpp

    diff -rN -u old-pycryptopp/pycryptopp/publickey/rsamodule.cpp new-pycryptopp/pycryptopp/publickey/rsamodule.cpp
    old new  
    1212#endif
    1313
    1414/* from Crypto++ */
    15 #include "filters.h"
    16 #include "osrng.h"
    17 #include "pssr.h"
    18 #include "rsa.h"
     15#include <cryptopp/filters.h>
     16#include <cryptopp/osrng.h>
     17#include <cryptopp/pssr.h>
     18#include <cryptopp/rsa.h>
    1919
    2020USING_NAMESPACE(CryptoPP)
    2121
  • setup.py

    diff -rN -u old-pycryptopp/setup.py new-pycryptopp/setup.py
    old new  
    66# Author: Zooko Wilcox-O'Hearn
    77# See README.txt for licensing information.
    88
    9 import os, platform, re, subprocess, sys
     9import os, re, sys
    1010
    1111try:
    1212    from ez_setup import use_setuptools
     
    1818
    1919from setuptools import Extension, find_packages, setup
    2020
    21 CRYPTOPPDIR=os.path.join('cryptopp', 'c5')
    22 
    2321extra_compile_args=[]
    2422extra_link_args=[]
    2523define_macros=[]
    2624undef_macros=[]
    27 libraries=[]
     25libraries=['cryptopp']
    2826ext_modules=[]
    29 include_dirs=[CRYPTOPPDIR]
     27include_dirs=['/usr/include/cryptopp']
    3028library_dirs=[]
    3129
    32 # Versions of GNU assembler older than 2.10 do not understand the kind of ASM that Crypto++ uses.
    33 sp = subprocess.Popen(['as', '-v'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
    34 sp.stdin.close()
    35 sp.wait()
    36 if re.search("GNU assembler version (0|1|2.0)", sp.stderr.read()):
    37     define_macros.append(('CRYPTOPP_DISABLE_ASM', 1))
    38 
    39 if 'sunos' in platform.system().lower():
    40     extra_compile_args.append('-Wa,--divide') # allow use of "/" operator
    41 
    42 cryptopp_src = [ os.path.join(CRYPTOPPDIR, x) for x in os.listdir(CRYPTOPPDIR) if x.endswith('.cpp') ]
    4330
    4431trove_classifiers=[
    4532    "Environment :: Console",
     
    7865        raise RuntimeError("if %s.py exists, it is required to be well-formed" % (VERSIONFILE,))
    7966
    8067ext_modules.append(
    81     Extension('pycryptopp.publickey.rsa', cryptopp_src + ['pycryptopp/publickey/rsamodule.cpp',], include_dirs=include_dirs, library_dirs=library_dirs, libraries=libraries, extra_link_args=extra_link_args, extra_compile_args=extra_compile_args, define_macros=define_macros, undef_macros=undef_macros)
     68    Extension('pycryptopp.publickey.rsa', ['pycryptopp/publickey/rsamodule.cpp',], include_dirs=include_dirs, library_dirs=library_dirs, libraries=libraries, extra_link_args=extra_link_args, extra_compile_args=extra_compile_args, define_macros=define_macros, undef_macros=undef_macros)
    8269    )
    8370
    8471ext_modules.append(
    85     Extension('pycryptopp.publickey.ecdsa', cryptopp_src + ['pycryptopp/publickey/ecdsamodule.cpp',], include_dirs=include_dirs, library_dirs=library_dirs, libraries=libraries, extra_link_args=extra_link_args, extra_compile_args=extra_compile_args, define_macros=define_macros, undef_macros=undef_macros)
     72    Extension('pycryptopp.publickey.ecdsa', ['pycryptopp/publickey/ecdsamodule.cpp',], include_dirs=include_dirs, library_dirs=library_dirs, libraries=libraries, extra_link_args=extra_link_args, extra_compile_args=extra_compile_args, define_macros=define_macros, undef_macros=undef_macros)
    8673    )
    8774
    8875ext_modules.append(
    89     Extension('pycryptopp.hash.sha256', cryptopp_src + ['pycryptopp/hash/sha256module.cpp',], include_dirs=include_dirs, library_dirs=library_dirs, libraries=libraries, extra_link_args=extra_link_args, extra_compile_args=extra_compile_args, define_macros=define_macros, undef_macros=undef_macros)
     76    Extension('pycryptopp.hash.sha256', ['pycryptopp/hash/sha256module.cpp',], include_dirs=include_dirs, library_dirs=library_dirs, libraries=libraries, extra_link_args=extra_link_args, extra_compile_args=extra_compile_args, define_macros=define_macros, undef_macros=undef_macros)
    9077    )
    9178
    9279ext_modules.append(
    93     Extension('pycryptopp.cipher.aes', cryptopp_src + ['pycryptopp/cipher/aesmodule.cpp',], include_dirs=include_dirs, library_dirs=library_dirs, libraries=libraries, extra_link_args=extra_link_args, extra_compile_args=extra_compile_args, define_macros=define_macros, undef_macros=undef_macros)
     80    Extension('pycryptopp.cipher.aes', ['pycryptopp/cipher/aesmodule.cpp',], include_dirs=include_dirs, library_dirs=library_dirs, libraries=libraries, extra_link_args=extra_link_args, extra_compile_args=extra_compile_args, define_macros=define_macros, undef_macros=undef_macros)
    9481    )
    9582
    9683miscdeps=os.path.join(os.getcwd(), 'misc', 'dependencies')