Giter Club home page Giter Club logo

Comments (30)

mappu avatar mappu commented on May 5, 2024

DEPENDENCIES

Install MSYS2 with mingw-w64 toolchain

pacman -Syu

Install opusfile (not currently packaged by MSYS2 distribution)

wget http://downloads.xiph.org/releases/opus/opusfile-0.6.tar.gz
./configure --prefix=/mingw32/ --{build,host,target}=mingw64-i686
make install

Install dependencies

pacman -S mingw-w64-i686-{SDL2,SDL2_image,glew,freetype,ftgl,opus,opus-tools,libogg,python3-numpy,python3-Pillow}
fc-cache

PATCHES

Buildsystem patches: (I gave up on cmake)

  • configure: Comment out 258-259, MSYS2 doesn't support symlinks.
  • configure: Add invocation.append('-G') invocation.append('MSYS Makefiles') around line 278.
  • buildsystem/simple: line 18 add set -e for debugging
  • buildsystem/simple: sed -i 's~/usr/include/~/mingw32/include/~g' buildsystem/simple
  • buildsystem/simple: remove -z,relro and -fPIC options
  • buildsystem/simple: move -lpython3.4m to the END of the python ext module build
  • buildsystem/simple: change PYTHONPATH to just PYTHONPATH=py
  • buildsystem/simple: Remove -l{GLEW,GLU,GL,SM,ICE,X11,Xext,util} from main gcc build ; move libraries to end ; -lSDL2 doesn't need to be there twice ; add -lglew32 -lopengl32
  • buildsystem/simple: Add -Wno-format. There are lots of minor printf format issues owing to building on ILP32 platform.

C++ patches:

  • utils/fds.h: comment out termio.h, comment 84
  • utils/fds.cpp: comment out pty.h, comment 26-27, comment 101-111, comment 115-118
  • console/tests.cpp: comment out pty.h, comment 36-158
  • audio/hash_functions.h: change to <<16 for ILP32 platform. This seems unused?
  • main.cpp: append the WinMain wrapper from http://www.flipcode.com/archives/WinMain_Command_Line_Parser.shtml , since main() doesn't seem to be called as-is and ld can't find the usual mainCRTStartup wrapper

Python patches:

  • py/openage/convert/dataformat.py:1051: should be snippets_body_sorted ( issue #7 )
  • py/openage/convert/mediafile.py:20: dat_cache_file = "C:/tmp_empires2_x1_p1.dat.pickle"

BUILD

Build binary

./configure --mode=debug --c-compiler=gcc --cpp-compiler=g++ 
cp -R .bin/gcc-debug-01 ./bin
buildsystem/simple

Build assets (takes a long time and 600MB+ ram.)

PYTHONPATH=py python3 -m openage.convert -v media -o "assets/converted" "/c/Program Files (x86)/Age of Empires/" graphics:*.* terrain:*.* sounds0:*.* sounds1:*.* gamedata0:*.* gamedata1:*.* gamedata2:*.* interface:*.*

Convert all *.docx files from CRLF to LF

find ./assets/converted/ | grep 'docx$' | xargs -n1 sed -rie 's/\r\n/\n/'

This conversion is slow, it would be better to fix the script to produce LF instead of CRLF on MSYS2 platform.

from openage.

TheJJ avatar TheJJ commented on May 5, 2024

awesome! lets see how we can bring your changes upstream without ugly hacks ;)

from openage.

franciscod avatar franciscod commented on May 5, 2024

https://github.com/franciscod/openage/compare/convert-crossplatform-tmp

This should fix the mentioned issue:
py/openage/convert/mediafile.py:20: dat_cache_file = "C:/tmp_empires2_x1_p1.dat.pickle"

from openage.

quyvv01581 avatar quyvv01581 commented on May 5, 2024

Hi mappu,

I'm a windows user, and i'm never use linux before. So could you explain to me how to build openage on windows step by step. How can i build assets and convert all *.docx files as you say?

Many thanks.

from openage.

franciscod avatar franciscod commented on May 5, 2024

there's no step by step guide to compiling on windows: this guide posted by @mappu cross-compiles from arch linux to windows using mingw

EDIT: this is for windows! read mappu's comment below

from openage.

mappu avatar mappu commented on May 5, 2024

@franciscod Just to clarify, i did build it on windows - MSYS2 is a distribution of pacman and mingw-w64 on windows. You can find it at http://msys2.github.io/ .

from openage.

franciscod avatar franciscod commented on May 5, 2024

Oh, I didn't know of msys2! I assumed Arch Linux from pacman. Thanks for
your clarification!

from openage.

EvilPeanut avatar EvilPeanut commented on May 5, 2024

I would like to help develop the project, can I use Visual Studio 2012 to help develop it? Also, how would I do this?

from openage.

TheJJ avatar TheJJ commented on May 5, 2024

