$ git show --format=fuller --patch-with-stat --summary da04d9f3193ad864befadf27a61dec70e2f16b29
commit da04d9f3193ad864befadf27a61dec70e2f16b29
Author: Alex <alexander@mezon.ru>
AuthorDate: Sat Apr 18 21:29:29 2020 +0000
Commit: Alex <alexander@mezon.ru>
CommitDate: Sat Apr 18 21:29:29 2020 +0000
use python3
---
.abf.yml | 3 +--
gyp-ninja-build.patch | 26 ---------------------
gyp-python3.patch | 36 +++++++++++++++++++++++++++++
gyp-python38.patch | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++
gyp.spec | 42 ++++++++++++++++------------------
5 files changed, 120 insertions(+), 50 deletions(-)
delete mode 100644 gyp-ninja-build.patch
create mode 100644 gyp-python3.patch
create mode 100644 gyp-python38.patch
diff --git a/.abf.yml b/.abf.yml
index 8391c35..333b56a 100644
--- a/.abf.yml
+++ b/.abf.yml
@@ -1,3 +1,2 @@
sources:
- gyp-0.1-svn1617.tar.bz2: cf2e06083bdd1881ad5e0a25e2e843253712189e
- gyp-0.1-git920ee58.tar.bz2: 011c44abd3bb49641961cf58015613a4b1f6a710
+ fcd686f1880fa52a1ee78d3e98af1b88cb334528.tar.gz: 16625e34e158685d009bd2f19b2c7f49fe12c0d8
diff --git a/gyp-ninja-build.patch b/gyp-ninja-build.patch
deleted file mode 100644
index c2f582c..0000000
--- a/gyp-ninja-build.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-diff -pruN gyp.orig/pylib/gyp/generator/ninja.py gyp/pylib/gyp/generator/ninja.py
---- gyp.orig/pylib/gyp/generator/ninja.py 2016-10-17 11:00:37.000000000 +0900
-+++ gyp/pylib/gyp/generator/ninja.py 2016-10-17 12:42:10.226872110 +0900
-@@ -2064,11 +2064,11 @@ def GenerateOutputForConfig(target_list,
- # .c files. This should be handled by mspdbsrv, but rarely errors out with
- # c1xx : fatal error C1033: cannot open program database
- # By making the rules target separate pdb files this might be avoided.
-- cc_command = ('ninja -t msvc -e $arch ' +
-+ cc_command = ('ninja-build -t msvc -e $arch ' +
- '-- '
- '$cc /nologo /showIncludes /FC '
- '@$out.rsp /c $in /Fo$out /Fd$pdbname_c ')
-- cxx_command = ('ninja -t msvc -e $arch ' +
-+ cxx_command = ('ninja-build -t msvc -e $arch ' +
- '-- '
- '$cxx /nologo /showIncludes /FC '
- '@$out.rsp /c $in /Fo$out /Fd$pdbname_cc ')
-@@ -2436,7 +2436,7 @@ def PerformBuild(data, configurations, p
- options = params['options']
- for config in configurations:
- builddir = os.path.join(options.toplevel_dir, 'out', config)
-- arguments = ['ninja', '-C', builddir]
-+ arguments = ['ninja-build', '-C', builddir]
- print 'Building [%s]: %s' % (config, arguments)
- subprocess.check_call(arguments)
-
diff --git a/gyp-python3.patch b/gyp-python3.patch
new file mode 100644
index 0000000..6235b82
--- /dev/null
+++ b/gyp-python3.patch
@@ -0,0 +1,36 @@
+diff -pruN gyp-0.1-gitfcd686f1.orig/gyp gyp-0.1-gitfcd686f1/gyp
+--- gyp-0.1-gitfcd686f1.orig/gyp 2015-04-30 09:48:21.000000000 +0000
++++ gyp-0.1-gitfcd686f1/gyp 2019-08-14 09:41:05.343208034 +0000
+@@ -5,4 +5,4 @@
+
+ set -e
+ base=$(dirname "$0")
+-exec python "${base}/gyp_main.py" "$@"
++exec python3 "${base}/gyp_main.py" "$@"
+diff -pruN gyp-0.1-gitfcd686f1.orig/gyp_main.py gyp-0.1-gitfcd686f1/gyp_main.py
+--- gyp-0.1-gitfcd686f1.orig/gyp_main.py 2016-10-17 02:00:37.000000000 +0000
++++ gyp-0.1-gitfcd686f1/gyp_main.py 2019-08-14 09:41:43.380207320 +0000
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+
+ # Copyright (c) 2009 Google Inc. All rights reserved.
+ # Use of this source code is governed by a BSD-style license that can be
+diff -pruN gyp-0.1-gitfcd686f1.orig/gyptest.py gyp-0.1-gitfcd686f1/gyptest.py
+--- gyp-0.1-gitfcd686f1.orig/gyptest.py 2019-08-14 09:05:50.000000000 +0000
++++ gyp-0.1-gitfcd686f1/gyptest.py 2019-08-14 09:41:48.578208719 +0000
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # Copyright (c) 2012 Google Inc. All rights reserved.
+ # Use of this source code is governed by a BSD-style license that can be
+ # found in the LICENSE file.
+diff -pruN gyp-0.1-gitfcd686f1.orig/setup.py gyp-0.1-gitfcd686f1/setup.py
+--- gyp-0.1-gitfcd686f1.orig/setup.py 2015-04-30 09:48:21.000000000 +0000
++++ gyp-0.1-gitfcd686f1/setup.py 2019-08-14 09:41:53.510210046 +0000
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+
+ # Copyright (c) 2009 Google Inc. All rights reserved.
+ # Use of this source code is governed by a BSD-style license that can be
diff --git a/gyp-python38.patch b/gyp-python38.patch
new file mode 100644
index 0000000..e1dc703
--- /dev/null
+++ b/gyp-python38.patch
@@ -0,0 +1,63 @@
+commit 7b0a3fd85beb67c990da3fb1b690444a27a6ee42
+Author: Tom Hughes <tom@compton.nu>
+Date: Fri Aug 23 09:33:14 2019 +0100
+
+ Fix python 3.8 warnings
+
+diff --git a/pylib/gyp/input.py b/pylib/gyp/input.py
+index 42c279cf..013231dc 100644
+--- a/pylib/gyp/input.py
++++ b/pylib/gyp/input.py
+@@ -1181,7 +1181,7 @@ def LoadVariablesFromVariablesDict(variables, the_dict, the_dict_key):
+ if variable_name in variables:
+ # If the variable is already set, don't set it.
+ continue
+- if the_dict_key is 'variables' and variable_name in the_dict:
++ if the_dict_key == 'variables' and variable_name in the_dict:
+ # If the variable is set without a % in the_dict, and the_dict is a
+ # variables dict (making |variables| a varaibles sub-dict of a
+ # variables dict), use the_dict's definition.
+diff --git a/test/lib/TestCmd.py b/test/lib/TestCmd.py
+index 1ec50933..457694c8 100644
+--- a/test/lib/TestCmd.py
++++ b/test/lib/TestCmd.py
+@@ -283,7 +283,7 @@ if os.name in ('posix', 'nt'):
+ else:
+ tempfile.template = 'testcmd.'
+
+-re_space = re.compile('\s')
++re_space = re.compile(r'\s')
+
+ _Cleanup = []
+
+@@ -882,7 +882,7 @@ class TestCmd(object):
+ #self.diff_function = difflib.unified_diff
+ self._dirlist = []
+ self._preserve = {'pass_test': 0, 'fail_test': 0, 'no_result': 0}
+- if 'PRESERVE' in os.environ and os.environ['PRESERVE'] is not '':
++ if 'PRESERVE' in os.environ and os.environ['PRESERVE'] != '':
+ self._preserve['pass_test'] = os.environ['PRESERVE']
+ self._preserve['fail_test'] = os.environ['PRESERVE']
+ self._preserve['no_result'] = os.environ['PRESERVE']
+@@ -1103,7 +1103,7 @@ class TestCmd(object):
+ the temporary working directories to be preserved for all
+ conditions.
+ """
+- if conditions is ():
++ if len(conditions) == 0:
+ conditions = ('pass_test', 'fail_test', 'no_result')
+ for cond in conditions:
+ self._preserve[cond] = 1
+diff --git a/test/lib/TestGyp.py b/test/lib/TestGyp.py
+index cba2d3cc..43865ee1 100644
+--- a/test/lib/TestGyp.py
++++ b/test/lib/TestGyp.py
+@@ -742,7 +742,7 @@ def FindVisualStudioInstallation():
+ build_tool = None
+ if not build_tool:
+ args1 = ['reg', 'query',
+- 'HKLM\Software\Microsoft\VisualStudio\SxS\VS7',
++ r'HKLM\Software\Microsoft\VisualStudio\SxS\VS7',
+ '/v', '15.0', '/reg:32']
+ build_tool = subprocess.check_output(args1).decode(
+ 'utf-8', 'ignore').strip().split(b'\r\n').pop().split(b' ').pop()
diff --git a/gyp.spec b/gyp.spec
index 2c15318..b7cac95 100644
--- a/gyp.spec
+++ b/gyp.spec
@@ -1,33 +1,33 @@
-%global revision 920ee58
-%{expand: %%global archivename gyp-%{version}%{?revision:-git%{revision}}}
-%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
-%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
+# from https://chromium.googlesource.com/external/gyp/
+%define date 20190716
+%define commit fcd686f1880fa52a1ee78d3e98af1b88cb334528
Name: gyp
Version: 0.1
-Release: 0.25%{?revision:.%{revision}git}%{?dist}
+Release: 0.26%{?revision:.%{revision}git}%{?dist}
Summary: Generate Your Projects
Group: Development/Tools
License: BSD
URL: http://code.google.com/p/gyp/
+
# No released tarball avaiable. so the tarball was generated
-# from svn as following:
+# from git as following:
#
-# 1. svn co http://gyp.googlecode.com/svn/trunk gyp
+# 1. git clone https://chromium.googlesource.com/external/gyp.git
# 2. cd gyp
# 3. version=$(grep version= setup.py|cut -d\' -f2)
-# 4. revision=$(git log --oneline|head -1|cut -d' ' -f1)
-# 5. tar -a --exclude-vcs -cf /tmp/gyp-$version-git$revision.tar.bz2 *
-Source0: %{archivename}.tar.bz2
+# 4. revision=$(svn info|grep -E "^Revision:"|cut -d' ' -f2)
+# 5. tar -a --exclude-vcs -cf /tmp/gyp-$version-svn$revision.tar.bz2 *
+Source0: https://chromium.googlesource.com/external/gyp/+archive/%{commit}.tar.gz
Patch0: gyp-rpmoptflags.patch
-Patch1: gyp-ninja-build.patch
+Patch2: gyp-python3.patch
+Patch3: gyp-python38.patch
-BuildRequires: python2-devel
-BuildRequires: python2-setuptools
-BuildRequires: python2-pkg-resources
-Requires: python2-setuptools
BuildArch: noarch
+BuildRequires: pkgconfig(python3)
+BuildRequires: python3dist(setuptools)
+Requires: python3dist(setuptools)
%description
GYP is a tool to generates native Visual Studio, Xcode and SCons
@@ -39,21 +39,19 @@ irreconcilable differences.
%prep
-%setup -q -c -n %{archivename}
-%patch0 -p1 -b .0-rpmoptflags
-%patch1 -p1 -b .1-ninja-build
+%autosetup -p1 -c -n %{commit}
+
for i in $(find pylib -name '*.py'); do
sed -e '\,#![ \t]*/.*python,{d}' $i > $i.new && touch -r $i $i.new && mv $i.new $i
done
%build
-%{__python2} setup.py build
-
+%py3_build
%install
-%{__python2} setup.py install --root $RPM_BUILD_ROOT --skip-build
+%py3_install
%files
%doc AUTHORS LICENSE
%{_bindir}/gyp
-%{python2_sitelib}/*
+%{python3_sitelib}/*