From 892f21154bfddd6deb8d1e314f36479785e2d554 Mon Sep 17 00:00:00 2001 From: Kubilay Kocak Date: Mon, 30 Nov 2015 08:37:38 +0000 Subject: archivers/py-liblzma: Rename to pylibzma, Modernize - Rename to match upstream (PyPI) name: pylibzma - Backport upstream issue/commit to fix build without pkg-config [1][2] - Remove post-patch: target, no longer necessary - Remove other setup.py overrides, back to upstream sources - Add do-test target: - Add LICENSE_FILE - Add MOVED entry While I'm here: - Update sysutils/bsdploy dependency [1] https://bugs.launchpad.net/pyliblzma/+bug/613837 [2] https://bazaar.launchpad.net/~proyvind/pyliblzma/trunk/revision/494 Reviewed by: sbz Approved by: dbn (maintainer timeout, 15 days) Differential Revision: D4161 --- archivers/py-pyliblzma/Makefile | 27 ++++++++++++ archivers/py-pyliblzma/distinfo | 2 + archivers/py-pyliblzma/files/patch-setup.py | 53 ++++++++++++++++++++++++ archivers/py-pyliblzma/files/patch-src_liblzma.h | 16 +++++++ archivers/py-pyliblzma/pkg-descr | 7 ++++ 5 files changed, 105 insertions(+) create mode 100644 archivers/py-pyliblzma/Makefile create mode 100644 archivers/py-pyliblzma/distinfo create mode 100644 archivers/py-pyliblzma/files/patch-setup.py create mode 100644 archivers/py-pyliblzma/files/patch-src_liblzma.h create mode 100644 archivers/py-pyliblzma/pkg-descr (limited to 'archivers/py-pyliblzma') diff --git a/archivers/py-pyliblzma/Makefile b/archivers/py-pyliblzma/Makefile new file mode 100644 index 000000000000..3f11e16f80c0 --- /dev/null +++ b/archivers/py-pyliblzma/Makefile @@ -0,0 +1,27 @@ +# Created by: David Naylor +# $FreeBSD$ + +PORTNAME= liblzma +PORTVERSION= 0.5.3 +PORTREVISION= 5 +CATEGORIES= archivers python +MASTER_SITES= CHEESESHOP +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} +DISTNAME= py${PORTNAME}-${PORTVERSION} + +MAINTAINER= dbn@FreeBSD.org +COMMENT= Python binding for the LZMA compression library + +LICENSE= LGPL3 +LICENSE_FILE= ${WRKSRC}/COPYING + +USES= pkgconfig python tar:bzip2 +USE_PYTHON= distutils autoplist + +post-install: + ${STRIP_CMD} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/lzma.so + +do-test: + @cd ${WRKSRC} && ${PYTHON_CMD} ${PYDISTUTILS_SETUP} test + +.include diff --git a/archivers/py-pyliblzma/distinfo b/archivers/py-pyliblzma/distinfo new file mode 100644 index 000000000000..ff1645e336e9 --- /dev/null +++ b/archivers/py-pyliblzma/distinfo @@ -0,0 +1,2 @@ +SHA256 (pyliblzma-0.5.3.tar.bz2) = 08d762f36d5e59fb9bb0e22e000c300b21f97e35b713321ee504cfb442667957 +SIZE (pyliblzma-0.5.3.tar.bz2) = 43498 diff --git a/archivers/py-pyliblzma/files/patch-setup.py b/archivers/py-pyliblzma/files/patch-setup.py new file mode 100644 index 000000000000..7cd8df3fc6ec --- /dev/null +++ b/archivers/py-pyliblzma/files/patch-setup.py @@ -0,0 +1,53 @@ +# allow building without pkg-config +# https://bugs.launchpad.net/pyliblzma/+bug/613837 +# https://bazaar.launchpad.net/~proyvind/pyliblzma/trunk/revision/494 + +--- setup.py.orig 2015-11-14 02:51:37 UTC ++++ setup.py +@@ -24,6 +24,7 @@ + import sys, os, subprocess + from warnings import warn + from setuptools import setup, Extension ++from distutils.ccompiler import get_default_compiler + + descr = "Python bindings for liblzma" + long_descr = """PylibLZMA provides a python interface for the liblzma library +@@ -41,21 +42,26 @@ for i in xrange(len(c_files)): + c_files[i] = os.path.join('src', c_files[i]) + + compile_args = [] +-warnflags = ['-Wall', '-Wextra', '-pedantic', '-Wswitch-enum', '-Wswitch-default'] +-compile_args.extend(warnflags) + link_args = [] +-if not subprocess.Popen('touch gnu99-test.c; gcc -std=gnu99 -E gnu99-test.c > /dev/null; rm -f gnu99-test.c', +- shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True).stdout.read(): +- compile_args.append('-std=gnu99') ++libraries = ['lzma'] + +-pc_cflags = subprocess.Popen("pkg-config --cflags liblzma", shell=True, stdout=subprocess.PIPE, close_fds=True).stdout.readline().strip() +-if(pc_cflags): +- compile_args.extend(pc_cflags.split(' ')) +-pc_libs = subprocess.Popen("pkg-config --libs liblzma", shell=True, stdout=subprocess.PIPE, close_fds=True).stdout.readline().strip() +-if(pc_libs): +- link_args.extend(pc_libs.split(' ')) ++if get_default_compiler() in ('cygwin', 'emx', 'mingw32', 'unix'): ++ warnflags = ['-Wall', '-Wextra', '-pedantic', '-Wswitch-enum', '-Wswitch-default'] ++ compile_args.extend(warnflags) + +-extens=[Extension('lzma', c_files, extra_compile_args=compile_args, extra_link_args=link_args, define_macros=version_define)] ++ if not subprocess.Popen('touch gnu99-test.c; gcc -std=gnu99 -E gnu99-test.c > /dev/null; rm -f gnu99-test.c', ++ shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True).stdout.read(): ++ compile_args.append('-std=gnu99') ++ ++ pc_cflags = subprocess.Popen("pkg-config --cflags liblzma", shell=True, stdout=subprocess.PIPE, close_fds=True).stdout.readline().strip() ++ if(pc_cflags): ++ compile_args.extend(pc_cflags.split(' ')) ++ ++ pc_libs = subprocess.Popen("pkg-config --libs liblzma", shell=True, stdout=subprocess.PIPE, close_fds=True).stdout.readline().strip() ++ if(pc_libs): ++ link_args.extend(pc_libs.split(b' ')) ++ ++extens=[Extension('lzma', c_files, extra_compile_args=compile_args, libraries=libraries, extra_link_args=link_args, define_macros=version_define)] + + setup( + name = "pyliblzma", diff --git a/archivers/py-pyliblzma/files/patch-src_liblzma.h b/archivers/py-pyliblzma/files/patch-src_liblzma.h new file mode 100644 index 000000000000..a3e52adfb42b --- /dev/null +++ b/archivers/py-pyliblzma/files/patch-src_liblzma.h @@ -0,0 +1,16 @@ +--- src/liblzma.h.orig 2010-02-20 23:07:31 UTC ++++ src/liblzma.h +@@ -8,13 +8,6 @@ + #include + #include + #include +-#if defined (__APPLE__) || defined(__FreeBSD__) || \ +- defined(__OpenBSD__) || defined(__NetBSD__) || \ +- defined (__sun) || defined (__svr4__) +-#include +-#else +-#include +-#endif + #include + #include + #if !defined(linux) && !defined(__sun) && !defined(__svr4__) diff --git a/archivers/py-pyliblzma/pkg-descr b/archivers/py-pyliblzma/pkg-descr new file mode 100644 index 000000000000..212ac2f28606 --- /dev/null +++ b/archivers/py-pyliblzma/pkg-descr @@ -0,0 +1,7 @@ +Python module implementing LZMA Utils' liblzma API + +PylibLZMA provides a python interface for the liblzma +library to read and write data that has been compressed +or can be decompressed by Lasse Collin's LZMA Utils. + +WWW: http://launchpad.net/pyliblzma -- cgit v1.2.3