View | Details | Raw Unified | Return to bug 230114 | Differences between
and this patch

Collapse All | Expand All

(-)textproc/scancode-toolkit/Makefile (+126 lines)
Line 0 Link Here
1
# $FreeBSD$
2
3
PORTNAME=	scancode-toolkit
4
DISTVERSIONPREFIX=	v
5
DISTVERSION=	2.9.2
6
CATEGORIES=	textproc python
7
8
MAINTAINER=	freebsd_ports@k-worx.org
9
COMMENT=	Scans code for license, copyright, package and documented dependencies
10
11
LICENSE=	APACHE20 CC0-1.0
12
LICENSE_COMB=	multi
13
LICENSE_FILE_APACHE20=	${WRKSRC}/apache-2.0.LICENSE
14
LICENSE_FILE_CC0-1.0=	${WRKSRC}/cc0-1.0.LICENSE
15
16
RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}nltk>=3.2:textproc/py-nltk@${PY_FLAVOR} \
17
		${PYTHON_PKGNAMEPREFIX}url>=0.1.4:www/py-url@${PY_FLAVOR} \
18
		${PYTHON_PKGNAMEPREFIX}fingerprints>=0.5.4:textproc/py-fingerprints@${PY_FLAVOR} \
19
		${PYTHON_PKGNAMEPREFIX}patch>=1.15:devel/py-patch@${PY_FLAVOR} \
20
		${PYTHON_PKGNAMEPREFIX}bz2file>=0.98:archivers/py-bz2file@${PY_FLAVOR} \
21
		${PYTHON_PKGNAMEPREFIX}backports.os=0.1.1:devel/py-backports.os@${PY_FLAVOR} \
22
		${PYTHON_PKGNAMEPREFIX}future>=0.16.0:devel/py-future@${PY_FLAVOR} \
23
		${PYTHON_PKGNAMEPREFIX}text-unidecode>=1.0:converters/py-text-unidecode@${PY_FLAVOR} \
24
		${PYTHON_PKGNAMEPREFIX}bitarray>=0.8.1:devel/py-bitarray@${PY_FLAVOR} \
25
		${PYTHON_PKGNAMEPREFIX}intbitset>=2.3.0:devel/py-intbitset@${PY_FLAVOR} \
26
		${PYTHON_PKGNAMEPREFIX}boolean.py>=3.5:devel/py-boolean.py@${PY_FLAVOR} \
27
		${PYTHON_PKGNAMEPREFIX}license-expression>=0.9.7:textproc/py-license-expression@${PY_FLAVOR} \
28
		${PYTHON_PKGNAMEPREFIX}pyahocorasick>=1.1:textproc/py-pyahocorasick@${PY_FLAVOR} \
29
		${PYTHON_PKGNAMEPREFIX}yaml>=3.0:devel/py-yaml@${PY_FLAVOR} \
30
		${PYTHON_PKGNAMEPREFIX}beautifulsoup32>=3.2.0:www/py-beautifulsoup32@${PY_FLAVOR} \
31
		${PYTHON_PKGNAMEPREFIX}beautifulsoup>=4.3.0:www/py-beautifulsoup@${PY_FLAVOR} \
32
		${PYTHON_PKGNAMEPREFIX}html5lib>=0:www/py-html5lib@${PY_FLAVOR} \
33
		${PYTHON_PKGNAMEPREFIX}six>=0:devel/py-six@${PY_FLAVOR} \
34
		${PYTHON_PKGNAMEPREFIX}pdfminer.six>=20170720:textproc/py-pdfminer.six@${PY_FLAVOR} \
35
		${PYTHON_PKGNAMEPREFIX}pycryptodome>=3.4:security/py-pycryptodome@${PY_FLAVOR} \
36
		${PYTHON_PKGNAMEPREFIX}binaryornot>=0.4.0:devel/py-binaryornot@${PY_FLAVOR} \
37
		${PYTHON_PKGNAMEPREFIX}chardet>=3.0.0:textproc/py-chardet@${PY_FLAVOR} \
38
		${PYTHON_PKGNAMEPREFIX}pygments>=2.0.1:textproc/py-pygments@${PY_FLAVOR} \
39
		${PYTHON_PKGNAMEPREFIX}pefile>=1.2.10-13-2:devel/py-pefile@${PY_FLAVOR} \
40
		${PYTHON_PKGNAMEPREFIX}pymaven-patch>=0.2.4:devel/py-pymaven-patch@${PY_FLAVOR} \
41
		${PYTHON_PKGNAMEPREFIX}requests>=2.7.0:www/py-requests@${PY_FLAVOR} \
42
		${PYTHON_PKGNAMEPREFIX}schematics-patched>=0:devel/py-schematics-patched@${PY_FLAVOR} \
43
		${PYTHON_PKGNAMEPREFIX}packageurl-python>=0.5.0:textproc/py-packageurl-python@${PY_FLAVOR} \
44
		${PYTHON_PKGNAMEPREFIX}click>=6.0.0:devel/py-click@${PY_FLAVOR} \
