Date: Saturday, August 12, 2017 @ 19:07:35
  Author: muflone
Revision: 250011

spyder 3.1.4-3

Added:
  spyder/trunk/bug_51437_spyder2.patch
  spyder/trunk/spyder2.install
Modified:
  spyder/trunk/PKGBUILD

-------------------------+
 PKGBUILD                |   50 +++++++++++++++++++++++++++++----------------
 bug_51437_spyder2.patch |   51 ++++++++++++++++++++++++++++++++++++++++++++++
 spyder2.install         |    8 +++++++
 3 files changed, 92 insertions(+), 17 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2017-08-12 19:07:28 UTC (rev 250010)
+++ PKGBUILD    2017-08-12 19:07:35 UTC (rev 250011)
@@ -4,9 +4,9 @@
 # Contributor: TDY <t...@gmx.com>
 
 pkgbase='spyder'
-pkgname=('spyder' 'spyder3')
+pkgname=('spyder2' 'spyder3')
 pkgver=3.1.4
-pkgrel=2
+pkgrel=3
 pkgdesc='Scientific PYthon Development EnviRonment providing MATLAB-like 
features.'
 makedepends=('python2-setuptools' 'python-setuptools' 'python-sphinx' 
'python2-sphinx')
 arch=('any')
@@ -17,26 +17,47 @@
         "python2-optional-nbconvert.patch"
         "python2-pep8.patch"
         "python3-pep8.patch"
-        "bug_54508_missing_pyqt4_qtwebkit.patch")
+        "bug_54508_missing_pyqt4_qtwebkit.patch"
+        "bug_51437_spyder2.patch")
 sha256sums=('bcd75ebe65309a5f9184eedc59c415fe0d09e9b54a2b51bc31199a6095cd0b85'
             '4fb415fb358371da4a8b9524712de9338d391eed3bdabc5e217cf54f558771b5'
             'f6afdd08971a2022649af0be70cac67aa4d95fff06ade57f708693cffe073528'
             'dbebf909bf59027d22247e3e3c1736b5ec9337a879358f8117a967bb03e913b2'
             'f4eba4c414e655f0f2797e9864aa199607a6706f6b245aca56a54b250febc382'
-            '28d4aa8938d809c299ab6bf6b00a2f82677f9a98a9763b7127970881b76276f5')
+            '28d4aa8938d809c299ab6bf6b00a2f82677f9a98a9763b7127970881b76276f5'
+            'ae077fc95bc6861402a90c55bc11b3a2dda3fde4005e9d7ad65df3b1a120d8c1')
 
 prepare() {
   cd "${pkgbase}-${pkgver}"
   # Forced QT API to pyqt5 (see https://bugs.archlinux.org/task/54508)
   patch -p1 -i "../bug_54508_missing_pyqt4_qtwebkit.patch"
+  # Replace spyder with spyder2 (see https://bugs.archlinux.org/task/51437)
+  patch -p1 -i "../bug_51437_spyder2.patch"
+  mv "img_src/spyder.png" "img_src/spyder2.png"
+  mv "scripts/spyder.desktop" "scripts/spyder2.desktop"
+
+  # Prepare sources for spyder2 build
+  cp -r "${srcdir}/${pkgbase}-${pkgver}" "${srcdir}/spyder2-${pkgver}"
+  cd "${srcdir}/spyder2-${pkgver}"
+  patch -p1 -i "../python2.patch"
+  patch -p1 -i "../python2-pep8.patch"
+  patch -p1 -i "../python2-optional-nbconvert.patch"
+
+  # Prepare sources for spyder3 build
+  cp -r "${srcdir}/${pkgbase}-${pkgver}" "${srcdir}/spyder3-${pkgver}"
+  cd "${srcdir}/spyder3-${pkgver}"
+  patch -p1 -i "../python3-pep8.patch"
 }
 
