0

我有

buildozer.spec
recipes/
  myrecipe/
    __init__.py
mypackage/
  setup.py
  code.py

但是当我尝试用file://谷歌搜索这个问题时看到的 URL 编写一个食谱时,我得到一个错误Exception: Given path is neither a file nor a directory: /home/user/project/.buildozer/android/platform/build-armeabi-v7a/packages/mypackage/mypackage(不是 mypackage 两次)。

我怎样才能做到这一点?

4

1 回答 1

0

有一个IncludedFilesBehaviourmixin 就是为了这个,只需给它一个相对路径src_filename

from pythonforandroid.recipe import IncludedFilesBehaviour, CppCompiledComponentsPythonRecipe
import os
import sys

class MyRecipe(IncludedFilesBehaviour, CppCompiledComponentsPythonRecipe):
    version = 'stable'
    src_filename = "../../../phase-engine"
    name = 'phase-engine'

    depends = ['setuptools']

    call_hostpython_via_targetpython = False
    install_in_hostpython = True

    def get_recipe_env(self, arch):
        env = super().get_recipe_env(arch)
        env['LDFLAGS'] += ' -lc++_shared'
        return env

recipe = MyRecipe()
于 2020-11-09T16:11:36.193 回答