[arch-commits] Commit in python-cx_freeze/trunk (PKGBUILD python3.7.patch)

Felix Yan felixonmars at archlinux.org
Mon Sep 10 19:41:55 UTC 2018


    Date: Monday, September 10, 2018 @ 19:41:54
  Author: felixonmars
Revision: 379261

upgpkg: python-cx_freeze 5.1.1-3

- enable tests
- fix for python 3.7 (FS#59891)
- use setuptools to generate proper metadata

Added:
  python-cx_freeze/trunk/python3.7.patch
Modified:
  python-cx_freeze/trunk/PKGBUILD

-----------------+
 PKGBUILD        |   41 +++++++++++++++++++++++++++++++----------
 python3.7.patch |   23 +++++++++++++++++++++++
 2 files changed, 54 insertions(+), 10 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2018-09-10 19:41:43 UTC (rev 379260)
+++ PKGBUILD	2018-09-10 19:41:54 UTC (rev 379261)
@@ -1,5 +1,6 @@
 # $Id$
-# Maintainer: Alexander Rødseth <rodseth at gmail.com>
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+# Contributor: Alexander Rødseth <rodseth at gmail.com>
 # Contributor: Ray Rashif <schiv at archlinux.org>
 # Contributor: Douglas Soares de Andrade <douglas at archlinux.org>
 # Contributor: Eric Belanger <eric at archlinux.org>
@@ -9,21 +10,41 @@
 pkgbase=python-cx_freeze
 pkgname=('python-cx_freeze' 'python2-cx_freeze')
 pkgver=5.1.1
-pkgrel=2
+pkgrel=3
 pkgdesc='Utilities for freezing Python scripts into executables'
 arch=('x86_64')
-url='http://cx-freeze.sourceforge.net/'
+url='https://anthony-tuininga.github.io/cx_Freeze'
 license=('PSF')
-makedepends=('python' 'python2')
-source=("https://pypi.io/packages/source/c/cx_Freeze/cx_Freeze-$pkgver.tar.gz")
-sha512sums=('64f9c3b7f6c3003c1dc439fc2da7d0c13c5f146834e3ab8ece3921f1eb30c6e3eda480ccc84e61cc061597521b360cf8f5ef8e0bbcce1437157360c3d9c1adbc')
+makedepends=('python-setuptools' 'python2-setuptools')
+checkdepends=('python-nose' 'python2-nose' 'python-openpyxl' 'python2-openpyxl' 'python2-mock')
+source=("$pkgbase-$pkgver.tar.gz::https://github.com/anthony-tuininga/cx_Freeze/archive/$pkgver.tar.gz"
+        python3.7.patch)
+sha512sums=('95d70c23678080fec96df78658aeaaeb81ce0660ce242a363699d6b82d926d021519f9b67dc458b0d2e3c89230a582cfec6862a2346bf0deacc636ce125c0c96'
+            '9009d617213bcf57124b32b1680fa1a2282885ff27fdc6c14482c3db34b2859d2e6cdc724c114a2ccd3a90f11c83e3c3837d1df58d13a041ab1d2439804cb1d4')
 
+prepare() {
+  cd cx_Freeze-$pkgver
+  patch -p1 -i ../python3.7.patch
+}
+
+build() {
+  cd cx_Freeze-$pkgver
+  python setup.py build
+  python2 setup.py build
+}
+
+check() {
+  cd cx_Freeze-$pkgver
+  python setup.py nosetests || warning "Tests failed"
+  python2 setup.py nosetests
+}
+
 package_python-cx_freeze() {
   depends=('python')
   conflicts=('cx_freeze' 'python2-cx_freeze')
 
-  cd "cx_Freeze-$pkgver"
-  python setup.py install --root "$pkgdir" --optimize 1
+  cd cx_Freeze-$pkgver
+  python setup.py install --root "$pkgdir" --optimize 1 --skip-build
 }
 
 package_python2-cx_freeze() {
@@ -31,8 +52,8 @@
   conflicts=('cx_freeze' 'python-cx_freeze')
   replaces=('cx_freeze')
 
-  cd "cx_Freeze-$pkgver"
-  python2 setup.py install --root "$pkgdir" --optimize 1
+  cd cx_Freeze-$pkgver
+  python2 setup.py install --root "$pkgdir" --optimize 1 --skip-build
 
   # Python 2 fix
   find "$pkgdir" -name qotd.py -exec sed -i '0,/on/s//on2/' {} \;

Added: python3.7.patch
===================================================================
--- python3.7.patch	                        (rev 0)
+++ python3.7.patch	2018-09-10 19:41:54 UTC (rev 379261)
@@ -0,0 +1,23 @@
+--- orig/cx_Freeze-5.1.1/cx_Freeze/freezer.py	2017-12-09 23:11:29.000000000 +0100
++++ cx_Freeze-5.1.1/cx_Freeze/freezer.py	2018-08-31 13:41:19.028655982 +0200
+@@ -550,13 +550,18 @@
+             # the file is up to date so we can safely set this value to zero
+             if module.code is not None:
+                 if module.file is not None and os.path.exists(module.file):
+-                    mtime = os.stat(module.file).st_mtime
++                   stat = os.stat(module.file)
++                   mtime = stat.st_mtime
++                   size = stat.st_size & 0xFFFFFFFF
+                 else:
+                     mtime = time.time()
++                    size = 0
+                 if sys.version_info[:2] < (3, 3):
+                     header = magic + struct.pack("<i", int(mtime))
++                elif sys.version_info[:2] == (3, 7):
++                    header = magic + struct.pack("<iii",0, int(mtime), size)
+                 else:
+-                    header = magic + struct.pack("<ii", int(mtime), 0)
++                    header = magic + struct.pack("<ii", int(mtime), size)
+                 data = header + marshal.dumps(module.code)
+ 
+             # if the module should be written to the file system, do so



More information about the arch-commits mailing list