builder: Allow .pyc files without .py

This is common for binary-only releases, for example as described
in:
https://lists.freedesktop.org/archives/flatpak/2017-June/000697.html
This commit is contained in:
Alexander Larsson
2017-06-13 11:17:06 +02:00
parent daf36ba2af
commit bc7ebd20e2
5 changed files with 56 additions and 4 deletions

View File

@@ -0,0 +1,37 @@
{
"app-id": "org.test.Python2",
"runtime": "org.test.PythonPlatform",
"sdk": "org.test.PythonSdk",
"command": "testpython.py",
"modules": [
{
"name": "compiled-python",
"post-install": [
"mkdir /app/bin",
"cp testpython.py /app/bin",
"cp importme.py /app/bin",
/* Compile importme.py */
"/app/bin/testpython.py",
/* Remove .py file, but keep .pyc */
"rm /app/bin/importme.py",
/* Make sure it still works */
"/app/bin/testpython.py"
],
"sources": [
{
"type": "file",
"path": "empty-configure",
"dest-filename": "configure"
},
{
"type": "file",
"path": "testpython.py"
},
{
"type": "file",
"path": "importme.py"
}
]
}
]
}