Author: Matti Picus <matti.pi...@gmail.com>
Branch: 
Changeset: r92977:73ab8f585ba4
Date: 2017-11-08 21:59 +0200
http://bitbucket.org/pypy/pypy/changeset/73ab8f585ba4/

Log:    remove maemo platform

diff --git a/rpython/config/translationoption.py 
b/rpython/config/translationoption.py
--- a/rpython/config/translationoption.py
+++ b/rpython/config/translationoption.py
@@ -39,9 +39,7 @@
 CACHE_DIR = os.path.realpath(os.path.join(MAINDIR, '_cache'))
 
 PLATFORMS = [
-    'maemo',
     'host',
-    'distutils',
     'arm',
 ]
 
diff --git a/rpython/translator/c/test/test_standalone.py 
b/rpython/translator/c/test/test_standalone.py
--- a/rpython/translator/c/test/test_standalone.py
+++ b/rpython/translator/c/test/test_standalone.py
@@ -1102,22 +1102,6 @@
         assert out.strip() == 'ok'
 
 
-class TestMaemo(TestStandalone):
-    def setup_class(cls):
-        py.test.skip("TestMaemo: tests skipped for now")
-        from rpython.translator.platform.maemo import check_scratchbox
-        check_scratchbox()
-        config = get_combined_translation_config(translating=True)
-        config.translation.platform = 'maemo'
-        cls.config = config
-
-    def test_profopt(self):
-        py.test.skip("Unsupported")
-
-    def test_prof_inline(self):
-        py.test.skip("Unsupported")
-
-
 class TestThread(object):
     gcrootfinder = 'shadowstack'
     config = None
diff --git a/rpython/translator/platform/__init__.py 
b/rpython/translator/platform/__init__.py
--- a/rpython/translator/platform/__init__.py
+++ b/rpython/translator/platform/__init__.py
@@ -327,9 +327,6 @@
 def pick_platform(new_platform, cc):
     if new_platform == 'host':
         return host_factory(cc)
-    elif new_platform == 'maemo':
-        from rpython.translator.platform.maemo import Maemo
-        return Maemo(cc)
     elif new_platform == 'arm':
         from rpython.translator.platform.arm import ARM
         return ARM(cc)
