Skip to content

Commit

Permalink
Fix #15 - install Linux files only when building under Linux
Browse files Browse the repository at this point in the history
Signed-off-by: Martin <[email protected]>
  • Loading branch information
Ho-Ro committed Mar 21, 2022
1 parent 5d434c2 commit be76527
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 26 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
2022-03-14: More refactoring [5d434c2]
2022-03-14: Code cleanup / refactor [f4c52e1]
2022-03-14: Adapt calibration file format for OH6022 persistent offset storage [3cac630]
2022-03-08: Improved exception and error handling in LibUsbScope, doc update [dc05698]
Expand Down
66 changes: 40 additions & 26 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
__version__ = '2.10.2'
__version__ = '2.10.3'


from setuptools import setup
import os
import platform


# data files
data_files=[
( 'share/doc/hantek6022api/', [ 'README.md' ] ),
( 'share/doc/hantek6022api/', [ 'CHANGELOG' ] ),
( 'share/doc/hantek6022api/', [ 'LICENSE' ] ),
]

# add linux specific config files and binaries
if platform.system() == 'Linux':
data_files.append( ( '/etc/udev/rules.d/', [ 'udev/60-hantek6022api.rules' ] ) )
data_files.append( ( 'bin/', [ 'fx2upload/fx2upload' ] ) )

# print( data_files )

setup(
name='hantek6022api',
Expand All @@ -12,35 +28,33 @@
long_description=
'''A Python API, tools for calibration, data capturing and visualisation
as well as an improved FW for Hantek 6022 USB Oscilloscopes''',
platforms=['all'],
platforms=[ 'all' ],
version=__version__,
license='GPLv2',
url='https://github.com/Ho-Ro/Hantek6022API',
packages=['PyHT6022', 'PyHT6022.Firmware'],
package_data={'PyHT6022': [os.path.join('Firmware', 'DSO6022BE', 'dso6022be-firmware.hex'),
os.path.join('Firmware', 'DSO6022BL', 'dso6022bl-firmware.hex'),
os.path.join('Firmware', 'DSO6021', 'dso6021-firmware.hex'),
os.path.join('Firmware', 'DDS120', 'dds120-firmware.hex'),
os.path.join('Firmware', 'modded', 'mod_fw_01.ihex'),
os.path.join('Firmware', 'modded', 'mod_fw_iso.ihex'),
os.path.join('Firmware', 'stock', 'stock_fw.ihex'),]
packages=[ 'PyHT6022', 'PyHT6022.Firmware' ],
package_data={ 'PyHT6022': [os.path.join( 'Firmware', 'DSO6022BE', 'dso6022be-firmware.hex' ),
os.path.join( 'Firmware', 'DSO6022BL', 'dso6022bl-firmware.hex' ),
os.path.join( 'Firmware', 'DSO6021', 'dso6021-firmware.hex' ),
os.path.join( 'Firmware', 'DDS120', 'dds120-firmware.hex' ),
os.path.join( 'Firmware', 'modded', 'mod_fw_01.ihex' ),
os.path.join( 'Firmware', 'modded', 'mod_fw_iso.ihex' ),
os.path.join( 'Firmware', 'stock', 'stock_fw.ihex' ), ]
},
include_package_data=True,
# the required python packages
install_requires=['libusb1', 'matplotlib'],
data_files=[
("/usr/bin/", ["examples/calibrate_6022.py",
"examples/capture_6022.py",
"examples/plot_from_capture_6022.py",
"examples/fft_from_capture_6022.py",
"examples/fft_ft_from_capture_6022.py",
"examples/set_cal_out_freq_6022.py",
"examples/upload_6022_firmware_from_hex.py",
"examples/upload_6022_firmware.py",
"fx2upload/fx2upload"]
),
("/usr/share/doc/hantek6022api/", ["README.md"]),
("/usr/share/doc/hantek6022api/", ["CHANGELOG"]),
("/usr/share/doc/hantek6022api/", ["LICENSE"]),
("/etc/udev/rules.d/", ["udev/60-hantek6022api.rules"]),
]
# the python scripts will be found via the PATH
scripts=[
'examples/calibrate_6022.py',
'examples/capture_6022.py',
'examples/plot_from_capture_6022.py',
'examples/fft_from_capture_6022.py',
'examples/fft_ft_from_capture_6022.py',
'examples/set_cal_out_freq_6022.py',
'examples/upload_6022_firmware_from_hex.py',
'examples/upload_6022_firmware.py',
],
# the data_files from above
data_files = data_files
)

0 comments on commit be76527

Please sign in to comment.