You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, I have an application that should run on android and windows. I am building my windows version with cx_Freeze because:
It supports the standard distutils setup infrastructure
It is cross-platform
It is maintained
The buildozer personally bothers me because it uses its own system rather than the standard distutils.
cx_Freeze adds an Executable class to determine which scripts are the main entry points. What I am wondering is this: if I were to implement the bdist_apk command with the cx_Freeze Executable class (if cx_Freeze is installed) so that I would be able to use one setup.py file to build everything and submit a pull request, would this be accepted? It would only be active if cx_Freeze is detected, and would make things so much simpler on my part.
Do you have an example of what your result might look like? I don't know much about cx_freeze. I vaguely intended to implement a bdist_apk in what's presumably the same kind of way though.
The setup script for cx_Freeze is similar to this:
importsysimportosfromcx_Freezeimportsetup, Executable# Dependencies are automatically detected, but it might need fine tuning.build_exe_options= {"packages":["keyring"]}
setup(name="Name",
version="0.1",
description="Description",
packages= ["package"],
options= {"build_exe": build_exe_options},
executables= [Executable("package/main.py")])
To build for windows, I run python setup.py bdist_msi
My implementation would be something like this:
try:
fromcx_FreezeimportExecutableclassBdistAPK(Command):
description='Create an APK with python-for-android'user_options= []
definitialize_options(sel):
# Initialize optionsdeffinalize_options(self):
# Finalize optionsdefrun(self):
initScript=self.distribution.executables.initScript# Call the ToolchainCL with info.exceptImportError:
# Use the current (non-working) implementation.
Basically, if the user has cx_Freeze installed, the user will be able to use python setup.py bdist_apk. If not, nothing will be affected. If you want, I am willing to provide an executable class with similar parameters to the cx_Freeze executable class so that any user can run python setup.py bdist_apk even if cx_Freeze is not installed.
This seems largely ideal for what I thought bdist_apk should probably be (though all those settings should be manually configurable as well), so this sounds good to me. It would be great if you were to implement a full cx_freeze-like api that doesn't depend on anything else. If this would be significantly harder than depending on cx_freeze, then I'd be happy to merge a cx_freeze-depending version first and leave the rest for later.
Activity
inclement commentedon Oct 20, 2015
Do you have an example of what your result might look like? I don't know much about cx_freeze. I vaguely intended to implement a bdist_apk in what's presumably the same kind of way though.
xyztdev commentedon Oct 20, 2015
The setup script for cx_Freeze is similar to this:
To build for windows, I run
python setup.py bdist_msiMy implementation would be something like this:
Basically, if the user has cx_Freeze installed, the user will be able to use
python setup.py bdist_apk. If not, nothing will be affected. If you want, I am willing to provide an executable class with similar parameters to the cx_Freeze executable class so that any user can runpython setup.py bdist_apkeven if cx_Freeze is not installed.inclement commentedon Oct 20, 2015
How would you set all the different options? As arguments to the Executable-like class, or to setup, or some other way?
xyztdev commentedon Oct 20, 2015
Well, let's look at the different options:
python-for-android apk --private /path/to/your/app \ --package=org.example.packagename --name="Your app name" --version=0.5 --bootstrap=pygame --requirements=sdl,python2 --dist_name=testprojectprivatewould be set from the package location.packagewould be set from possibly the name and the author.namewould of course be set from the nameversionditto from the versionbootstrapfrom the Executablerequirementsfrom thebuild_apk_options["packages"]and some autodetection.Basically I would reuse the format so that the same setup script could build both the msi and the apk.
inclement commentedon Oct 20, 2015
This seems largely ideal for what I thought bdist_apk should probably be (though all those settings should be manually configurable as well), so this sounds good to me. It would be great if you were to implement a full cx_freeze-like api that doesn't depend on anything else. If this would be significantly harder than depending on cx_freeze, then I'd be happy to merge a cx_freeze-depending version first and leave the rest for later.
inclement commentedon Oct 31, 2015
I'll close this now since it's not really an open issue.