Skip to content

Commit 66c62e3

Browse files
committed
allow building wheels as well as packages on linux
1 parent 28599c7 commit 66c62e3

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

package.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,9 @@ def bdist_rpm():
397397
subprocess.call((
398398
'fpm', '-t', 'rpm', '-s', 'python', '--no-auto-depends',
399399
'--prefix=/usr/local/lib/python2.7/site-packages/',
400-
'--depends=numpy,pyserial,SDL2,SDL2_gfx', '..'
400+
'--depends=numpy,pyserial,SDL2,SDL2_gfx',
401+
'--python-setup-py-arguments=--called-by-fpm',
402+
'../setup.py'
401403
), cwd='dist')
402404
shutil.rmtree('resources')
403405
wash()
@@ -416,7 +418,8 @@ def bdist_deb():
416418
'fpm', '-t', 'deb', '-s', 'python', '--no-auto-depends',
417419
'--prefix=/usr/local/lib/python2.7/site-packages/',
418420
'--depends=python-numpy,python-serial,python-parallel,libsdl2-2.0-0,libsdl2-gfx-1.0-0',
419-
'..'
421+
'--python-setup-py-arguments=--called-by-fpm',
422+
'../setup.py'
420423
), cwd='dist')
421424
shutil.rmtree('resources')
422425
wash()

setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,11 @@ def build_py_ext(obj):
227227
SETUP_OPTIONS['entry_points']['gui_scripts'] = ['pcbasicw=pcbasic:main']
228228

229229

230-
elif sys.platform.startswith('linux'):
230+
elif '--called-by-fpm' in sys.argv:
231231
# these need to be included in the sdist metadata for the packaging script to pick them up
232+
# we ask fpm to include a special argument to avoid breaking other calls
233+
234+
sys.argv.remove('--called-by-fpm')
232235

233236
_TARGET = '/usr/local/'
234237

0 commit comments

Comments
 (0)