45
		${PYTHON_PKGNAMEPREFIX}colorama>=0.3.9:devel/py-colorama@${PY_FLAVOR} \
46
		${PYTHON_PKGNAMEPREFIX}pluggy>=0.4.0:devel/py-pluggy@${PY_FLAVOR} \
47
		${PYTHON_PKGNAMEPREFIX}attrs>=17.0:devel/py-attrs@${PY_FLAVOR} \
48
		${PYTHON_PKGNAMEPREFIX}typing>=3.6:devel/py-typing@${PY_FLAVOR} \
49
		${PYTHON_PKGNAMEPREFIX}Jinja2>=2.7.0:devel/py-Jinja2@${PY_FLAVOR} \
50
		${PYTHON_PKGNAMEPREFIX}MarkupSafe>=0.23:textproc/py-MarkupSafe@${PY_FLAVOR} \
51
		${PYTHON_PKGNAMEPREFIX}simplejson>=0:devel/py-simplejson@${PY_FLAVOR} \
52
		${PYTHON_PKGNAMEPREFIX}spdx-tools>=0.5.4:misc/py-spdx-tools@${PY_FLAVOR} \
53
		${PYTHON_PKGNAMEPREFIX}unicodecsv>=0:devel/py-unicodecsv@${PY_FLAVOR} \
54
		${PYTHON_PKGNAMEPREFIX}psutil>=5.0.0:sysutils/py-psutil@${PY_FLAVOR} \
55
		${PYTHON_PKGNAMEPREFIX}yg.lockfile>=2.0.1:devel/py-yg.lockfile@${PY_FLAVOR} \
56
		${PYTHON_PKGNAMEPREFIX}zclockfile>=1.0.0:devel/py-zclockfile@${PY_FLAVOR} \
57
		${PYTHON_PKGNAMEPREFIX}contextlib2>=0:devel/py-contextlib2@${PY_FLAVOR} \
58
		${PYTHON_PKGNAMEPREFIX}pytz>=0:devel/py-pytz@${PY_FLAVOR} \
59
		${PYTHON_PKGNAMEPREFIX}tempora>=0:devel/py-tempora@${PY_FLAVOR} \
60
		${PYTHON_PKGNAMEPREFIX}jaraco.timing>=0:devel/py-jaraco.timing@${PY_FLAVOR} \
61
		${PYTHON_PKGNAMEPREFIX}lxml>=3.6.4:devel/py-lxml@${PY_FLAVOR} \
62
		${PY_IPADDRESS} \
63
		${LOCALBASE}/bin/7z:archivers/p7zip
64
65
USES=		python:2.7
66
USE_PYTHON=	distutils autoplist noflavors
67
USE_GITHUB=	yes
68
GH_ACCOUNT=	nexB
69
70
# The upstream package comes with precompiled binaries of libmagic, p7zip and
71
# zlib. Those binaries are sorted in directories like bin/platform-32,
72
# bin/platform-64, etc.
73
#
74
# Packaging these binaries that are targetted for different platforms is a bit
75
# of waste thus we get rid of those files and create architecture specific
76
# directories for FreeBSD with symlinks from the base system and LOCALBASE
77
# (for p7zip).
78
#
79
# The best way would be to set NO_ARCH by using a architecture neutral directory
80
# for FreeBSD (e.g. bin/freebsd but that would require a lot of tampering in
81
# upstream's codebase.
82
83
# Check for 32-bit architectures otherwise assume we have an 64-bit architecture
84
ARCHBITS=	${ARCH:C/arm(v.*|eb)?$/32/:S/i386/32/:C/mips([efhn]+.*)?$/32/:C/powerpc(spe)?$/32/}
85
86
# Check if the architecture is either 32- or 64-bit
87
.if ${ARCHBITS} == 32
88
ARCHDIR=	freebsd-32
89
.else
90
ARCHDIR=	freebsd-64
91
.endif
92
93
PRUNEDIRS=	notices linux-32 linux-64 mac-64 win-32 win-64 README.md
94
95
post-extract:
96
# Prune unneeded directories and binaries that are targetted for other architectures
97
.for d in ${PRUNEDIRS}
98
	@${RM} -r ${WRKSRC}/src/extractcode/bin/$d
99
	@${RM} -r ${WRKSRC}/src/typecode/bin/$d
100
	@${RM} -r ${WRKSRC}/src/typecode/data/magic/$d
101
.endfor
102
103
# Create FreeBSD architecture specific directories (either freebsd-32 or freebsd-64)
104
	@${MKDIR} ${WRKSRC}/src/extractcode/bin/${ARCHDIR}/bin
105
	@${MKDIR} ${WRKSRC}/src/extractcode/bin/${ARCHDIR}/lib
106
	@${MKDIR} ${WRKSRC}/src/typecode/bin/${ARCHDIR}/lib
107
108
# Create placeholder files to prevent skipping of empty directories during install
109
# Note: magic.mgc will be replaced in the post-install target
110
	@${ECHO} DUMMY > ${WRKSRC}/src/extractcode/bin/${ARCHDIR}/bin/7z