diff --git a/rpython/translator/platform/maemo.py 
b/rpython/translator/platform/maemo.py
deleted file mode 100644
--- a/rpython/translator/platform/maemo.py
+++ /dev/null
@@ -1,95 +0,0 @@
-"""Support for Maemo."""
-
-import py, os
-
-from rpython.tool.udir import udir
-from rpython.translator.platform import ExecutionResult, log
-from rpython.translator.platform.linux import Linux
-from rpython.translator.platform.posix import GnuMakefile, _run_subprocess
-
-def check_scratchbox():
-    # in order to work, that file must exist and be executable by us
-    if not os.access('/scratchbox/login', os.X_OK):
-        py.test.skip("No scratchbox detected")
-
-class Maemo(Linux):
-    name = "maemo"
-    
-    available_includedirs = ('/usr/include', '/tmp')
-    copied_cache = {}
-
-    def _invent_new_name(self, basepath, base):
-        pth = basepath.join(base)
-        num = 0
-        while pth.check():
-            pth = basepath.join('%s_%d' % (base,num))
-            num += 1
-        return pth.ensure(dir=1)
-
-    def _copy_files_to_new_dir(self, dir_from, pattern='*.[ch]'):
-        try:
-            return self.copied_cache[dir_from]
-        except KeyError:
-            new_dirpath = self._invent_new_name(udir, 'copied_includes')
-            files = py.path.local(dir_from).listdir(pattern)
-            for f in files:
-                f.copy(new_dirpath)
-            # XXX <hack for pypy>
-            srcdir = py.path.local(dir_from).join('src')
-            if srcdir.check(dir=1):
-                target = new_dirpath.join('src').ensure(dir=1)
-                for f in srcdir.listdir(pattern):
-                    f.copy(target)
-            # XXX </hack for pypy>
-            self.copied_cache[dir_from] = new_dirpath
-            return new_dirpath
-    
-    def _preprocess_include_dirs(self, include_dirs):
-        """ Tweak includedirs so they'll be available through scratchbox
-        """
-        res_incl_dirs = []
-        for incl_dir in include_dirs:
-            incl_dir = py.path.local(incl_dir)
-            for available in self.available_includedirs:
-                if incl_dir.relto(available):
-                    res_incl_dirs.append(str(incl_dir))
-                    break
-            else:
-                # we need to copy files to a place where it's accessible
-                res_incl_dirs.append(self._copy_files_to_new_dir(incl_dir))
-        return res_incl_dirs
-    
-    def _execute_c_compiler(self, cc, args, outname):
-        log.execute('/scratchbox/login ' + cc + ' ' + ' '.join(args))
-        args = [cc] + args
-        returncode, stdout, stderr = _run_subprocess('/scratchbox/login', args)
-        self._handle_error(returncode, stdout, stderr, outname)
-    
-    def execute(self, executable, args=[], env=None):
-        if isinstance(args, str):
-            args = str(executable) + ' ' + args
-            log.message('executing /scratchbox/login ' + args)
-        else:
-            args = [str(executable)] + args
-            log.message('executing /scratchbox/login ' + ' '.join(args))
-        returncode, stdout, stderr = _run_subprocess('/scratchbox/login', args,
-                                                     env)
-        return ExecutionResult(returncode, stdout, stderr)
-
-    def _include_dirs_for_libffi(self):
-        # insanely obscure dir
-        return ['/usr/include/arm-linux-gnueabi/']
-
-    def _library_dirs_for_libffi(self):
-        # on the other hand, library lands in usual place...
-        return []
-
-    def execute_makefile(self, path_to_makefile, extra_opts=[]):
-        if isinstance(path_to_makefile, GnuMakefile):
-            path = path_to_makefile.makefile_dir
-        else:
-            path = path_to_makefile
-        log.execute('make %s in %s' % (" ".join(extra_opts), path))
-        returncode, stdout, stderr = _run_subprocess(
-            '/scratchbox/login', ['make', '-C', str(path)] + extra_opts)
-        self._handle_error(returncode, stdout, stderr, path.join('make'))
diff --git a/rpython/translator/platform/test/test_maemo.py 
b/rpython/translator/platform/test/test_maemo.py
deleted file mode 100644
--- a/rpython/translator/platform/test/test_maemo.py
+++ /dev/null
@@ -1,37 +0,0 @@
-
-""" File containing maemo platform tests
-"""
-
-import py
-from rpython.tool.udir import udir
-from rpython.translator.platform.maemo import Maemo, check_scratchbox
-from rpython.translator.platform.test.test_platform import TestPlatform as 
BasicTest
-from rpython.translator.tool.cbuild import ExternalCompilationInfo
-
-class TestMaemo(BasicTest):
-    platform = Maemo()
-    strict_on_stderr = False
-
-    def setup_class(cls):
-        py.test.skip("TestMaemo: tests skipped for now")
-        check_scratchbox()
-
-    def test_includes_outside_scratchbox(self):
-        cfile = udir.join('test_includes_outside_scratchbox.c')
-        cfile.write('''
-        #include <stdio.h>
-        #include "test.h"
-        int main()
-        {
-            printf("%d\\n", XXX_STUFF);
-            return 0;
-        }
-        ''')
-        includedir = py.path.local(__file__).dirpath().join('include')
-        eci = ExternalCompilationInfo(include_dirs=(includedir,))
-        executable = self.platform.compile([cfile], eci)
-        res = self.platform.execute(executable)
-        self.check_res(res)
-
-    def test_environment_inheritance(self):
-        py.test.skip("FIXME")
diff --git a/rpython/translator/platform/test/test_platform.py 
b/rpython/translator/platform/test/test_platform.py
--- a/rpython/translator/platform/test/test_platform.py
+++ b/rpython/translator/platform/test/test_platform.py
@@ -151,6 +151,6 @@
     assert platform.host == platform.platform
 
     assert platform.is_host_build()
-    platform.set_platform('maemo', None)
+    platform.set_platform('arm', None)
     assert platform.host != platform.platform
     assert not platform.is_host_build()
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to