Skip to content
Permalink
Browse files

py-eric-ide: new port, version 19.04

Looking at the commit history, upstream seems to intent to package the
software on PyPI as "eric-ide"; hence the choice for the name.

The software has its own install.py script that requires the non-default
setup in the Portfile for build/destroot phases and some patching to get
the App to work.

Closes: https://trac.macports.org/ticket/52865
Closes: https://trac.macports.org/ticket/56636
Closes: #3638
  • Loading branch information
reneeotten committed Apr 26, 2019
1 parent c1dc695 commit 4a7253cfcec282c814f33c6cba40f6c80197eefc
Showing with 137 additions and 0 deletions.
  1. +98 −0 python/py-eric-ide/Portfile
  2. +39 −0 python/py-eric-ide/files/patch-install.py.diff
@@ -0,0 +1,98 @@
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4

PortSystem 1.0
PortGroup python 1.0

name py-eric-ide
set real_name eric6
version 19.04
revision 0

categories-append devel
platforms darwin
supported_archs noarch
license GPL-3+
maintainers {reneeotten @reneeotten} openmaintainer

description Eric is a full featured Python and Ruby editor and IDE
long_description ${description}, written in python. It is based on the cross \
platform Qt gui toolkit, integrating the highly flexible \
Scintilla editor control. It is designed to be usable as \
everdays' quick and dirty editor as well as being usable \
as a professional project management tool integrating many \
advanced features Python offers the professional coder.

homepage https://eric-ide.python-projects.org/index.html
master_sites sourceforge:project/eric-ide/${real_name}/stable/${version}
distname ${real_name}-${version}

checksums rmd160 cbb0b5dc96c9aefdaae2f029b881c9c044c8c325 \
sha256 62b34c8cf152e7342a92ef0c76efe54ae78c611bc50293fcab072a180fafb4dc \
size 17160668

python.versions 27 37

if {${name} ne ${subport}} {
variant qt5 conflicts qt4 description "Use Qt5 backend" {
PortGroup qt5 1.0

depends_lib-append \
port:py${python.version}-pyqt5 \
port:py${python.version}-pyqt5-webengine \
port:py${python.version}-qscintilla-qt5

build.args-append --pyqt=5
}

variant qt4 conflicts qt5 description "Use Qt4 backend" {
PortGroup qt4 1.0

depends_lib-append \
port:py${python.version}-pyqt4 \
port:py${python.version}-qscintilla-qt4

build.args-append --pyqt=4
}

if {![ variant_isset qt4 ]} {
default_variants +qt5
}

depends_lib-append \
port:py${python.version}-cx_Freeze \
port:py${python.version}-enchant \
port:py${python.version}-pylint \
port:py${python.version}-pysvn \
port:py${python.version}-rope

patchfiles patch-install.py.diff
post-patch {
reinplace "s|@@PYTHON_BIN_NAME@@|${python.bin}|g" ${worksrcpath}/install.py
reinplace "s|@@PYTHON_PKG_DIR@@|${python.pkgd}/${real_name}|g" ${worksrcpath}/install.py
if {[ variant_isset qt4 ]} {
reinplace "s|@@PYQT_VERSION@@|--pyqt4|g" ${worksrcpath}/install.py
} else {
reinplace "s|@@PYQT_VERSION@@|--pyqt5|g" ${worksrcpath}/install.py
}
}

build.cmd ${python.bin} install.py
build.args -b ${python.prefix}/bin \
-i ${destroot} \
-n ${destroot}/Applications/MacPorts \

This comment has been minimized.

Copy link
@ryandesign

ryandesign Apr 29, 2019

Contributor

Please use ${applications_dir} instead of hardcoding /Applications/MacPorts.

This comment has been minimized.

Copy link
@reneeotten

reneeotten Apr 30, 2019

Author Contributor

I see, sorry about that - corrected in 8e5ea70

-m ${real_name}-${python.branch}.app
build.target

destroot { }

post-destroot {
set docdir ${prefix}/share/doc/${subport}
xinstall -d ${destroot}${docdir}
xinstall -m 0644 -W ${worksrcpath} changelog THANKS \
LICENSE.GPL3 ${destroot}${docdir}
}

livecheck.type none
} else {
livecheck.regex ${real_name}-(\[0-9.\]+)${extract.suffix}
}
@@ -0,0 +1,39 @@
--- install.py.orig 2019-04-26 22:19:54.000000000 -0400
+++ install.py 2019-04-26 22:21:34.000000000 -0400
@@ -1191,11 +1191,13 @@
os.makedirs(dirs["exe"])
os.makedirs(dirs["icns"])

- if macPythonExe == defaultMacPythonExe:
- starter = os.path.join(dirs["exe"], "eric")
- os.symlink(macPythonExe, starter)
- else:
- starter = "python{0}".format(sys.version_info.major)
+## if macPythonExe == defaultMacPythonExe:
+## starter = os.path.join(dirs["exe"], "eric")
+## os.symlink(macPythonExe, starter)
+## else:
+## starter = "python{0}".format(sys.version_info.major)
+ starter = "@@PYTHON_BIN_NAME@@"
+

wname = os.path.join(dirs["exe"], "eric6")

@@ -1224,13 +1226,15 @@
pathlist_n.append(path_)
pathLine = "PATH={0}\n".format(os.pathsep.join(pathlist_n))

+ pydir = "@@PYTHON_PKG_DIR@@"
+ pyqt_ver = "@@PYQT_VERSION@@"
# create the wrapper script
wrapper = ('''#!/bin/sh\n'''
'''\n'''
'''{0}'''
'''{1}'''
- '''exec "{2}" "{3}/{4}.py" "$@"\n'''
- .format(pathLine, dyldLine, starter, pydir, "eric6"))
+ '''exec "{2}" "{3}/{4}.py" "{5}" "$@"\n'''
+ .format(pathLine, dyldLine, starter, pydir, "eric6", pyqt_ver))
copyToFile(wname, wrapper)
os.chmod(wname, 0o755)

0 comments on commit 4a7253c

Please sign in to comment.
You can’t perform that action at this time.