Browse Source

new package flask

Signed-off-by: Joerg Seitter <adk@seitter.net>
Joerg Seitter 5 years ago
parent
commit
d24a1fd99f
2 changed files with 75 additions and 0 deletions
  1. 38 0
      package/flask/Makefile
  2. 37 0
      package/flask/patches/patch-setup_py

+ 38 - 0
package/flask/Makefile

@@ -0,0 +1,38 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(ADK_TOPDIR)/rules.mk
+
+PKG_NAME:=		Flask
+PKG_VERSION:=		1.1.1
+PKG_RELEASE:=		1
+PKG_HASH:=		13f9f196f330c7c2c5d7a5cf91af894110ca0215ac051b5844701f2bfd934d52
+PKG_DESCR:=		flask python web framework	
+PKG_SECTION:=		net/http
+PKG_URL:=		https://pypi.org/project/Flask/	
+PKG_SITES:=		https://files.pythonhosted.org/packages/2e/80/3726a729de758513fd3dbc64e93098eb009c49305a97c6751de55b20b694/
+PKG_DEPENDS:=		python3 python3-mod-zlib
+PKG_BUILDDEP:=		python3
+
+DISTFILES:=             Flask-$(PKG_VERSION).tar.gz
+
+include $(ADK_TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,FLASK,flask,$(PKG_VERSION)-$(PKG_RELEASE),$(PKG_DEPENDS),$(PKG_DESCR),$(PKG_SECTION),$(PKG_OPTS)))
+
+CONFIG_STYLE:=		manual
+BUILD_STYLE:=		manual
+INSTALL_STYLE:=		manual
+
+include $(ADK_TOPDIR)/mk/python3.mk
+
+do-build:
+	cd $(WRKBUILD); env PYTHONPATH=$(PYTHON_LIBDIR) $(PYTHON) ./setup.py build
+	$(INSTALL_DIR) $(WRKINST)/usr/lib/python$(PYTHON_VERSION)/site-packages
+	cd $(WRKBUILD); env PYTHONPATH=$(PYTHON_LIBDIR):$(WRKINST)/usr/lib/python$(PYTHON_VERSION)/site-packages $(PYTHON) ./setup.py install --prefix="$(WRKINST)/usr"
+
+do-install:
+	$(INSTALL_DIR) $(IDIR_FLASK)/usr/lib/python$(PYTHON_VERSION)/site-packages
+	$(CP) $(WRKINST)/usr/lib/python$(PYTHON_VERSION)/site-packages/* $(IDIR_FLASK)/usr/lib/python$(PYTHON_VERSION)/site-packages/
+
+include $(ADK_TOPDIR)/mk/pkg-bottom.mk

+ 37 - 0
package/flask/patches/patch-setup_py

@@ -0,0 +1,37 @@
+--- Flask-1.1.1.orig/setup.py	2019-07-08 19:59:15.000000000 +0200
++++ Flask-1.1.1/setup.py	2020-04-11 10:54:23.217330259 +0200
+@@ -1,8 +1,32 @@
+ import io
+ import re
+ 
+-from setuptools import find_packages
+-from setuptools import setup
++try:
++    from setuptools import find_packages
++except ImportError:
++    import os
++    from distutils.util import convert_path
++
++    def find_packages(base_path):
++        base_path = convert_path(base_path)
++        found = []
++        for root, dirs, files in os.walk(base_path, followlinks=True):
++            dirs[:] = [d for d in dirs if d[0] != '.' and d not in ('ez_setup', '__pycache__')]
++            relpath = os.path.relpath(root, base_path)
++            parent = relpath.replace(os.sep, '.').lstrip('.')
++            if relpath != '.' and parent not in found:
++                # foo.bar package but no foo package, skip
++                continue
++            for dir in dirs:
++                if os.path.isfile(os.path.join(root, dir, '__init__.py')):
++                    package = '.'.join((parent, dir)) if parent else dir
++                    found.append(package)
++        return found
++
++try:
++    from setuptools import setup
++except ImportError:
++    from distutils.core import setup
+ 
+ with io.open("README.rst", "rt", encoding="utf8") as f:
+     readme = f.read()