111
	@${ECHO} DUMMY > ${WRKSRC}/src/extractcode/bin/${ARCHDIR}/bin/7z.so
112
	@${ECHO} DUMMY > ${WRKSRC}/src/extractcode/bin/${ARCHDIR}/lib/libarchive.so
113
	@${ECHO} DUMMY > ${WRKSRC}/src/typecode/bin/${ARCHDIR}/lib/libmagic.so
114
115
post-patch:
116
	@${FIND} ${WRKSRC} -name "*.orig" -or -name "*.bak" -delete
117
118
post-install:
119
# Create the symlinks for libmagic, p7zip and zlib by overwriting the placeholders
120
	@${LN} -sf ${LOCALBASE}/bin/7z ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/extractcode/bin/${ARCHDIR}/bin/7z
121
	@${LN} -sf ${LOCALBASE}/libexec/p7zip/7z.so ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/extractcode/bin/${ARCHDIR}/bin/7z.so
122
	@${LN} -sf /usr/lib/libarchive.so ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/extractcode/bin/${ARCHDIR}/lib/libarchive.so
123
	@${LN} -sf /usr/lib/libmagic.so ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/typecode/bin/${ARCHDIR}/lib/libmagic.so
124
	@${LN} -sf /usr/share/misc/magic.mgc ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/typecode/data/magic/noarch/magic.mgc
125
126
.include <bsd.port.mk>
(-)scancode-toolkit/distinfo (+3 lines)
Line 0 Link Here
1
TIMESTAMP = 1530172103
2
SHA256 (nexB-scancode-toolkit-v2.9.2_GH0.tar.gz) = d2f7e320961666c024ac520707157bec8f1c17cfe9234589d72c152b5ae0c5da
3
SIZE (nexB-scancode-toolkit-v2.9.2_GH0.tar.gz) = 143799927
(-)scancode-toolkit/files/patch-setup.py (+31 lines)
Line 0 Link Here
1
--- setup.py.orig	2018-05-08 13:54:52 UTC
2
+++ setup.py
3
@@ -125,8 +125,8 @@ setup(
4
         # cluecode
5
         # Some nltk version ranges are buggy
6
         'nltk >= 3.2, < 4.0',
7
-        'publicsuffix2',
8
-        'py2-ipaddress >= 2.0, <3.0',
9
+        #'publicsuffix2',
10
+        #'py2-ipaddress >= 2.0, <3.0',
11
         'url >= 0.1.4',
12
         'fingerprints >= 0.5.4',
13
 
14
@@ -163,7 +163,7 @@ setup(
15
         'pygments >= 2.0.1, <3.0.0',
16
 
17
         # packagedcode
18
-        'pefile == 1.2.10-132',
19
+        'pefile >= 1.2.10-132',
20
         'pymaven-patch >= 0.2.4',
21
         'requests >= 2.7.0, < 3.0.0',
22
         'schematics_patched',
23
@@ -173,7 +173,7 @@ setup(
24
         'click >= 6.0.0, < 7.0.0',
25
         'colorama >= 0.3.9',
26
         'pluggy >= 0.4.0, < 1.0',
27
-        'attrs >=17.0, < 18.0',
28
+        'attrs >=17.0',
29
         'typing >=3.6, < 3.7',
30
 
31
         # scancode outputs
(-)scancode-toolkit/files/patch-src_commoncode_system.py (+30 lines)
Line 0 Link Here
1
--- src/commoncode/system.py.orig	2018-05-08 13:54:52 UTC
2
+++ src/commoncode/system.py
3
@@ -46,6 +46,8 @@ def os_arch():
4
         os = 'win'
5
     elif 'darwin' in sys_platform:
6
         os = 'mac'
7
+    elif 'freebsd' in sys_platform:
8
+        os = 'freebsd'
9
     else:
10
         raise Exception('Unsupported OS/platform %r' % sys_platform)
11
     return os, arch
12
@@ -84,7 +86,8 @@ current_os, current_arch = os_arch()
13
 on_windows = current_os == 'win'
14
 on_mac = current_os == 'mac'
15
 on_linux = current_os == 'linux'
16
-on_posix = not on_windows and (on_mac or on_linux)
17
+on_freebsd = current_os == 'freebsd'
18
+on_posix = not on_windows and (on_mac or on_linux or on_freebsd)
19
 
20
 current_os_arch = '%(current_os)s-%(current_arch)s' % locals()
21
 noarch = 'noarch'
22
@@ -97,7 +100,7 @@ if on_windows:
23
     lib_ext = '.dll'
24
 if on_mac:
25
     lib_ext = '.dylib'
26
-if on_linux:
27
+if on_linux or on_freebsd:
28
     lib_ext = '.so'
29
 
30
 #
(-)scancode-toolkit/pkg-descr (+5 lines)
Line 0 Link Here
1
ScanCode scans code and detects licenses, copyrights, package manifests,
2
dependencies and more. It can be also used to discover and inventory open source
3
and third-party packages used in your code. 
4
5
WWW: https://github.com/nexB/scancode-toolkit

Return to bug 230114