Skip to contentSkip to conversation

python-crc16: new package

PATCH New Michael Rommel 2 participants 2 messages Sep 18, 2013

v3 of 4 New Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 python-crc16: new package

A python library that calculates CRC checksums of the CCITT/XModem variant.

---
Changes v2 -> v3
* changed homepage URL
* added LDFLAGS for correct linking

Changes v1 -> v2
* corrected a typo in the filename for the .mk file

 package/Config.in                    |    1 +
 package/python-crc16/Config.in       |   11 +++++++++++
 package/python-crc16/python-crc16.mk |   35 ++++++++++++++++++++++++++++++++++
 3 files changed, 47 insertions(+)
 create mode 100644 package/python-crc16/Config.in
 create mode 100644 package/python-crc16/python-crc16.mk
package/Config.in +1 -0
index 56c316e..779e9da 100644
@@ -385,6 +385,7 @@ source "package/python/Config.in"
 if BR2_PACKAGE_PYTHON
 menu "external python modules"
 source "package/python-bottle/Config.in"
+source "package/python-crc16/Config.in"
 source "package/python-dpkt/Config.in"
 source "package/python-id3/Config.in"
 source "package/python-mad/Config.in"
package/python-crc16/Config.in new file +11 -0
new file mode 100644
index 0000000..3fd8da7
@@ -0,0 +1,11 @@
+config BR2_PACKAGE_PYTHON_CRC16
+	bool "python-crc16"
+	depends on BR2_PACKAGE_PYTHON
+	help
+	  This library calculates only CRC16 (16-bit codes) and the
+	  only supported variant at the moment is CRC-CCITT (XModem).
+	  CRC is a way of detecting accidental changes in data storage
+	  or transmission. There are many variants of CRC and CRC16,
+	  in particular.
+
+	  http://pycrc16.googlecode.com/
package/python-crc16/python-crc16.mk new file +35 -0
new file mode 100644
index 0000000..adfdcc6
@@ -0,0 +1,35 @@
+################################################################################
+#
+# python-crc16
+#
+################################################################################
+
+PYTHON_CRC16_VERSION = 0.1.1
+PYTHON_CRC16_SOURCE = crc16-$(PYTHON_CRC16_VERSION).tar.gz
+PYTHON_CRC16_SITE = http://pycrc16.googlecode.com/files/
+PYTHON_CRC16_LICENSE = LGPLv3+
+PYTHON_CRC16_LICENSE_FILES = COPYING.txt
+PYTHON_CRC16_DEPENDENCIES = python host-python
+
+PYTHON_CRC16_PARAMS = CC="$(TARGET_CC)" \
+		CFLAGS="$(TARGET_CFLAGS)" \
+		LDSHARED="$(TARGET_CC) -shared" \
+		LDFLAGS="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/usr/lib" \
+		CROSS_COMPILING=yes \
+		_python_sysroot=$(STAGING_DIR) \
+		_python_srcdir=$(PYTHON_DIR) \
+		_python_prefix=/usr \
+		_python_exec_prefix=/usr
+
+define PYTHON_CRC16_BUILD_CMDS
+	(cd $(@D); $(PYTHON_CRC16_PARAMS) \
+		$(HOST_DIR)/usr/bin/python setup.py build)
+endef
+
+define PYTHON_CRC16_INSTALL_TARGET_CMDS
+	(cd $(@D); $(PYTHON_CRC16_PARAMS) \
+		$(HOST_DIR)/usr/bin/python setup.py install \
+		--prefix=$(TARGET_DIR)/usr)
+endef
+
+$(eval $(generic-package))
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v3 1/1 python-crc16: new package

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Michael" == Michael Rommel <[email protected]> writes:

Michael> A python library that calculates CRC checksums of the CCITT/XModem Michael> variant.

Michael> Signed-off-by: Michael Rommel <[email protected]> Michael> ---
Michael> Changes v2 -> v3
Michael> * changed homepage URL
Michael> * added LDFLAGS for correct linking

Michael> Changes v1 -> v2
Michael> * corrected a typo in the filename for the .mk file

 Michael>  package/Config.in                    |    1 +
 Michael>  package/python-crc16/Config.in       |   11 +++++++++++
 Michael>  package/python-crc16/python-crc16.mk |   35 ++++++++++++++++++++++++++++++++++
 Michael>  3 files changed, 47 insertions(+)
 Michael>  create mode 100644 package/python-crc16/Config.in
 Michael>  create mode 100644 package/python-crc16/python-crc16.mk

Michael> diff --git a/package/Config.in b/package/Config.in Michael> index 56c316e..779e9da 100644
Michael> --- a/package/Config.in
Michael> +++ b/package/Config.in
Michael> @@ -385,6 +385,7 @@ source "package/python/Config.in"

 Michael>  if BR2_PACKAGE_PYTHON
 Michael>  menu "external python modules"
 Michael>  source "package/python-bottle/Config.in"
 Michael> +source "package/python-crc16/Config.in"
 Michael>  source "package/python-dpkt/Config.in"
 Michael>  source "package/python-id3/Config.in"
 Michael>  source "package/python-mad/Config.in"
 Michael> diff --git a/package/python-crc16/Config.in b/package/python-crc16/Config.in
 Michael> new file mode 100644
 Michael> index 0000000..3fd8da7
 Michael> --- /dev/null
 Michael> +++ b/package/python-crc16/Config.in
 Michael> @@ -0,0 +1,11 @@
 Michael> +config BR2_PACKAGE_PYTHON_CRC16
 Michael> +	bool "python-crc16"
 Michael> +	depends on BR2_PACKAGE_PYTHON
 Michael> +	help
 Michael> +	  This library calculates only CRC16 (16-bit codes) and the
 Michael> +	  only supported variant at the moment is CRC-CCITT (XModem).
 Michael> +	  CRC is a way of detecting accidental changes in data storage
 Michael> +	  or transmission. There are many variants of CRC and CRC16,
 Michael> +	  in particular.

Michael> +
Michael> + http://pycrc16.googlecode.com/
Michael> diff --git a/package/python-crc16/python-crc16.mk b/package/python-crc16/python-crc16.mk Michael> new file mode 100644
Michael> index 0000000..adfdcc6
Michael> --- /dev/null
Michael> +++ b/package/python-crc16/python-crc16.mk
Michael> @@ -0,0 +1,35 @@
Michael> +################################################################################ Michael> +#
Michael> +# python-crc16
Michael> +#
Michael> +################################################################################ Michael> +
Michael> +PYTHON_CRC16_VERSION = 0.1.1
Michael> +PYTHON_CRC16_SOURCE = crc16-$(PYTHON_CRC16_VERSION).tar.gz
Michael> +PYTHON_CRC16_SITE = http://pycrc16.googlecode.com/files/
Michael> +PYTHON_CRC16_LICENSE = LGPLv3+
Michael> +PYTHON_CRC16_LICENSE_FILES = COPYING.txt
Michael> +PYTHON_CRC16_DEPENDENCIES = python host-python
Michael> +
Michael> +PYTHON_CRC16_PARAMS = CC="$(TARGET_CC)" \
Michael> + CFLAGS="$(TARGET_CFLAGS)" \
Michael> + LDSHARED="$(TARGET_CC) -shared" \
Michael> + LDFLAGS="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/usr/lib" \

The LDFLAGS thing is a bit hackish as it still passes -L/usr/lib, but the python stuff doesn't really seem forseen for cross compilation.

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard