Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK)) by mollari.NetBSD.org (Postfix) with ESMTPS id 0BCA37A2AC for ; Tue, 21 Jun 2016 18:00:05 +0000 (UTC) Received: by mail.netbsd.org (Postfix, from userid 605) id AC5EC85EB5; Tue, 21 Jun 2016 18:00:04 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 3C08785EA8 for ; Tue, 21 Jun 2016 18:00:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id 4vhnGQgZcWe0 for ; Tue, 21 Jun 2016 18:00:02 +0000 (UTC) Received: from cvs.NetBSD.org (unknown [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id DDAFB85E87 for ; Tue, 21 Jun 2016 18:00:02 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id DB557FBB5; Tue, 21 Jun 2016 18:00:02 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1466532002139970" MIME-Version: 1.0 Date: Tue, 21 Jun 2016 18:00:02 +0000 From: "Joerg Sonnenberger" Subject: CVS commit: pkgsrc/devel/py-hash To: pkgsrc-changes@NetBSD.org Reply-To: joerg@netbsd.org X-Mailer: log_accum Message-Id: <20160621180002.DB557FBB5@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: pkgsrc-changes.NetBSD.org Precedence: bulk This is a multi-part message in MIME format. --_----------=_1466532002139970 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: joerg Date: Tue Jun 21 18:00:02 UTC 2016 Modified Files: pkgsrc/devel/py-hash: Makefile distinfo pkgsrc/devel/py-hash/patches: patch-setup.py patch-src_lookup3_lookup3.c Added Files: pkgsrc/devel/py-hash/patches: patch-pyhash.py Log Message: Fix endian detection to work on all pkgsrc platforms. Fix Python3 support. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 pkgsrc/devel/py-hash/Makefile cvs rdiff -u -r1.1 -r1.2 pkgsrc/devel/py-hash/distinfo cvs rdiff -u -r0 -r1.1 pkgsrc/devel/py-hash/patches/patch-pyhash.py cvs rdiff -u -r1.1 -r1.2 pkgsrc/devel/py-hash/patches/patch-setup.py \ pkgsrc/devel/py-hash/patches/patch-src_lookup3_lookup3.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_1466532002139970 Content-Disposition: inline Content-Length: 13786 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/devel/py-hash/Makefile diff -u pkgsrc/devel/py-hash/Makefile:1.2 pkgsrc/devel/py-hash/Makefile:1.3 --- pkgsrc/devel/py-hash/Makefile:1.2 Tue May 3 19:27:12 2016 +++ pkgsrc/devel/py-hash/Makefile Tue Jun 21 18:00:02 2016 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.2 2016/05/03 19:27:12 jperkin Exp $ +# $NetBSD: Makefile,v 1.3 2016/06/21 18:00:02 joerg Exp $ DISTNAME= pyfasthash-0.6.2 PKGNAME= ${DISTNAME:S/pyfast/${PYPKGPREFIX}-/} @@ -18,6 +18,13 @@ EGG_NAME= ${DISTNAME:S/fast//} PYTHON_VERSIONS_INCOMPATIBLE= 33 # devel/py-boost +.include "../../mk/endian.mk" +.if ${MACHINE_ENDIAN} == "little" +CPPFLAGS+= -DHASH_LITTLE_ENDIAN=1 -DHASH_BIG_ENDIAN=0 +.else +CPPFLAGS+= -DHASH_LITTLE_ENDIAN=0 -DHASH_BIG_ENDIAN=1 +.endif + .include "../../devel/py-boost/buildlink3.mk" .include "../../lang/python/egg.mk" .include "../../mk/bsd.pkg.mk" Index: pkgsrc/devel/py-hash/distinfo diff -u pkgsrc/devel/py-hash/distinfo:1.1 pkgsrc/devel/py-hash/distinfo:1.2 --- pkgsrc/devel/py-hash/distinfo:1.1 Tue May 3 14:53:05 2016 +++ pkgsrc/devel/py-hash/distinfo Tue Jun 21 18:00:02 2016 @@ -1,9 +1,10 @@ -$NetBSD: distinfo,v 1.1 2016/05/03 14:53:05 fhajny Exp $ +$NetBSD: distinfo,v 1.2 2016/06/21 18:00:02 joerg Exp $ SHA1 (pyfasthash-0.6.2.tar.gz) = e703ff597cd8db8bfd83f44f0e42e7ac9153c302 RMD160 (pyfasthash-0.6.2.tar.gz) = 3a6e3f5015c8b2c8d4a7f2bc04ef0ca7f75eabb6 SHA512 (pyfasthash-0.6.2.tar.gz) = 1820a56f27dd58d1aff4657230b1e5c9b276d64fc1573ad5c14612efd92d584070f12414a9e4fd9929eb61e054a6d65dc6ce1f25457431eaf736c38ecb6fc9be Size (pyfasthash-0.6.2.tar.gz) = 197576 bytes -SHA1 (patch-setup.py) = c3eb408f636d3db00d1a72da4dfa190cc2350291 +SHA1 (patch-pyhash.py) = 6e9428959693b72c8efe50ed272b8c1610a682c5 +SHA1 (patch-setup.py) = e993f644120ab43eb4853624fc78de0bb33b8880 SHA1 (patch-src_fnv_fnv.h) = c942d2bb434ffdc99a6110781bf66e5cb878a889 -SHA1 (patch-src_lookup3_lookup3.c) = 7f4ffad27d55f1c2d52288b9cb2afb1c5af8213b +SHA1 (patch-src_lookup3_lookup3.c) = 85e5be79ddf7050af7e98858610323accdaba453 Index: pkgsrc/devel/py-hash/patches/patch-setup.py diff -u pkgsrc/devel/py-hash/patches/patch-setup.py:1.1 pkgsrc/devel/py-hash/patches/patch-setup.py:1.2 --- pkgsrc/devel/py-hash/patches/patch-setup.py:1.1 Tue May 3 14:53:05 2016 +++ pkgsrc/devel/py-hash/patches/patch-setup.py Tue Jun 21 18:00:02 2016 @@ -1,11 +1,38 @@ -$NetBSD: patch-setup.py,v 1.1 2016/05/03 14:53:05 fhajny Exp $ +$NetBSD: patch-setup.py,v 1.2 2016/06/21 18:00:02 joerg Exp $ print is a function in Python 3. --- setup.py.orig 2014-07-29 06:26:59.000000000 +0000 +++ setup.py -@@ -63,7 +63,7 @@ elif os.name == "posix": - extra_compile_args += ["-msse4.2"] +@@ -3,6 +3,7 @@ + import sys + import os + import math ++import platform + + from ez_setup import use_setuptools + use_setuptools() +@@ -56,14 +57,22 @@ elif os.name == "posix" and sys.platform + '/opt/local/include', + '/usr/local/include' + ] +- libraries += ["boost_python-mt"] +- extra_compile_args += ["-msse4.2"] ++ if sys.version_info.major == 2: ++ libraries += ["boost_python-mt"] ++ else: ++ libraries += ["boost_python3-mt"] ++ if platform.machine() in ("i386", "amd64"): ++ extra_compile_args += ["-msse4.2"] + elif os.name == "posix": +- libraries += ["boost_python", "rt"] +- extra_compile_args += ["-msse4.2"] ++ if sys.version_info.major == 2: ++ libraries += ["boost_python", "rt"] ++ else: ++ libraries += ["boost_python3", "rt"] ++ if platform.machine() in ("i386", "amd64"): ++ extra_compile_args += ["-msse4.2"] if os.getenv('TRAVIS') == 'true': - print "force to link boost::python base on Python version v%d.%d" % (sys.version_info.major, sys.version_info.minor) Index: pkgsrc/devel/py-hash/patches/patch-src_lookup3_lookup3.c diff -u pkgsrc/devel/py-hash/patches/patch-src_lookup3_lookup3.c:1.1 pkgsrc/devel/py-hash/patches/patch-src_lookup3_lookup3.c:1.2 --- pkgsrc/devel/py-hash/patches/patch-src_lookup3_lookup3.c:1.1 Tue May 3 14:53:05 2016 +++ pkgsrc/devel/py-hash/patches/patch-src_lookup3_lookup3.c Tue Jun 21 18:00:02 2016 @@ -1,15 +1,22 @@ -$NetBSD: patch-src_lookup3_lookup3.c,v 1.1 2016/05/03 14:53:05 fhajny Exp $ +$NetBSD: patch-src_lookup3_lookup3.c,v 1.2 2016/06/21 18:00:02 joerg Exp $ -SunOS doesn't have endian.h. +Use pkgsrc's endian detection. --- src/lookup3/lookup3.c.orig 2014-07-29 06:26:59.000000000 +0000 +++ src/lookup3/lookup3.c -@@ -47,7 +47,7 @@ typedef unsigned int uint32_t; - # include /* attempt to define endianness */ - # if defined(__APPLE__) - # include --# else -+# elif !defined(__sun) - # include /* attempt to define endianness */ - # endif +@@ -38,6 +38,7 @@ on 1 byte), but shoehorning those bytes + #include /* defines printf for tests */ + #include /* defines time_t for timings in the test */ + ++#if !defined(HASH_LITTLE_ENDIAN) && !defined(HASH_BIG_ENDIAN) + #ifdef WIN32 + typedef unsigned char uint8_t; + typedef unsigned short uint16_t; +@@ -71,6 +72,7 @@ typedef unsigned int uint32_t; + # define HASH_LITTLE_ENDIAN 0 + # define HASH_BIG_ENDIAN 0 #endif ++#endif + + #define hashsize(n) ((uint32_t)1<<(n)) + #define hashmask(n) (hashsize(n)-1) Added files: Index: pkgsrc/devel/py-hash/patches/patch-pyhash.py diff -u /dev/null pkgsrc/devel/py-hash/patches/patch-pyhash.py:1.1 --- /dev/null Tue Jun 21 18:00:02 2016 +++ pkgsrc/devel/py-hash/patches/patch-pyhash.py Tue Jun 21 18:00:02 2016 @@ -0,0 +1,184 @@ +$NetBSD: patch-pyhash.py,v 1.1 2016/06/21 18:00:02 joerg Exp $ + +--- pyhash.py.orig 2014-07-29 06:26:59.000000000 +0000 ++++ pyhash.py +@@ -58,9 +58,9 @@ class TestHasher(unittest.TestCase): + class TestFNV1(TestHasher): + def testFNV1_32(self): + self.doTest(hasher_type=fnv1_32, +- bytes_hash=3698262380L, ++ bytes_hash=3698262380, + seed_hash=660137056, +- unicode_hash=3910690890L) ++ unicode_hash=3910690890) + + def testFNV1a_32(self): + self.doTest(hasher_type=fnv1a_32, +@@ -70,15 +70,15 @@ class TestFNV1(TestHasher): + + def testFNV1_64(self): + self.doTest(hasher_type=fnv1_64, +- bytes_hash=17151984479173897804L, +- seed_hash=6349570372626520864L, +- unicode_hash=14017453969697934794L) ++ bytes_hash=17151984479173897804, ++ seed_hash=6349570372626520864, ++ unicode_hash=14017453969697934794) + + def testFNV1a_64(self): + self.doTest(hasher_type=fnv1a_64, +- bytes_hash=11830222609977404196L, +- seed_hash=8858165303110309728L, +- unicode_hash=14494269412771327550L) ++ bytes_hash=11830222609977404196, ++ seed_hash=8858165303110309728, ++ unicode_hash=14494269412771327550) + + + class TestMurMurHash(TestHasher): +@@ -86,49 +86,49 @@ class TestMurMurHash(TestHasher): + self.doTest(hasher_type=murmur1_32, + bytes_hash=1706635965, + seed_hash=1637637239, +- unicode_hash=2296970802L) ++ unicode_hash=2296970802) + + def testMurMurHash1Aligned_32(self): + self.doTest(hasher_type=murmur1_aligned_32, + bytes_hash=1706635965, + seed_hash=1637637239, +- unicode_hash=2296970802L) ++ unicode_hash=2296970802) + + def testMurMurHash2_32(self): + self.doTest(hasher_type=murmur2_32, + bytes_hash=403862830, + seed_hash=1257009171, +- unicode_hash=2308212514L) ++ unicode_hash=2308212514) + + def testMurMurHash2a_32(self): + self.doTest(hasher_type=murmur2a_32, + bytes_hash=1026673864, +- seed_hash=3640713775L, +- unicode_hash=3710634486L) ++ seed_hash=3640713775, ++ unicode_hash=3710634486) + + def testMurMurHash2Aligned32(self): + self.doTest(hasher_type=murmur2_aligned_32, + bytes_hash=403862830, + seed_hash=1257009171, +- unicode_hash=2308212514L) ++ unicode_hash=2308212514) + + def testMurMurHash2Neutral32(self): + self.doTest(hasher_type=murmur2_neutral_32, + bytes_hash=403862830, + seed_hash=1257009171, +- unicode_hash=2308212514L) ++ unicode_hash=2308212514) + + def testMurMurHash2_x64_64a(self): + self.doTest(hasher_type=murmur2_x64_64a, +- bytes_hash=3407684658384555107L, +- seed_hash=14278059344916754999L, +- unicode_hash=9820020607534352415L) ++ bytes_hash=3407684658384555107, ++ seed_hash=14278059344916754999, ++ unicode_hash=9820020607534352415) + + def testMurMurHash2_x86_64b(self): + self.doTest(hasher_type=murmur2_x86_64b, +- bytes_hash=1560774255606158893L, +- seed_hash=11567531768634065834L, +- unicode_hash=7104676830630207180L) ++ bytes_hash=1560774255606158893, ++ seed_hash=11567531768634065834, ++ unicode_hash=7104676830630207180) + + def testMurMurHash3_32(self): + self.doTest(hasher_type=murmur3_32, +@@ -138,20 +138,20 @@ class TestMurMurHash(TestHasher): + + def testMurMurHash3_x86_128(self): + self.doTest(hasher_type=murmur3_x86_128, +- bytes_hash=113049230771270950235709929058346397488L, +- seed_hash=201730919445129814667855021331871906456L, +- unicode_hash=34467989874860051826961972957664456325L) ++ bytes_hash=113049230771270950235709929058346397488, ++ seed_hash=201730919445129814667855021331871906456, ++ unicode_hash=34467989874860051826961972957664456325) + + def testMurMurHash3_x64_128(self): + self.doTest(hasher_type=murmur3_x64_128, +- bytes_hash=204797213367049729698754624420042367389L, +- seed_hash=25000065729391260169145522623652811022L, +- unicode_hash=301054382688326301269845371608405900524L) ++ bytes_hash=204797213367049729698754624420042367389, ++ seed_hash=25000065729391260169145522623652811022, ++ unicode_hash=301054382688326301269845371608405900524) + + class TestLookup3(TestHasher): + def testLookup3(self): + self.doTest(hasher_type=lookup3, +- bytes_hash=3188463954L, ++ bytes_hash=3188463954, + seed_hash=478901866, + unicode_hash=1380664715) + +@@ -167,17 +167,17 @@ class TestSuperFastHash(TestHasher): + class TestCityHash(TestHasher): + def testCityHash64(self): + self.doTest(hasher_type=city_64, +- bytes_hash=17703940110308125106L, +- seed_hash=8806864191580960558L, +- unicode_hash=7557950076747784205L) ++ bytes_hash=17703940110308125106, ++ seed_hash=8806864191580960558, ++ unicode_hash=7557950076747784205) + + self.assertFalse(hasattr(city_64, 'has_sse4_2')) + + def testCityHash128(self): + self.doTest(hasher_type=city_128, +- bytes_hash=195179989828428219998331619914059544201L, +- seed_hash=206755929755292977387372217469167977636L, +- unicode_hash=211596129097514838244042408160146499227L) ++ bytes_hash=195179989828428219998331619914059544201, ++ seed_hash=206755929755292977387372217469167977636, ++ unicode_hash=211596129097514838244042408160146499227) + + self.assertTrue(city_128.has_sse4_2, "support SSE 4.2") + +@@ -185,21 +185,21 @@ class TestCityHash(TestHasher): + class TestSpookyHash(TestHasher): + def testSpookyHash32(self): + self.doTest(hasher_type=spooky_32, +- bytes_hash=1882037601L, +- seed_hash=1324274298L, +- unicode_hash=2977967976L) ++ bytes_hash=1882037601, ++ seed_hash=1324274298, ++ unicode_hash=2977967976) + + def testSpookyHash64(self): + self.doTest(hasher_type=spooky_64, +- bytes_hash=10130480990056717665L, +- seed_hash=1598355329892273278L, +- unicode_hash=4093159241144086376L) ++ bytes_hash=10130480990056717665, ++ seed_hash=1598355329892273278, ++ unicode_hash=4093159241144086376) + + def testSpookyHash128(self): + self.doTest(hasher_type=spooky_128, +- bytes_hash=241061513486538422840128476001680072033L, +- seed_hash=315901747311404831226315334184550174199L, +- unicode_hash=207554373952009549684886824908954283880L) ++ bytes_hash=241061513486538422840128476001680072033, ++ seed_hash=315901747311404831226315334184550174199, ++ unicode_hash=207554373952009549684886824908954283880) + + if __name__ == '__main__': + if "-v" in sys.argv: --_----------=_1466532002139970--