@EvilPeanut for long-enduring discussion the best place is our irc channel πŸ˜‰ (#sfttech on freenode). The resulting tasks and decisions will then be posted back here in the issue tracker.

from openage.

EvilPeanut avatar EvilPeanut commented on May 5, 2024

@TheJJ Thanks, il have a look at that.

I know it's alot to ask, but would it be possible for someone to build it for Windows for me and send me the files (.exe ect..). I would love to try it and learn C++, but don't currently have the required knowledge to build the project.

from openage.

TheJJ avatar TheJJ commented on May 5, 2024

@EvilPeanut I think it'll be easier for the initial understanding to learn developing under Linux. You can simply install a Linux VM or use dual-boot. openage is currently working under Linux and MacOS X, it will be a long way and very complicated for you to start developing under Windows. Just join the IRC, many people can help you directly there.

from openage.

burgerga avatar burgerga commented on May 5, 2024

@TheJJ Just for clarification, is the solution by @mappu in the right direction, but needs to be properly integrated into CMake? Or is there a different issue?

from openage.

TheJJ avatar TheJJ commented on May 5, 2024

@burgerga The direction seems to be ok. Yes, it should be integrated into CMake properly and the plattform-specific switches should happen in cpp/crossplattform. Using mingw64 is probably the ideal way for us I hope.

from openage.

franciscod avatar franciscod commented on May 5, 2024

I'm giving a shot on this one, under a W7 32bit VM. Wish me luck!

from openage.

EvilPeanut avatar EvilPeanut commented on May 5, 2024

Good work @franciscod. I don't suppose you would mind zipping and sending me the compiled windows files for openage do you? If so it would be greatly appreciated. My email is [email protected]

from openage.

franciscod avatar franciscod commented on May 5, 2024

PROTIP: setbuf(stdout, NULL); is very useful πŸ’ƒ

@EvilPeanut nope, the compiled files doesn't work at all :D if you want the binaries just follow my instructions; this is far from finished.

from openage.

franciscod avatar franciscod commented on May 5, 2024

holy crap, i've been debugging 2 hours for THISS!!!!!

MSG   ERROR: failed reading the file ./assets/converted/termcolors.docx
FATAL Exception: failed reading the file ./assets/converted/termcolors.docx

and i forgot the last step from our god and saviour mappu:

  • Convert all *.docx files from CRLF to LF

find ./assets/converted/ | grep 'docx$' | xargs -n1 sed -rie 's/\r\n/\n/'

from openage.

franciscod avatar franciscod commented on May 5, 2024

!!!!!!!!!!!!!!!!!!!!!

1423053695

>be gaben

>gotta go fast

from openage.

franciscod avatar franciscod commented on May 5, 2024

This commit builds and runs!!!
https://github.com/franciscod/openage/tree/a4519112381fe7dd8ceed3377d620dc548064d07

from openage.

franciscod avatar franciscod commented on May 5, 2024

#207 targets compiling and running from a MSYS2 system, on a windows host

#233 cross compiles using mingw-w64 and runs with wine!

from openage.

burgerga avatar burgerga commented on May 5, 2024

Congrats, but beware of the next step: packaging πŸ˜›

from openage.

ethanhs avatar ethanhs commented on May 5, 2024

You should consider using the new Clang support in Visual Studio. That may make some things easier.

from openage.

franciscod avatar franciscod commented on May 5, 2024

Necrobumping to the maximum level!

Should we target crosscompiling windows binaries from *nix (using mingw-w64, for example), building on windows hosts (with msys2 and/or visual studio), or both?

from openage.

TheJJ avatar TheJJ commented on May 5, 2024

I'd say prio #1 is crosscompiling with mingw-w64, if that works, we can think about msys2 and then visualstudio.

from openage.

wpbest avatar wpbest commented on May 5, 2024

It's still in prerelease. No debugger support.

from openage.

burgerga avatar burgerga commented on May 5, 2024

One of the main problems now is packaging, and mainly the question what to do with the python interpreter. If you want to include that in the package it's quite annoying, I think there are only nice solutions for python 2 but i could be wrong...

from openage.

zuntrax avatar zuntrax commented on May 5, 2024

@burgerga I ran into some problems myself trying to package it for nixos. We will probably redesign some of the python-specific parts. Shipping an interpreter in the openage package will probably cause a lot of problems.

from openage.

franciscod avatar franciscod commented on May 5, 2024

Ho, I remember trying to crosscompile with mingw-w64 from Arch Linux and hit some roadblocks with the mingw-w64 Python package. It's been updated to 3.6 now, just letting you know if someone wants to give it a shot :)

https://aur.archlinux.org/packages/mingw-w64-python

from openage.

simonsan avatar simonsan commented on May 5, 2024

There is a 64-bit installer out for windows 10. You can download it here.

Next step could be reproducible and frequent CI-builds with Kevin.
I don't know when this topic can be closed - Windows support could take forever. :-D

EDIT: I'll close this issue now, openage is building, running and could even be packaged and installed on windows 10 64bit, issues that are related to windows like conversion, cross-compiling under linux targeting windows should be separate.

from openage.

simonsan avatar simonsan commented on May 5, 2024

Bookmarking one relevant commit (probably not fast-forward) to build openage under windows with mingw (by @tusharpm).

from openage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.