(re)fetch the license files from wxWidgets when building the sdist,

and ensure it is included in the distribution.
This commit is contained in:
Robin Dunn
2017-06-23 12:10:23 -07:00
parent b1a2808311
commit e5b4c33421
6 changed files with 24 additions and 13 deletions

View File

@@ -5,6 +5,7 @@
#
recursive-include wx **
recursive-include license *.txt
recursive-exclude wx .git
recursive-exclude wx *.pyc

View File

@@ -9,7 +9,7 @@
# Author: Robin Dunn
#
# Created: 3-Dec-2010
# Copyright: (c) 2010-2016 by Total Control Software
# Copyright: (c) 2010-2017 by Total Control Software
# License: wxWindows License
#----------------------------------------------------------------------
@@ -32,7 +32,7 @@ from buildtools.config import Config, msg, opj, posixjoin, loadETG, etg2sip, fi
phoenixDir, wxDir, copyIfNewer, copyFile, \
macSetLoaderNames, \
getVcsRev, runcmd, textfile_open, getSipFiles, \
getVisCVersion, getToolsPlatformName
getVisCVersion, getToolsPlatformName, updateLicenseFiles
import buildtools.version as version
@@ -1754,6 +1754,10 @@ def cmd_sdist(options, args):
for name in glob.glob(posixjoin('wx', wc)):
copyFile(name, destdir)
# Copy the license files from wxWidgets
updateLicenseFiles(cfg)
shutil.copytree('license', opj(PDEST, 'license'))
# Also add the waf executable, fetching it first if we don't already have it
getWafCmd()
copyFile('bin/waf-%s' % wafCurrentVersion, os.path.join(PDEST, 'bin'))

View File

@@ -16,16 +16,13 @@ import os
import glob
import fnmatch
import re
import tempfile
import shutil
import codecs
import subprocess
import platform
from distutils.file_util import copy_file
from distutils.dir_util import mkpath
from distutils.dep_util import newer
from distutils.spawn import spawn
import distutils.sysconfig
@@ -907,3 +904,13 @@ def getToolsPlatformName(useLinuxBits=False):
if useLinuxBits:
name += platform.architecture()[0][:2]
return name
def updateLicenseFiles(cfg):
from distutils.file_util import copy_file
from distutils.dir_util import mkpath
mkpath('license')
for filename in ['preamble.txt', 'licence.txt', 'licendoc.txt', 'lgpl.txt']:
copy_file(opj(cfg.WXDIR, 'docs', filename), opj('license',filename), update=1, verbose=1)

2
setup.cfg Normal file
View File

@@ -0,0 +1,2 @@
[metadata]
license-file = license/licence.txt

View File

@@ -5,7 +5,7 @@
# Author: Robin Dunn
#
# Created: 3-Nov-2010
# Copyright: (c) 2010-2016 by Total Control Software
# Copyright: (c) 2010-2017 by Total Control Software
# License: wxWindows License
#----------------------------------------------------------------------
@@ -41,7 +41,7 @@ URL = "http://wxPython.org/"
#DOWNLOAD_URL = "http://wxPython.org/download.php"
#DOWNLOAD_URL = "http://wxpython.org/Phoenix/snapshot-builds/"
DOWNLOAD_URL = "https://pypi.python.org/pypi/{}".format(NAME)
LICENSE = "wxWidgets Library License (LGPL derivative)"
LICENSE = "wxWindows Library License (https://opensource.org/licenses/wxwindows.php)"
PLATFORMS = "WIN32,WIN64,OSX,POSIX"
KEYWORDS = "GUI,wx,wxWindows,wxWidgets,cross-platform,user-interface,awesome"

View File

@@ -468,15 +468,12 @@ def build(bld):
sys.path.insert(0, thisdir)
from distutils.file_util import copy_file
from distutils.dir_util import mkpath
from buildtools.config import opj
from buildtools.config import opj, updateLicenseFiles
cfg.finishSetup(bld.env.wx_config)
# update the license files
mkpath('license')
for filename in ['preamble.txt', 'licence.txt', 'licendoc.txt', 'lgpl.txt']:
copy_file(opj(cfg.WXDIR, 'docs', filename), opj('license',filename), update=1, verbose=1)
# Copy the license files from wxWidgets
updateLicenseFiles(cfg)
# create the package's __version__ module
open(opj(cfg.PKGDIR, '__version__.py'), 'w').write(