|
6 | 6 | import multiprocessing
|
7 | 7 | from glob import glob
|
8 | 8 |
|
| 9 | +nxppy = Extension('nxppy', |
| 10 | + sources = ['Mifare.c', 'nxppy.c'], |
| 11 | + extra_compile_args=['-O1'], |
| 12 | + extra_link_args=['-lwiringPi'] |
| 13 | +) |
| 14 | + |
9 | 15 | class build_nxppy(build):
|
10 | 16 | def run(self):
|
11 | 17 | def compile():
|
12 | 18 | call( './get_nxpRdLib.sh', shell=True )
|
13 | 19 |
|
| 20 | + # Find where neard-explorenfc was extracted |
| 21 | + nxprdlib_dir = glob('neard-explorenfc-*/nxprdlib')[0] |
| 22 | + |
| 23 | + # Add relevant include directories |
| 24 | + nxppy.include_dirs.append(nxprdlib_dir + '/types') |
| 25 | + nxppy.include_dirs.append(nxprdlib_dir + '/intfs') |
| 26 | + |
| 27 | + # Add library reference |
| 28 | + nxppy.extra_link_args.append(nxprdlib_dir + '/libnxprdlib.a') |
| 29 | + |
14 | 30 | self.execute(compile, [], 'compiling NxpRdLib')
|
15 | 31 |
|
16 | 32 | # Run the rest of the build
|
17 | 33 | build.run(self)
|
18 | 34 |
|
19 |
| -nxprdlib_dir = glob('neard-explorenfc-*/nxprdlib')[0] |
20 |
| - |
21 |
| -nxppy = Extension('nxppy', |
22 |
| - sources = ['Mifare.c', 'nxppy.c'], |
23 |
| - include_dirs = [nxprdlib_dir + '/types', |
24 |
| - nxprdlib_dir + '/intfs'], |
25 |
| - extra_compile_args=['-O1'], |
26 |
| - extra_link_args=[nxprdlib_dir + '/libnxprdlib.a', '-lwiringPi'] |
27 |
| -) |
28 |
| - |
29 | 35 | short_description = 'A python extension for interfacing with the NXP PN512 NFC Reader. Targeted specifically for Raspberry Pi and the EXPLORE-NFC module'
|
30 | 36 |
|
31 | 37 | try:
|
|
0 commit comments