You are not logged in.

#1 2017-05-28 09:33:03

quellen
Member
From: Italy
Registered: 2014-05-24
Posts: 364

[SOLVED] Can't install amitools

hi,
i can't install amitools:
https://github.com/cnvogelg/amitools

$ git clone https://github.com/cnvogelg/amitools
Cloning into 'amitools'...
remote: Counting objects: 5223, done.
remote: Total 5223 (delta 0), reused 0 (delta 0), pack-reused 5223
Receiving objects: 100% (5223/5223), 12.56 MiB | 750.00 KiB/s, done.
Resolving deltas: 100% (3377/3377), done.
$ cd amitools
$ ls
MANIFEST.in  README.md  bin     doc    musashi    setup.py
Makefile     amitools   config  hacks  setup.cfg  test
$ python setup.py 
Traceback (most recent call last):
  File "setup.py", line 5, in <module>
    from Cython.Build import cythonize
ModuleNotFoundError: No module named 'Cython'
$ python2 setup.py 
Traceback (most recent call last):
  File "setup.py", line 5, in <module>
    from Cython.Build import cythonize
ImportError: No module named Cython.Build
$ chmod +x setup.py 
$ ./setup.py
./setup.py: riga 3: from: comando non trovato
./setup.py: riga 4: from: comando non trovato
./setup.py: riga 5: from: comando non trovato
./setup.py: riga 6: from: comando non trovato
./setup.py: riga 8: errore di sintassi vicino al token non atteso "("
./setup.py: riga 8: `class BuildPyCommand(setuptools.command.build_ext.build_ext):'

in README.md it says to install this packages:

pacman -Sy
pacman --needed -S bash pacman msys2-runtime
```
     - Now close shell and re-open a new dev shell (```MinGW-w64 Win64 Shell```)
     ```
pacman -Su
pacman -S mingw-w64-x86_64-python2-pip mingw-w64-x86_64-gcc git make
```

but they do not exist...


$ cat setup.py 
import setuptools.command.build_ext

from subprocess import call
from setuptools import setup, find_packages
from Cython.Build import cythonize
from distutils.extension import Extension

class BuildPyCommand(setuptools.command.build_ext.build_ext):
  """Custom build command."""

  def run(self):
    call(['make', 'do_gen'])
    setuptools.command.build_ext.build_ext.run(self)

sourcefiles = [
  'musashi/emu.pyx',
  'musashi/traps.c',
  'musashi/mem.c',
  'musashi/m68kcpu.c',
  'musashi/m68kdasm.c',
  'gen/m68kopac.c',
  'gen/m68kopdm.c',
  'gen/m68kopnz.c',
  'gen/m68kops.c'
]
depends = [
  'musashi/pycpu.pyx',
  'musashi/pymem.pyx',
  'musashi/pytraps.pyx'
]
inc_dirs = [
  'musashi',
  'gen'
]

extensions = [Extension("musashi.emu", sourcefiles,
  depends=depends, include_dirs=inc_dirs)]

scripts = {
  'console_scripts' : [
    'fdtool = amitools.tools.fdtool:main',
    'geotool = amitools.tools.geotool:main',
    'hunktool = amitools.tools.hunktool:main',
    'rdbtool = amitools.tools.rdbtool:main',
    'romtool = amitools.tools.romtool:main',
    'typetool = amitools.tools.typetool:main',
    'vamos = amitools.tools.vamos:main',
    'vamospath = amitools.tools.vamospath:main',
    'xdfscan = amitools.tools.xdfscan:main',
    'xdftool = amitools.tools.xdftool:main'
  ]
}

setup(
    cmdclass = {
        'build_ext': BuildPyCommand,
    },
    name = "amitools",
    description='A package to support development with classic Amiga m68k systems',
    long_description=open("README.md").read(),
    version = "0.1.0",
    maintainer = "Christian Vogelgsang",
    maintainer_email = "chris@vogelgsang.org",
    url = "http://github.com/cnvogelg/amitools",
    classifiers = [
        "Development Status :: 4 - Beta",
        "Intended Audience :: Developers",
        "Programming Language :: Python",
        "Topic :: System :: Emulators",
    ],
    license = "License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
    packages = find_packages(),
    zip_safe = False,
    entry_points = scripts,
    setup_requires = ['pytest-runner'],
    tests_require= ['pytest'],
#    install_requires = ['lhafile==0.2.1'],
    dependency_links = [
      "http://github.com/FrodeSolheim/python-lhafile/zipball/master#egg=lhafile-0.2.1"
    ],
    ext_modules = cythonize(extensions),
# win problems:
#    use_scm_version=True,
    include_package_data=True
)

Last edited by quellen (2017-05-28 11:06:31)


sorry for my bad english

Offline

#2 2017-05-28 10:48:07

null
Member
Registered: 2009-05-06
Posts: 398

Re: [SOLVED] Can't install amitools

quellen wrote:
Traceback (most recent call last):
  File "setup.py", line 5, in <module>
    from Cython.Build import cythonize
ImportError: No module named Cython.Build

Have you even read the readme?

It clearly states that you have to install cython in the python2 version because this only supports python27. Also the pacman invocation is for msys2 which is some random distribution for the linux subsystem on windows and has nothing to do with Arch Linux except that they borrow pacman.

Also this mingw gcc thing seems to be in community and the pip thing is probably the python2 version in aur..

Offline

#3 2017-05-28 11:06:17

quellen
Member
From: Italy
Registered: 2014-05-24
Posts: 364

Re: [SOLVED] Can't install amitools

thanks, i have installed cython2 and now it works.
now i try to make a PKGBUILD for AUR...


sorry for my bad english

Offline

#4 2017-05-28 12:51:22

quellen
Member
From: Italy
Registered: 2014-05-24
Posts: 364

Re: [SOLVED] Can't install amitools

i can't make PKGBUILD:

pkgname=amitools
pkgver=0.1.0
pkgrel=1
pkgdesc="Various AmigaOS tools for other platforms"
arch=('i686' 'x86_64')
url="https://github.com/cnvogelg/amitools"
license=('GPL')
depends=('python-lhafile' 'python2' 'cython2')
source=("git+https://github.com/cnvogelg/amitools.git")
md5sums=('SKIP')
sha256sums=('SKIP')
pkgver() {
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
build() {
        cd "${pkgname}"
        python2 setup.py build
}
package() {
        cd "${pkgname}"
	python2 setup.py install
} 
$ makepkg -s
[...]
==> Starting package()...
running install
error: can't create or remove files in install directory

The following error occurred while trying to add or remove files in the
installation directory:

    [Errno 13] Permission denied: '/usr/lib/python2.7/site-packages/test-easy-install-26957.write-test'

The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    /usr/lib/python2.7/site-packages/

Perhaps your account does not have write access to this directory?  If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account.  If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.

For information on other options, you may wish to consult the
documentation at:

  https://setuptools.readthedocs.io/en/latest/easy_install.html

Please make the appropriate changes for your system and try again.

==> ERROR: A failure occurred in package().
    Aborting...

where is the error?

Last edited by quellen (2017-05-28 12:51:42)


sorry for my bad english

Offline

#5 2017-05-28 12:54:33

ayekat
Member
Registered: 2011-01-17
Posts: 1,634

Re: [SOLVED] Can't install amitools

You need to install the files into "$pkgdir", otherwise makepkg will try to install the files to the system.

Pass --root="$pkgdir" to setup.py.


pkgs │ hacks │ cfg │ blag

Offline

Board footer

Powered by FluxBB