Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux compatability #5

Closed
Stew-rt opened this issue Jun 15, 2018 · 9 comments
Closed

Linux compatability #5

Stew-rt opened this issue Jun 15, 2018 · 9 comments

Comments

@Stew-rt
Copy link
Contributor

Stew-rt commented Jun 15, 2018

There are two issues that make the git package not run on Linux (at least on my system).

  • I can't (for the life of me) get the GLSL libtcod renderer working - so I switched to RENDERER_SDL (which worked fine) - would it be possible to have RENDERER as a global variable?
  • the libtcodpy library folder conflicts with my locally installed libtcodpy - which does not have libtcod.so library, causing an exception. If I change the foldername libtcodpy to libtcodpy_local and add the following code, it loads fine:
if os.name != 'posix':
    import libtcodpy_local as libtcod
else:
    import libtcodpy as libtcod

If deemed an acceptable change, I can make the above changes to allow Linux support to work "out of the box" and build an AUR package.

@sudasana
Copy link
Owner

Both of those changes are fine with me! I can make the renderer automatically default to SDL if it detects as Linux OS.

@Stew-rt
Copy link
Contributor Author

Stew-rt commented Jun 15, 2018

Great - I'll try to get enough work done to send you a pull request over the weekend.
Thanks

@sudasana
Copy link
Owner

I've added the default to SDL for linux OS to the master branch:

cf0693b

@wart-github
Copy link

Tried this on my archlinux machine this evening. python armcom2.py loads the main screen. I can adjust options. But when I hit 'N' it bails with:
Starting Armoured Commander II version 0.4.0
Current keyboard layout: QWERTY
Traceback (most recent call last):
File "armcom2.py", line 9673, in
result = campaign.CampaignSelectionMenu()
File "armcom2.py", line 581, in CampaignSelectionMenu
campaign_list = sorted(campaign_list, key = lambda x : (x['start_date']['year'],
File "armcom2.py", line 581, in
campaign_list = sorted(campaign_list, key = lambda x : (x['start_date']['year'],
TypeError: string indices must be integers

Will be able to look closer tomorrow...

@wart-github
Copy link

wart-github commented Oct 27, 2019

Great stuff!

Managed to get the very latest version (pulled today) to work. I had to do a few things to get it to work under linux (archlinux).

(1) I had to install precisely libtcod 1.6.5 --- newer versions throw errors.
(2) I had to copy /usr/lib/libtcod*.so.* into libtcodpy_local/
(3) I had to modify xp_loader.py per the diff below (basically, add an if check for 'linux').

from sys import platform
if platform == 'darwin':
import tcod as libtcod
elif platform == 'linux':
import libtcodpy_local as libtcod

else:
import libtcodpy as libtcod
import binascii

@sudasana
Copy link
Owner

Thanks for the info; I can modify xploader but I don't have access to the /usr/lib/libtcod*.so.* files; can you submit a pull request to add them to libtcodpy_local/ ?

@wart-github
Copy link

I'd just add to README (which was in the README for libtcodpy anyway) to cp the libtcod so files to that directory, since those are linked files.

@sudasana
Copy link
Owner

Sounds good!

@sudasana
Copy link
Owner

I've added these instructions to readme.md, so I'm going to mark this issue as closed for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants