diff options
author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-08-31 13:25:51 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-09-06 14:44:12 +0300 |
commit | ff075f6ee795a590b244d70a90cc312ba1f2d83d (patch) | |
tree | a617790bdbfdeef960665ba0242e1f0c93e5301a /meta-phosphor/recipes-devtools | |
parent | 3e4da38c127bb7e7641adc2fc41f4c33744cb918 (diff) | |
download | openbmc-ff075f6ee795a590b244d70a90cc312ba1f2d83d.tar.xz |
meta-phosphor: Move layer content from common/
Adopt a more conventional directory hierarchy. meta-phosphor is still
a _long_ way from suitable for hosting on yoctoproject.org but things
like this don't help.
(From meta-phosphor rev: 471cfcefa74b8c7ceb704cb670e6d915cf27c63b)
Change-Id: I3f106b2f6cdc6cec734be28a6090800546f362eb
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'meta-phosphor/recipes-devtools')
22 files changed, 763 insertions, 0 deletions
diff --git a/meta-phosphor/recipes-devtools/i2c-tools/i2c-tools/0001-4-byte-read-support-466.patch b/meta-phosphor/recipes-devtools/i2c-tools/i2c-tools/0001-4-byte-read-support-466.patch new file mode 100644 index 000000000..31031119d --- /dev/null +++ b/meta-phosphor/recipes-devtools/i2c-tools/i2c-tools/0001-4-byte-read-support-466.patch @@ -0,0 +1,92 @@ +From 933e887fe2d9a0924a8e05efa6bc3b530b40976d Mon Sep 17 00:00:00 2001 +From: Sergey Solomin <sergey.solomin@us.ibm.com> +Date: Tue, 6 Sep 2016 15:36:43 -0500 +Subject: [PATCH 1/1] 4 byte read support 466 + +--- + tools/i2cdump.c | 34 ++++++++++++++++++++++++++++++++++ + 1 file changed, 34 insertions(+) + +diff --git a/tools/i2cdump.c b/tools/i2cdump.c +index a7bba72..99c79be 100644 +--- a/tools/i2cdump.c ++++ b/tools/i2cdump.c +@@ -25,6 +25,7 @@ + #include <string.h> + #include <stdio.h> + #include <stdlib.h> ++#include <stdint.h> + #include <unistd.h> + #include <linux/i2c.h> + #include <linux/i2c-dev.h> +@@ -33,6 +34,8 @@ + #include "util.h" + #include "../version.h" + ++#define I2C_SMBUS_DWORD 7 ++ + static void help(void) + { + fprintf(stderr, +@@ -46,6 +49,7 @@ static void help(void) + " s (SMBus block)\n" + " i (I2C block)\n" + " c (consecutive byte)\n" ++ " d (double word)\n" + " Append p for SMBus PEC\n"); + } + +@@ -184,6 +188,9 @@ int main(int argc, char *argv[]) + } else if (!strncmp(argv[flags+3], "c", 1)) { + size = I2C_SMBUS_BYTE; + pec = argv[flags+3][1] == 'p'; ++ } else if (!strncmp(argv[flags+3], "d", 1)) { ++ size = I2C_SMBUS_DWORD; ++ pec = argv[flags+3][1] == 'p'; + } else if (!strcmp(argv[flags+3], "i")) + size = I2C_SMBUS_I2C_BLOCK_DATA; + else { +@@ -285,6 +292,7 @@ int main(int argc, char *argv[]) + size == I2C_SMBUS_BLOCK_DATA ? "smbus block" : + size == I2C_SMBUS_I2C_BLOCK_DATA ? "i2c block" : + size == I2C_SMBUS_BYTE ? "byte consecutive read" : ++ size == I2C_SMBUS_DWORD ? "double word" : + size == I2C_SMBUS_BYTE_DATA ? "byte" : "word"); + if (pec) + fprintf(stderr, "PEC checking enabled.\n"); +@@ -313,6 +321,32 @@ int main(int argc, char *argv[]) + } + } + ++ /* handle mode 'd' (double word read) */ ++ if (size == I2C_SMBUS_DWORD) { ++ unsigned char buff[sizeof(uint32_t)]; ++ struct i2c_rdwr_ioctl_data msgset; ++ struct i2c_msg msg[1]; ++ ++ msg[0].addr = address; ++ msg[0].flags = I2C_M_RD; ++ msg[0].len = sizeof(buff); ++ msg[0].buf = buff; ++ ++ msgset.msgs = msg; ++ msgset.nmsgs = 1; ++ ++ if (ioctl( file, I2C_RDWR, &msgset ) < 0) { ++ fprintf(stderr, "Error: Could not read " ++ "double word. %s\n", strerror(errno)); ++ exit(1); ++ } ++ for (uint8_t n = 0; n < sizeof(buff); n++) { ++ printf ("%02x ", buff[n]); ++ } ++ printf ("\n"); ++ exit(0); ++ } ++ + /* See Winbond w83781d data sheet for bank details */ + if (bank && size != I2C_SMBUS_BLOCK_DATA) { + res = i2c_smbus_read_byte_data(file, bankreg); +-- +1.8.2.2 + diff --git a/meta-phosphor/recipes-devtools/i2c-tools/i2c-tools/0001-i2cget-Add-support-for-i2c-block-data.patch b/meta-phosphor/recipes-devtools/i2c-tools/i2c-tools/0001-i2cget-Add-support-for-i2c-block-data.patch new file mode 100644 index 000000000..fc918efe9 --- /dev/null +++ b/meta-phosphor/recipes-devtools/i2c-tools/i2c-tools/0001-i2cget-Add-support-for-i2c-block-data.patch @@ -0,0 +1,160 @@ +From d0c1fc6394b99ae4306704692910e1e158b56dcc Mon Sep 17 00:00:00 2001 +From: Crestez Dan Leonard <leonard.crestez@intel.com> +Date: Fri, 13 May 2016 21:54:25 +0300 +Subject: [PATCH] i2cget: Add support for i2c block data + +This adds mode 'i' for I2C_SMBUS_I2C_BLOCK_DATA. This is the same mode +letter from i2cdump. + +Length is optional and defaults to 32 (maximum). + +The indended use is debugging i2c devices with shell commands. + +Signed-off-by: Crestez Dan Leonard <leonard.crestez@intel.com> +--- + tools/i2cget.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++++---------- + 1 file changed, 51 insertions(+), 10 deletions(-) + +diff --git a/tools/i2cget.c b/tools/i2cget.c +index 2503942..5d8dfe7 100644 +--- a/tools/i2cget.c ++++ b/tools/i2cget.c +@@ -41,14 +41,16 @@ static void help(void) __attribute__ ((noreturn)); + static void help(void) + { + fprintf(stderr, +- "Usage: i2cget [-f] [-y] I2CBUS CHIP-ADDRESS [DATA-ADDRESS [MODE]]\n" ++ "Usage: i2cget [-f] [-y] I2CBUS CHIP-ADDRESS [DATA-ADDRESS [MODE] [LENGTH]]\n" + " I2CBUS is an integer or an I2C bus name\n" + " ADDRESS is an integer (0x03 - 0x77)\n" + " MODE is one of:\n" + " b (read byte data, default)\n" + " w (read word data)\n" + " c (write byte/read byte)\n" +- " Append p for SMBus PEC\n"); ++ " i (read I2C block data)\n" ++ " Append p for SMBus PEC\n" ++ " LENGTH is length for block data reads\n"); + exit(1); + } + +@@ -89,6 +91,13 @@ static int check_funcs(int file, int size, int daddress, int pec) + return -1; + } + break; ++ ++ case I2C_SMBUS_I2C_BLOCK_DATA: ++ if (!(funcs & I2C_FUNC_SMBUS_READ_I2C_BLOCK)) { ++ fprintf(stderr, MISSING_FUNC_FMT, "SMBus read I2C block data"); ++ return -1; ++ } ++ break; + } + + if (pec +@@ -101,7 +110,7 @@ static int check_funcs(int file, int size, int daddress, int pec) + } + + static int confirm(const char *filename, int address, int size, int daddress, +- int pec) ++ int length, int pec) + { + int dont = 0; + +@@ -132,11 +141,14 @@ static int confirm(const char *filename, int address, int size, int daddress, + fprintf(stderr, "current data\naddress"); + else + fprintf(stderr, "data address\n0x%02x", daddress); +- fprintf(stderr, ", using %s.\n", +- size == I2C_SMBUS_BYTE ? (daddress < 0 ? +- "read byte" : "write byte/read byte") : +- size == I2C_SMBUS_BYTE_DATA ? "read byte data" : +- "read word data"); ++ if (size == I2C_SMBUS_I2C_BLOCK_DATA) ++ fprintf(stderr, ", %d bytes using read I2C block data.\n", length); ++ else ++ fprintf(stderr, ", using %s.\n", ++ size == I2C_SMBUS_BYTE ? (daddress < 0 ? ++ "read byte" : "write byte/read byte") : ++ size == I2C_SMBUS_BYTE_DATA ? "read byte data" : ++ "read word data"); + if (pec) + fprintf(stderr, "PEC checking enabled.\n"); + +@@ -159,6 +171,8 @@ int main(int argc, char *argv[]) + int pec = 0; + int flags = 0; + int force = 0, yes = 0, version = 0; ++ int length; ++ __u8 block_data[I2C_SMBUS_BLOCK_MAX]; + + /* handle (optional) flags first */ + while (1+flags < argc && argv[1+flags][0] == '-') { +@@ -208,6 +222,7 @@ int main(int argc, char *argv[]) + case 'b': size = I2C_SMBUS_BYTE_DATA; break; + case 'w': size = I2C_SMBUS_WORD_DATA; break; + case 'c': size = I2C_SMBUS_BYTE; break; ++ case 'i': size = I2C_SMBUS_I2C_BLOCK_DATA; break; + default: + fprintf(stderr, "Error: Invalid mode!\n"); + help(); +@@ -215,13 +230,27 @@ int main(int argc, char *argv[]) + pec = argv[flags+4][1] == 'p'; + } + ++ if (argc > flags + 5) { ++ if (size != I2C_SMBUS_I2C_BLOCK_DATA) { ++ fprintf(stderr, "Error: Length only valid for I2C block data!\n"); ++ help(); ++ } ++ length = strtol(argv[flags+5], &end, 0); ++ if (*end || length < 1 || length > I2C_SMBUS_BLOCK_MAX) { ++ fprintf(stderr, "Error: Length invalid!\n"); ++ help(); ++ } ++ } else { ++ length = I2C_SMBUS_BLOCK_MAX; ++ } ++ + file = open_i2c_dev(i2cbus, filename, sizeof(filename), 0); + if (file < 0 + || check_funcs(file, size, daddress, pec) + || set_slave_addr(file, address, force)) + exit(1); + +- if (!yes && !confirm(filename, address, size, daddress, pec)) ++ if (!yes && !confirm(filename, address, size, daddress, length, pec)) + exit(0); + + if (pec && ioctl(file, I2C_PEC, 1) < 0) { +@@ -243,6 +272,9 @@ int main(int argc, char *argv[]) + case I2C_SMBUS_WORD_DATA: + res = i2c_smbus_read_word_data(file, daddress); + break; ++ case I2C_SMBUS_I2C_BLOCK_DATA: ++ res = i2c_smbus_read_i2c_block_data(file, daddress, length, block_data); ++ break; + default: /* I2C_SMBUS_BYTE_DATA */ + res = i2c_smbus_read_byte_data(file, daddress); + } +@@ -253,7 +285,16 @@ int main(int argc, char *argv[]) + exit(2); + } + +- printf("0x%0*x\n", size == I2C_SMBUS_WORD_DATA ? 4 : 2, res); ++ if (size == I2C_SMBUS_I2C_BLOCK_DATA) { ++ int i; ++ printf("%d:", res); ++ for (i = 0; i < res; ++i) { ++ printf(" 0x%02hhx", block_data[i]); ++ } ++ printf("\n"); ++ } else { ++ printf("0x%0*x\n", size == I2C_SMBUS_WORD_DATA ? 4 : 2, res); ++ } + + exit(0); + } +-- +2.11.0 + diff --git a/meta-phosphor/recipes-devtools/i2c-tools/i2c-tools_%.bbappend b/meta-phosphor/recipes-devtools/i2c-tools/i2c-tools_%.bbappend new file mode 100644 index 000000000..349888e8d --- /dev/null +++ b/meta-phosphor/recipes-devtools/i2c-tools/i2c-tools_%.bbappend @@ -0,0 +1,3 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" +SRC_URI =+ "file://0001-4-byte-read-support-466.patch \ + file://0001-i2cget-Add-support-for-i2c-block-data.patch" diff --git a/meta-phosphor/recipes-devtools/iotools/iotools/iotools-setup.service b/meta-phosphor/recipes-devtools/iotools/iotools/iotools-setup.service new file mode 100644 index 000000000..7cc95a0db --- /dev/null +++ b/meta-phosphor/recipes-devtools/iotools/iotools/iotools-setup.service @@ -0,0 +1,11 @@ +[Unit] +Description=Install iotool links + +[Service] +RemainAfterExit=no +Type=oneshot +ExecStart=/usr/bin/env iotools --make-links +SystlogIdentifier=iotools + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-devtools/iotools/iotools_1.6.bb b/meta-phosphor/recipes-devtools/iotools/iotools_1.6.bb new file mode 100644 index 000000000..af2cc76ac --- /dev/null +++ b/meta-phosphor/recipes-devtools/iotools/iotools_1.6.bb @@ -0,0 +1,26 @@ +DESCRIPTION = "Command line tools for hardware device registers" +HOMEPAGE = "https://github.com/jonmayergoogle/iotools" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" +SRCREV = "8d928b3360246b8ead95b442ca3887ce8b8f942f" +SRC_URI = "git://git@github.com/jonmayergoogle/iotools.git;protocol=https" +PV = "v1.6+git${SRCPV}" + +inherit obmc-phosphor-systemd + +S = "${WORKDIR}/git" +FILES_${PN} = "${sbindir}" + +do_compile() { + # CC is overridden in the Makefile, so override it harder in the invocation + oe_runmake CC="${CC}" DEBUG="${DEBUG_BUILD-0}" STATIC=0 +} + +# The "install" make target runs the binary to create links for subcommands. +# The links are excessive and this doesn't work for cross compiling. +do_install() { + install -d ${D}${sbindir} + install -m 0755 iotools ${D}${sbindir} +} + +SYSTEMD_SERVICE_${PN} += "iotools-setup.service" diff --git a/meta-phosphor/recipes-devtools/perl/yaml-tiny_1.73.bb b/meta-phosphor/recipes-devtools/perl/yaml-tiny_1.73.bb new file mode 100644 index 000000000..46640c496 --- /dev/null +++ b/meta-phosphor/recipes-devtools/perl/yaml-tiny_1.73.bb @@ -0,0 +1,19 @@ +SUMMARY = "YAML::Tiny Version 1.73" +PR = "r1" +LICENSE = "Artistic-1.0 | GPL-2.0" +HOMEPAGE = "https://metacpan.org/release/YAML-Tiny" + +inherit cpan +inherit allarch + +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Artistic-1.0;md5=cda03bbdc3c1951996392b872397b798 \ +file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" + +SRC_URI += "https://cpan.metacpan.org/authors/id/E/ET/ETHER/YAML-Tiny-1.73.tar.gz" + +SRC_URI[md5sum] = "d1bb2525e4ab46bfab4b22842c467529" +SRC_URI[sha256sum] = "bc315fa12e8f1e3ee5e2f430d90b708a5dc7e47c867dba8dce3a6b8fbe257744" + +S = "${WORKDIR}/YAML-Tiny-${PV}" + +BBCLASSEXTEND = "native" diff --git a/meta-phosphor/recipes-devtools/python/pyphosphor.bb b/meta-phosphor/recipes-devtools/python/pyphosphor.bb new file mode 100644 index 000000000..ffef08c0d --- /dev/null +++ b/meta-phosphor/recipes-devtools/python/pyphosphor.bb @@ -0,0 +1,54 @@ +SUMMARY = "Phosphor python library" +DESCRIPTION = "Phosphor python library." +HOMEPAGE = "http://github.com/openbmc/pyphosphor" +PR = "r1" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" + +inherit allarch +inherit setuptools +inherit python-dir + +PACKAGE_BEFORE_PN = " \ + ${PN}-ns \ + ${PN}-utils-ns \ + ${PN}-dbus-ns \ + ${PN}-wsgi-ns \ + ${PN}-wsgi-apps-ns \ + ${PN}-utils \ + ${PN}-dbus \ + " + +RDEPENDS_${PN}-utils-ns += "${PN}-ns" +RDEPENDS_${PN}-dbus-ns += "${PN}-ns" +RDEPENDS_${PN}-utils += "${PN}-utils-ns" +RDEPENDS_${PN}-wsgi-apps-ns += "${PN}-wsgi-ns" +RDEPENDS_${PN}-wsgi-ns += "${PN}-ns" +RDEPENDS_${PN}-dbus += " \ + ${PN}-dbus-ns \ + python-dbus \ + python-xml \ + python-json \ + python-pickle \ + " +RDEPENDS_${PN} += " \ + ${PN}-ns \ + ${PN}-dbus \ + python-subprocess \ + python-dbus \ + " + +FILES_${PN}-ns = "${PYTHON_SITEPACKAGES_DIR}/obmc/__init__.py*" +FILES_${PN}-utils-ns = "${PYTHON_SITEPACKAGES_DIR}/obmc/utils/__init__.py*" +FILES_${PN}-dbus-ns = "${PYTHON_SITEPACKAGES_DIR}/obmc/dbuslib/__init__.py*" +FILES_${PN}-wsgi-ns = "${PYTHON_SITEPACKAGES_DIR}/obmc/wsgi/__init__.py*" +FILES_${PN}-wsgi-apps-ns = "${PYTHON_SITEPACKAGES_DIR}/obmc/wsgi/apps/__init__.py*" + +FILES_${PN}-utils = "${PYTHON_SITEPACKAGES_DIR}/obmc/utils" +FILES_${PN}-dbus = "${PYTHON_SITEPACKAGES_DIR}/obmc/dbuslib" + +SRC_URI += "git://github.com/openbmc/pyphosphor" + +SRCREV = "f63e191ca673a0acd7ab5c45272e1acf51bf7183" + +S = "${WORKDIR}/git" diff --git a/meta-phosphor/recipes-devtools/python/python-bottle.inc b/meta-phosphor/recipes-devtools/python/python-bottle.inc new file mode 100644 index 000000000..159ded660 --- /dev/null +++ b/meta-phosphor/recipes-devtools/python/python-bottle.inc @@ -0,0 +1,29 @@ +SUMMARY = "Fast and simple WSGI-framework for small web-applications." +DESCRIPTION = "Bottle is a fast and simple micro-framework for small web \ +applications. It offers request dispatching (Routes) with url parameter \ +support, templates, a built-in HTTP Server and adapters for many third \ +party WSGI/HTTP-server and template engines - all in a single file and \ +with no dependencies other than the Python Standard Library." +HOMEPAGE = "http://bottlepy.org/" +SECTION = "devel/python" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=94b9b2cc7e46ccea87e00af8970826b5" + +inherit allarch +inherit setuptools +inherit pypi + +RDEPENDS_${PN} += " \ + python-email \ + python-json \ + python-netserver \ + " + +PROVIDES += "${PN}-app" +PACKAGE_BEFORE_PN += "${PN}-app" + +SUMMARY_${PN}-app = "${SRCNAME} app" +RDEPENDS_${PN}-app = "${PN}" +FILES_${PN}-app = "${bindir}/bottle.py*" + +BBCLASSEXTEND = "nativesdk" diff --git a/meta-phosphor/recipes-devtools/python/python-bottle/LICENSE b/meta-phosphor/recipes-devtools/python/python-bottle/LICENSE new file mode 100644 index 000000000..5f3e8de3a --- /dev/null +++ b/meta-phosphor/recipes-devtools/python/python-bottle/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2014, Marcel Hellkamp. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/meta-phosphor/recipes-devtools/python/python-bottle/json-format.patch b/meta-phosphor/recipes-devtools/python/python-bottle/json-format.patch new file mode 100644 index 000000000..9e754a996 --- /dev/null +++ b/meta-phosphor/recipes-devtools/python/python-bottle/json-format.patch @@ -0,0 +1,31 @@ +Index: bottle-0.12.9/bottle.py +=================================================================== +--- bottle-0.12.9.orig/bottle.py ++++ bottle-0.12.9/bottle.py +@@ -1721,8 +1721,10 @@ class JSONPlugin(object): + name = 'json' + api = 2 + +- def __init__(self, json_dumps=json_dumps): ++ def __init__(self, json_dumps=json_dumps, **kw): + self.json_dumps = json_dumps ++ self.json_kw = { x:y for x,y in kw.iteritems() \ ++ if x in ['indent','sort_keys'] } + + def apply(self, callback, route): + dumps = self.json_dumps +@@ -1735,12 +1737,12 @@ class JSONPlugin(object): + + if isinstance(rv, dict): + #Attempt to serialize, raises exception on failure +- json_response = dumps(rv) ++ json_response = dumps(rv, **self.json_kw) + #Set content type only if serialization succesful + response.content_type = 'application/json' + return json_response + elif isinstance(rv, HTTPResponse) and isinstance(rv.body, dict): +- rv.body = dumps(rv.body) ++ rv.body = dumps(rv.body, **self.json_kw) + rv.content_type = 'application/json' + return rv + diff --git a/meta-phosphor/recipes-devtools/python/python-bottle_0.12.13.bb b/meta-phosphor/recipes-devtools/python/python-bottle_0.12.13.bb new file mode 100644 index 000000000..08d84ff4a --- /dev/null +++ b/meta-phosphor/recipes-devtools/python/python-bottle_0.12.13.bb @@ -0,0 +1,10 @@ +SRC_URI[sha256sum] = "39b751aee0b167be8dffb63ca81b735bbf1dd0905b3bc42761efedee8f123355" +SRC_URI[md5sum] = "d2fe1b48c1d49217e78bf326b1cad437" + +# There is no license on pypi. See: +# https://github.com/bottlepy/bottle/commit/55a505b3a54bb7de23e9554cb8ce7f8e160c31a0 +SRC_URI += "file://LICENSE" + +SRC_URI += "file://json-format.patch" + +require python-bottle.inc diff --git a/meta-phosphor/recipes-devtools/python/python-gevent-websocket_0.10.1.bb b/meta-phosphor/recipes-devtools/python/python-gevent-websocket_0.10.1.bb new file mode 100644 index 000000000..8ac2a8982 --- /dev/null +++ b/meta-phosphor/recipes-devtools/python/python-gevent-websocket_0.10.1.bb @@ -0,0 +1,17 @@ +HOMEPAGE = "https://bitbucket.org/noppo/gevent-websocket" +SUMMARY = "A websocket library for gevent Python networking library" +DESCRIPTION = "\ + WebSocket is a computer communications protocol, providing full-duplex \ + communication channels over a single TCP connection. gevent-websocket \ + library provides websocket support for gevent. \ + " +SECTION = "devel/python" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=5aa2f1d4ea55d60497aa8c3debf29ab2" + +RDEPENDS_${PN} = "python-gevent" + +SRC_URI[md5sum] = "e095bf3358175489a956949c1b4de9ff" +SRC_URI[sha256sum] = "7eaef32968290c9121f7c35b973e2cc302ffb076d018c9068d2f5ca8b2d85fb0" + +inherit setuptools pypi diff --git a/meta-phosphor/recipes-devtools/python/python-inflection.inc b/meta-phosphor/recipes-devtools/python/python-inflection.inc new file mode 100644 index 000000000..71d218cb2 --- /dev/null +++ b/meta-phosphor/recipes-devtools/python/python-inflection.inc @@ -0,0 +1,20 @@ +SUMMARY = "A port of Ruby on Rails inflector to Python" +DESCRIPTION = "Inflection is a string transformation library. It singularizes \ +and pluralizes English words, and transforms strings from CamelCase to \ +underscored string. Inflection is a port of Ruby on Rails’ inflector to Python." +HOMEPAGE = "http://github.com/jpvanhal/inflection" +SECTION = "devel/python" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE;md5=de7833d9c2ce0052a4073928c76a13d7" + +inherit allarch +inherit setuptools +inherit pypi + +RDEPENDS_${PN} += " \ + ${PYTHON_PN}-re \ + ${PYTHON_PN}-codecs \ + " +RDEPENDS_${PN}_class-native = "" + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta-phosphor/recipes-devtools/python/python-inflection_0.3.1.bb b/meta-phosphor/recipes-devtools/python/python-inflection_0.3.1.bb new file mode 100644 index 000000000..318171c89 --- /dev/null +++ b/meta-phosphor/recipes-devtools/python/python-inflection_0.3.1.bb @@ -0,0 +1,3 @@ +SRC_URI[sha256sum] = "18ea7fb7a7d152853386523def08736aa8c32636b047ade55f7578c4edeb16ca" +SRC_URI[md5sum] = "7941165e9f148e0520023941c0886b40" +require python-inflection.inc diff --git a/meta-phosphor/recipes-devtools/python/python-mako_1.0.7.bb b/meta-phosphor/recipes-devtools/python/python-mako_1.0.7.bb new file mode 100644 index 000000000..1bc2efcc8 --- /dev/null +++ b/meta-phosphor/recipes-devtools/python/python-mako_1.0.7.bb @@ -0,0 +1,11 @@ +require recipes-devtools/python/python-mako.inc + +inherit setuptools + +RDEPENDS_${PN} = "python-threading \ + python-netclient \ + python-html \ +" +RDEPENDS_${PN}_class-native = "" + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta-phosphor/recipes-devtools/python/python-pygobject/obsolete_automake_macros.patch b/meta-phosphor/recipes-devtools/python/python-pygobject/obsolete_automake_macros.patch new file mode 100644 index 000000000..c2591123b --- /dev/null +++ b/meta-phosphor/recipes-devtools/python/python-pygobject/obsolete_automake_macros.patch @@ -0,0 +1,23 @@ +Upstream-Status: Accepted [https://bugzilla.gnome.org/show_bug.cgi?id=691101] + +Signed-off-by: Marko Lindqvist <cazfi74@gmail.com> +diff -Nurd pygobject-2.27.91/configure.ac pygobject-2.27.91/configure.ac +--- pygobject-2.27.91/configure.ac 2011-02-23 22:14:37.000000000 +0200 ++++ pygobject-2.27.91/configure.ac 2013-01-03 05:13:44.034949954 +0200 +@@ -35,7 +35,7 @@ + AC_DEFINE(PYGOBJECT_MICRO_VERSION, pygobject_micro_version, [pygobject micro version]) + AC_SUBST(PYGOBJECT_MICRO_VERSION, pygobject_micro_version) + +-AM_CONFIG_HEADER(config.h) ++AC_CONFIG_HEADERS(config.h) + m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES(yes)]) + AM_INIT_AUTOMAKE(foreign) + AM_MAINTAINER_MODE +@@ -82,7 +82,6 @@ + m4_ifdef([LT_OUTPUT], [LT_OUTPUT]) + AC_ISC_POSIX + AC_PROG_CC +-AM_PROG_CC_STDC + AM_PROG_CC_C_O + + # check that we have the minimum version of python necisary to build diff --git a/meta-phosphor/recipes-devtools/python/python-pygobject_2.28.7.bb b/meta-phosphor/recipes-devtools/python/python-pygobject_2.28.7.bb new file mode 100644 index 000000000..c6fb6fe26 --- /dev/null +++ b/meta-phosphor/recipes-devtools/python/python-pygobject_2.28.7.bb @@ -0,0 +1,53 @@ +SUMMARY = "Python GObject bindings" +SECTION = "devel/python" +LICENSE = "LGPLv2.1" + +RECIPE_NO_UPDATE_REASON = "Newer versions of python-pygobject depend on gobject-introspection which doesn't cross-compile" + +LIC_FILES_CHKSUM = "file://COPYING;md5=a916467b91076e631dd8edb7424769c7" +DEPENDS = "python python-pygobject-native libffi glib-2.0" +DEPENDS_class-native = "python-native libffi-native glib-2.0-native" +RDEPENDS_class-native = "" + +MAJ_VER = "${@d.getVar('PV',1).split('.')[0]}.${@d.getVar('PV',1).split('.')[1]}" + +SRC_URI = "${GNOME_MIRROR}/pygobject/${MAJ_VER}/pygobject-${PV}.tar.xz \ + file://obsolete_automake_macros.patch \ +" + +# libtool-native doesn't have fixinstall.patch applied which means +# that libs get relinked at installation time. This triggers a +# relinking along the lines of: +# gcc -L/tmp/foo/media/build1/poky/build/tmp/sysroots/x86_64-linux/usr/lib -lpyglib-2.0-python -o .libs/_glib.so +# where /tmp/foo is DESTDIR and pyglib-2.0-python may be installed/reinstalled +# at the same time as the gcc command runs. +# If this happens between the handoff between gcc and ld, you can see: +# /bin/ld: cannot find -lpyglib-2.0-python +# Adding a dependency rule like install-pyglibLTLIBRARIES: install-libLTLIBRARIES +# would be ideal but automake can't cope with that without manually +# defining the whole function. Give up and disable parallel make in native builds. +PARALLEL_MAKEINST_class-native = "" + +SRC_URI[md5sum] = "ae48b60c690c4aa894e69e0c97802745" +SRC_URI[sha256sum] = "bb9d25a3442ca7511385a7c01b057492095c263784ef31231ffe589d83a96a5a" +S = "${WORKDIR}/pygobject-${PV}" + +EXTRA_OECONF += "--disable-introspection" + +inherit autotools distutils-base pkgconfig + +# necessary to let the call for python-config succeed +export BUILD_SYS +export HOST_SYS +export STAGING_INCDIR +export STAGING_LIBDIR + +PACKAGES += "${PN}-lib" + +RDEPENDS_${PN} += "python-textutils" + +FILES_${PN} = "${libdir}/python*" +FILES_${PN}-lib = "${libdir}/lib*.so.*" +FILES_${PN}-dev += "${bindir} ${datadir}" + +BBCLASSEXTEND = "native" diff --git a/meta-phosphor/recipes-devtools/python/python-pyyaml_%.bbappend b/meta-phosphor/recipes-devtools/python/python-pyyaml_%.bbappend new file mode 100644 index 000000000..2a590838b --- /dev/null +++ b/meta-phosphor/recipes-devtools/python/python-pyyaml_%.bbappend @@ -0,0 +1 @@ +BBCLASSEXTEND += "nativesdk" diff --git a/meta-phosphor/recipes-devtools/python/python/0001-json-Use-int-long.__str__-to-convert-subclasses.patch b/meta-phosphor/recipes-devtools/python/python/0001-json-Use-int-long.__str__-to-convert-subclasses.patch new file mode 100644 index 000000000..26669d848 --- /dev/null +++ b/meta-phosphor/recipes-devtools/python/python/0001-json-Use-int-long.__str__-to-convert-subclasses.patch @@ -0,0 +1,128 @@ +From b002fd4b884b5f8cd3f429ea2002dd19e91d1d91 Mon Sep 17 00:00:00 2001 +From: Brad Bishop <bradleyb@fuzziesquirrel.com> +Date: Thu, 7 Jun 2018 09:18:01 -0400 +Subject: [PATCH] json: Use int/long.__str__ to convert subclasses + +Based on changes that went into 3.x: + +e0805cf10ea84b44a13ad5649267edba7cb83ee9 +a4998a70416c27730e75c0a4225ee2c3552b1618 +--- + Lib/json/encoder.py | 26 ++++++++++++++++++-------- + Modules/_json.c | 21 +++++++++++++++++---- + 2 files changed, 35 insertions(+), 12 deletions(-) + +diff --git a/Lib/json/encoder.py b/Lib/json/encoder.py +index 97ffe8e8a2..3156682fdd 100644 +--- a/Lib/json/encoder.py ++++ b/Lib/json/encoder.py +@@ -283,6 +283,8 @@ def _make_iterencode(markers, _default, _encoder, _indent, _floatstr, + long=long, + str=str, + tuple=tuple, ++ _intstr=int.__str__, ++ _longstr=long.__str__, + ): + + def _iterencode_list(lst, _current_indent_level): +@@ -317,8 +319,10 @@ def _make_iterencode(markers, _default, _encoder, _indent, _floatstr, + yield buf + 'true' + elif value is False: + yield buf + 'false' +- elif isinstance(value, (int, long)): +- yield buf + str(value) ++ elif isinstance(value, int): ++ yield buf + _intstr(value) ++ elif isinstance(value, long): ++ yield buf + _longstr(value) + elif isinstance(value, float): + yield buf + _floatstr(value) + else: +@@ -374,8 +378,10 @@ def _make_iterencode(markers, _default, _encoder, _indent, _floatstr, + key = 'false' + elif key is None: + key = 'null' +- elif isinstance(key, (int, long)): +- key = str(key) ++ elif isinstance(key, int): ++ key = _intstr(key) ++ elif isinstance(key, long): ++ key = _longstr(key) + elif _skipkeys: + continue + else: +@@ -394,8 +400,10 @@ def _make_iterencode(markers, _default, _encoder, _indent, _floatstr, + yield 'true' + elif value is False: + yield 'false' +- elif isinstance(value, (int, long)): +- yield str(value) ++ elif isinstance(value, int): ++ yield _intstr(value) ++ elif isinstance(value, long): ++ yield _longstr(value) + elif isinstance(value, float): + yield _floatstr(value) + else: +@@ -423,8 +431,10 @@ def _make_iterencode(markers, _default, _encoder, _indent, _floatstr, + yield 'true' + elif o is False: + yield 'false' +- elif isinstance(o, (int, long)): +- yield str(o) ++ elif isinstance(o, long): ++ yield _longstr(o) ++ elif isinstance(o, int): ++ yield _intstr(o) + elif isinstance(o, float): + yield _floatstr(o) + elif isinstance(o, (list, tuple)): +diff --git a/Modules/_json.c b/Modules/_json.c +index 39ec467b09..f429738145 100644 +--- a/Modules/_json.c ++++ b/Modules/_json.c +@@ -1981,12 +1981,19 @@ encoder_listencode_obj(PyEncoderObject *s, PyObject *rval, PyObject *obj, Py_ssi + return -1; + return _steal_list_append(rval, encoded); + } +- else if (PyInt_Check(obj) || PyLong_Check(obj)) { +- PyObject *encoded = PyObject_Str(obj); ++ else if (PyLong_Check(obj)) { ++ PyObject *encoded = PyLong_Type.tp_str(obj); + if (encoded == NULL) + return -1; + return _steal_list_append(rval, encoded); + } ++ else if (PyInt_Check(obj)) { ++ PyObject *encoded = PyInt_Type.tp_str(obj); ++ if (encoded == NULL) ++ return -1; ++ return _steal_list_append(rval, encoded); ++ } ++ + else if (PyFloat_Check(obj)) { + PyObject *encoded = encoder_encode_float(s, obj); + if (encoded == NULL) +@@ -2131,11 +2138,17 @@ encoder_listencode_dict(PyEncoderObject *s, PyObject *rval, PyObject *dct, Py_ss + if (kstr == NULL) + goto bail; + } +- else if (PyInt_Check(key) || PyLong_Check(key)) { +- kstr = PyObject_Str(key); ++ else if (PyLong_Check(key)) { ++ kstr = PyLong_Type.tp_str(key); + if (kstr == NULL) + goto bail; + } ++ else if (PyInt_Check(key)) { ++ kstr = PyInt_Type.tp_str(key); ++ if (kstr == NULL) ++ goto bail; ++ } ++ + else if (key == Py_True || key == Py_False || key == Py_None) { + kstr = _encoded_const(key); + if (kstr == NULL) +-- +2.14.3 + diff --git a/meta-phosphor/recipes-devtools/python/python_2.%.bbappend b/meta-phosphor/recipes-devtools/python/python_2.%.bbappend new file mode 100644 index 000000000..6d0ff6901 --- /dev/null +++ b/meta-phosphor/recipes-devtools/python/python_2.%.bbappend @@ -0,0 +1,14 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" +SRC_URI += "file://0001-json-Use-int-long.__str__-to-convert-subclasses.patch" + +require wsgiref-${PYTHON_MAJMIN}-manifest.inc + +PROVIDES_prepend = "${PN}-spwd " +PACKAGES_prepend = "${PN}-spwd " + +SUMMARY_${PN}-spwd = "Shadow database support" +RDEPENDS_${PN}-spwd = "${PN}-core" +FILES_${PN}-spwd= " \ + ${libdir}/python${PYTHON_MAJMIN}/lib-dynload/spwd.so \ + ${libdir}/python${PYTHON_MAJMIN}/lib-dynload/grp.so \ + " diff --git a/meta-phosphor/recipes-devtools/python/wsgiref-2.7-manifest.inc b/meta-phosphor/recipes-devtools/python/wsgiref-2.7-manifest.inc new file mode 100644 index 000000000..a21d05ee2 --- /dev/null +++ b/meta-phosphor/recipes-devtools/python/wsgiref-2.7-manifest.inc @@ -0,0 +1,33 @@ +NAME = "wsgiref" + +PROVIDES_prepend = "${PN}-${NAME} ${PN}-${NAME}-headers ${PN}-${NAME}-handlers ${PN}-${NAME}-validate ${PN}-${NAME}-simple_server ${PN}-${NAME}-util " +PACKAGES_prepend = "${PN}-${NAME} ${PN}-${NAME}-headers ${PN}-${NAME}-handlers ${PN}-${NAME}-validate ${PN}-${NAME}-simple_server ${PN}-${NAME}-util " + +package_dir = "${libdir}/python${PYTHON_MAJMIN}/${NAME}" + +SUMMARY_${PN}-${NAME}-handlers = "${NAME} handlers" +RDEPENDS_${PN}-${NAME}-handlers = "${PN}-${NAME}-util ${PN}-${NAME}-headers" +FILES_${PN}-${NAME}-handlers = "${package_dir}/handlers.py*" + +SUMMARY_${PN}-${NAME}-headers = "${NAME} headers" +RDEPENDS_${PN}-${NAME}-headers = "${PN}-${NAME}" +FILES_${PN}-${NAME}-headers = "${package_dir}/headers.py*" + +SUMMARY_${PN}-${NAME}-simple_server = "${NAME} simple server" +RDEPENDS_${PN}-${NAME}-simple_server = "${PN}-${NAME}-handlers" +FILES_${PN}-${NAME}-simple_server = "${package_dir}/simple_server.py*" + +SUMMARY_${PN}-${NAME}-util = "${NAME} util" +RDEPENDS_${PN}-${NAME}-util = "${PN}-${NAME}" +FILES_${PN}-${NAME}-util = "${package_dir}/util.py*" + +SUMMARY_${PN}-${NAME}-validate = "${NAME} validate" +RDEPENDS_${PN}-${NAME}-validate = "${PN}-${NAME}" +FILES_${PN}-${NAME}-validate = "${package_dir}/validate.py*" + +SUMMARY_${PN}-${NAME} = "WSGI (PEP 333) Reference Library" +RDEPENDS_${PN}-${NAME} = "${PN}-core" +FILES_${PN}-${NAME} = " \ + ${package_dir}/__init__.py* \ + ${package_dir}.egg-info \ + " diff --git a/meta-phosphor/recipes-devtools/rsync/rsync_%.bbappend b/meta-phosphor/recipes-devtools/rsync/rsync_%.bbappend new file mode 100644 index 000000000..eafb15b6d --- /dev/null +++ b/meta-phosphor/recipes-devtools/rsync/rsync_%.bbappend @@ -0,0 +1,6 @@ +EXTRA_OECONF_append += " --disable-largefile --disable-locale --disable-iconv \ + --without-included-popt --without-included-zlib" + +PACKAGECONFIG = "" + +DEPENDS_append = " popt zlib" |