Skip to content

Commit

Permalink
Do the directory detection AFTER it's been downloaded
Browse files Browse the repository at this point in the history
  • Loading branch information
svvitale committed May 8, 2015
1 parent 0e2e665 commit e330dcc
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,32 @@
import multiprocessing
from glob import glob

nxppy = Extension('nxppy',
sources = ['Mifare.c', 'nxppy.c'],
extra_compile_args=['-O1'],
extra_link_args=['-lwiringPi']
)

class build_nxppy(build):
def run(self):
def compile():
call( './get_nxpRdLib.sh', shell=True )

# Find where neard-explorenfc was extracted
nxprdlib_dir = glob('neard-explorenfc-*/nxprdlib')[0]

# Add relevant include directories
nxppy.include_dirs.append(nxprdlib_dir + '/types')
nxppy.include_dirs.append(nxprdlib_dir + '/intfs')

# Add library reference
nxppy.extra_link_args.append(nxprdlib_dir + '/libnxprdlib.a')

self.execute(compile, [], 'compiling NxpRdLib')

# Run the rest of the build
build.run(self)

nxprdlib_dir = glob('neard-explorenfc-*/nxprdlib')[0]

nxppy = Extension('nxppy',
sources = ['Mifare.c', 'nxppy.c'],
include_dirs = [nxprdlib_dir + '/types',
nxprdlib_dir + '/intfs'],
extra_compile_args=['-O1'],
extra_link_args=[nxprdlib_dir + '/libnxprdlib.a', '-lwiringPi']
)

short_description = 'A python extension for interfacing with the NXP PN512 NFC Reader. Targeted specifically for Raspberry Pi and the EXPLORE-NFC module'

try:
Expand Down

0 comments on commit e330dcc

Please sign in to comment.