-package_spyder() {
+package_spyder2() {
   pkgdesc='Scientific PYthon Development EnviRonment providing MATLAB-like 
features for Python 2.x series.'
   depends=('python2-pyqt5' 'qt5-webkit' 'python2-qtconsole' 'python2-qtpy' 
'python2-qtawesome'
            'python2-pyflakes' 'python2-pyzmq' 'python2-pygments' 
'python2-psutil' 'python2-pickleshare'
            'python2-rope' 'python2-jedi' 'python2-pylint' 
'python2-pycodestyle' 'python2-sphinx'
            'icu' 'gtk-update-icon-cache')
+  provides=('spyder')
+  conflicts=('spyder')
+  replaces=('spyder')
   optdepends=('python2-numpy: N-dimensional arrays'
               'python2-scipy: signal/image processing'
               'python2-h5py: HDF5 support'
@@ -43,19 +64,16 @@
               'python2-matplotlib: interactive 2D/3D data plotting'
               'python2-sympy: symbolic mathematics for the IPython console'
               'python2-pandas: view and edit DataFrames and Series in the 
Variable Explorer')
-  [ -d "build" ] && rm -rf "build"
-  cp -r "${pkgbase}-${pkgver}" build
-  cd build
-  patch -p1 -i "../python2.patch"
-  patch -p1 -i "../python2-pep8.patch"
-  patch -p1 -i "../python2-optional-nbconvert.patch"
+  install="${pkgname}.install"
+  cd "${pkgname}-${pkgver}"
   python2 setup.py build
   python2 setup.py install --prefix=/usr --root="${pkgdir}" --optimize=1
   # Install license file
   install -D -m644 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
   # Install icon and desktop file
-  install -D -m644 "scripts/${pkgname}.desktop" 
"${pkgdir}/usr/share/applications/${pkgname}.desktop"
   install -D -m644 "spyder/images/spyder.svg" 
"${pkgdir}/usr/share/icons/hicolor/scalable/apps/${pkgname}.svg"
+  # Change main executable name
+  mv "${pkgdir}/usr/bin/spyder" "${pkgdir}/usr/bin/${pkgname}"
   # Remove useless spyder_win_post_install script
   rm -f "${pkgdir}/usr/bin/spyder_win_post_install.py"
 }
@@ -73,17 +91,15 @@
               'python-matplotlib: interactive 2D/3D data plotting'
               'python-sympy: symbolic mathematics for the IPython console'
               'python-pandas: view and edit DataFrames and Series in the 
Variable Explorer')
-  [ -d "build" ] && rm -rf "build"
-  cp -r "${pkgbase}-${pkgver}" build
-  cd build
-  patch -p1 -i "../python3-pep8.patch"
+  cd "${pkgname}-${pkgver}"
   python3 setup.py build
   python3 setup.py install --prefix=/usr --root="${pkgdir}" --optimize=1
   # Install license file
   install -D -m644 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
   # Install icon and desktop file
-  install -D -m644 "scripts/${pkgname}.desktop" 
"${pkgdir}/usr/share/applications/${pkgname}.desktop"
   install -D -m644 "spyder/images/spyder.svg" 
"${pkgdir}/usr/share/icons/hicolor/scalable/apps/${pkgname}.svg"
   # Remove useless spyder_win_post_install script
   rm -f "${pkgdir}/usr/bin/spyder_win_post_install.py"
+  # Add symlink /usr/bin/spyder to /usr/bin/spyder3 (see 
https://bugs.archlinux.org/task/51437)
+  ln -s "/usr/bin/spyder3" "${pkgdir}/usr/bin/spyder"
 }

Added: bug_51437_spyder2.patch
===================================================================
--- bug_51437_spyder2.patch                             (rev 0)
+++ bug_51437_spyder2.patch     2017-08-12 19:07:35 UTC (rev 250011)
@@ -0,0 +1,51 @@
+diff -Naur spyder-3.1.4.orig/scripts/spyder3.desktop 
spyder-3.1.4/scripts/spyder3.desktop
+--- spyder-3.1.4.orig/scripts/spyder3.desktop  2017-04-24 02:30:23.000000000 
+0200
++++ spyder-3.1.4/scripts/spyder3.desktop       2017-08-12 20:49:55.349203674 
+0200
+@@ -1,9 +1,8 @@
+ [Desktop Entry]
+ Version=1.0
+ Type=Application
+-Name=Spyder3
+-GenericName=Spyder3
+-Comment=Scientific PYthon Development EnviRonment - Python3
++Name=Spyder for Python 3.x
++Comment=Scientific PYthon Development EnviRonment - Python 3.x
+ TryExec=spyder3
+ Exec=spyder3 %F
+ Categories=Development;Science;IDE;Qt;
+diff -Naur spyder-3.1.4.orig/scripts/spyder.desktop 
spyder-3.1.4/scripts/spyder.desktop
+--- spyder-3.1.4.orig/scripts/spyder.desktop   2017-04-24 02:30:23.000000000 
+0200
++++ spyder-3.1.4/scripts/spyder.desktop        2017-08-12 20:49:54.005881501 
+0200
+@@ -1,13 +1,12 @@
+ [Desktop Entry]
+ Version=1.0
+ Type=Application
+-Name=Spyder
+-GenericName=Spyder
+-Comment=Scientific PYthon Development EnviRonment
+-TryExec=spyder
+-Exec=spyder %F
++Name=Spyder for Python 2.x
++Comment=Scientific PYthon Development EnviRonment - Python 2.x
++TryExec=spyder2
++Exec=spyder2 %F
+ Categories=Development;Science;IDE;Qt;
+-Icon=spyder
++Icon=spyder2
+ Terminal=false
+ StartupNotify=true
+ MimeType=text/x-python;
+diff -Naur spyder-3.1.4.orig/setup.py spyder-3.1.4/setup.py
+--- spyder-3.1.4.orig/setup.py 2017-04-24 02:30:23.000000000 +0200
++++ spyder-3.1.4/setup.py      2017-08-12 20:34:09.464160097 +0200
+@@ -82,8 +82,8 @@
+                           ('share/pixmaps', ['img_src/spyder3.png']),
+                           ('share/metainfo', ['scripts/spyder3.appdata.xml'])]
+         else:
+-            data_files = [('share/applications', ['scripts/spyder.desktop']),
+-                          ('share/pixmaps', ['img_src/spyder.png'])]
++            data_files = [('share/applications', ['scripts/spyder2.desktop']),
++                          ('share/pixmaps', ['img_src/spyder2.png'])]
+     elif os.name == 'nt':
+         data_files = [('scripts', ['img_src/spyder.ico',
+                                    'img_src/spyder_reset.ico'])]

Added: spyder2.install
===================================================================
--- spyder2.install                             (rev 0)
+++ spyder2.install     2017-08-12 19:07:35 UTC (rev 250011)
@@ -0,0 +1,8 @@
+post_install() {
+  echo "==> The /usr/bin/spyder executable is now a symlink for spyder3 (in 
the spyder3 package)."
+  echo "==> The executable file for spyder2 is now /usr/bin/spyder2"
+}
+
+post_upgrade() {
+  post_install
+}

Reply via email to