aboutsummaryrefslogtreecommitdiffstats
path: root/archivers
diff options
context:
space:
mode:
authorkoobs <koobs@FreeBSD.org>2015-11-30 16:37:38 +0800
committerkoobs <koobs@FreeBSD.org>2015-11-30 16:37:38 +0800
commitb97a0f439b76ab41e9b8de4c9a2654b1761819d9 (patch)
tree1edd47b779fe570b336863c9eee8ae6507287ca8 /archivers
parent0251a8898e9b2342b578c9e56a7b591e34948c9f (diff)
downloadfreebsd-ports-gnome-b97a0f439b76ab41e9b8de4c9a2654b1761819d9.tar.gz
freebsd-ports-gnome-b97a0f439b76ab41e9b8de4c9a2654b1761819d9.tar.zst
freebsd-ports-gnome-b97a0f439b76ab41e9b8de4c9a2654b1761819d9.zip
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
Diffstat (limited to 'archivers')
-rw-r--r--archivers/Makefile2
-rw-r--r--archivers/py-liblzma/files/patch-setup.py28
-rw-r--r--archivers/py-pyliblzma/Makefile (renamed from archivers/py-liblzma/Makefile)10
-rw-r--r--archivers/py-pyliblzma/distinfo (renamed from archivers/py-liblzma/distinfo)0
-rw-r--r--archivers/py-pyliblzma/files/patch-setup.py53
-rw-r--r--archivers/py-pyliblzma/files/patch-src_liblzma.h (renamed from archivers/py-liblzma/files/patch-src_liblzma.h)0
-rw-r--r--archivers/py-pyliblzma/pkg-descr (renamed from archivers/py-liblzma/pkg-descr)0
7 files changed, 59 insertions, 34 deletions
diff --git a/archivers/Makefile b/archivers/Makefile
index 12de50219bf5..bd96ccb37ebe 100644
--- a/archivers/Makefile
+++ b/archivers/Makefile
@@ -163,10 +163,10 @@
SUBDIR += ppunpack
SUBDIR += pxz
SUBDIR += py-attic
- SUBDIR += py-liblzma
SUBDIR += py-librtfcomp
SUBDIR += py-lz4
SUBDIR += py-lzma
+ SUBDIR += py-pyliblzma
SUBDIR += py-python-snappy
SUBDIR += qpress
SUBDIR += quazip
diff --git a/archivers/py-liblzma/files/patch-setup.py b/archivers/py-liblzma/files/patch-setup.py
deleted file mode 100644
index 7ba8425aa010..000000000000
--- a/archivers/py-liblzma/files/patch-setup.py
+++ /dev/null
@@ -1,28 +0,0 @@
---- setup.py~ 2009-01-12 14:38:38.000000000 +0200
-+++ setup.py 2009-01-12 15:03:21.000000000 +0200
-@@ -23,7 +23,7 @@
- #
- import sys, os
- from warnings import warn
--from setuptools import setup, Extension
-+from distutils.core import setup, Extension
-
- descr = "Python bindings for liblzma"
- long_descr = """PylibLZMA provides a python interface for the liblzma library
-@@ -54,6 +54,8 @@
- 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(' '))
-+link_args.append('-L%s/lib' % os.environ["LOCALBASE"])
-+link_args.append('-lpython%i.%i' % sys.version_info[:2])
-
- extens=[Extension('lzma', c_files, extra_compile_args=compile_args, extra_link_args=link_args, define_macros=version_define)]
-
-@@ -74,7 +76,6 @@
- ],
- py_modules = modules,
- ext_modules = extens,
-- test_suite = 'tests',
- )
-
- sys.exit(0)
diff --git a/archivers/py-liblzma/Makefile b/archivers/py-pyliblzma/Makefile
index 6a601fa8997d..3f11e16f80c0 100644
--- a/archivers/py-liblzma/Makefile
+++ b/archivers/py-pyliblzma/Makefile
@@ -3,7 +3,7 @@
PORTNAME= liblzma
PORTVERSION= 0.5.3
-PORTREVISION= 4
+PORTREVISION= 5
CATEGORIES= archivers python
MASTER_SITES= CHEESESHOP
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
@@ -13,15 +13,15 @@ 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-patch:
- @${REINPLACE_CMD} -e 's/pc_cflags = .*/pc_cflags = ""/' \
- -e 's/pc_libs = .*/pc_libs = "-llzma"/' ${WRKSRC}/setup.py
-
post-install:
${STRIP_CMD} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/lzma.so
+do-test:
+ @cd ${WRKSRC} && ${PYTHON_CMD} ${PYDISTUTILS_SETUP} test
+
.include <bsd.port.mk>
diff --git a/archivers/py-liblzma/distinfo b/archivers/py-pyliblzma/distinfo
index ff1645e336e9..ff1645e336e9 100644
--- a/archivers/py-liblzma/distinfo
+++ b/archivers/py-pyliblzma/distinfo
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-liblzma/files/patch-src_liblzma.h b/archivers/py-pyliblzma/files/patch-src_liblzma.h
index a3e52adfb42b..a3e52adfb42b 100644
--- a/archivers/py-liblzma/files/patch-src_liblzma.h
+++ b/archivers/py-pyliblzma/files/patch-src_liblzma.h
diff --git a/archivers/py-liblzma/pkg-descr b/archivers/py-pyliblzma/pkg-descr
index 212ac2f28606..212ac2f28606 100644
--- a/archivers/py-liblzma/pkg-descr
+++ b/archivers/py-pyliblzma/pkg-descr