I am developing an cross platform application which ships additional binary files from source directory for linux and windows. Right now I am using following script in my *.spec file to include all binaries from the source directory.
##### include mydir in distribution #######
def extra_datas(mydir):
def rec_glob(p, files):
import os
import glob
for d in glob.glob(p):
if os.path.isfile(d):
files.append(d)
rec_glob("%s/*" % d, files)
files = []
rec_glob("%s/*" % mydir, files)
extra_datas = []
for f in files:
extra_datas.append((f, f, 'DATA'))
return extra_datas
###########################################
# append the 'data' dir
a.datas += extra_datas('data')
All works well. Now the issue is that when i create binay from windows, all additional binaries of linux also shiped in the final executable. This makes the final stand alone executable bigger in size.
Is there a way to tell pyinstaller to execlude certain files/ binarries from source directory. Also is it possible to execlude certain *.so/ *.dll which are really not required in the final executable?
I use the following for development:-
Python 2.7
Pyinstaller 2.1
Debian 7 for linux
Windows 7 for Win
Any help is appriciated.