Getting Unangband/Angband from SVN and Compiling on Windows

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • andrewdoull
    Unangband maintainer
    • Apr 2007
    • 872

    Getting Unangband/Angband from SVN and Compiling on Windows

    If the above sentence scared you, I definitely want you to read on.

    I'll translate: 'This is how you get the latest, up to the minute version of Unangband (or Angband) made easy for Windows users.'

    At the moment, you rely on the benevolence of strangers compiling and releasing a Windows version of Unangband every so often. However, you don't get to see the many improvements that are made at the time they happen, and have to wait for this period release and download process. What is good about these projects, however, is that there is a publicly accessible version of the program. You can get this program straight from the source, as it were, so you can see the latest and greatest improvements as they happen. And its not that difficult. Honest.

    A word of warning: the steps I'm outlining pretty much demand you have a broadband connection of some kind, because you'll be downloading over 100 MB of files and installing them on your computer.

    1. Download a Java Runtime environment from this link. You probably have one on Windows already, so you may not need to do this step. Choose the Windows Online Installation, and don't forget to check the box next to it to say you've read the licensing agreement. The installer is straightforward. Don't forget to allow this application out through your firewall software, if you're running any.

    2. Download Eclipse for C/C++ developers from this link. Expand the zip file to your C: drive, in C:\Eclipse. Right-click drag Eclipse.exe to your desktop and choose Create shortcut. That'll give you a nice way of starting Eclipse, since the people who packaged this program didn't give you one. Then double-click on the shortcut to run Eclipse. Change the workspace to C:\workspace so it's easier to find, or browse, select your desktop and a subfolder called workspace, which will appear on your desktop.


    3. Once you've got Eclipse running, follow these instructions to download and install Subclipse. Of course, like everything in free software, they're not correct. When it comes to step 6, you have to expand the tree and de-select Mylar Integration. We don't want that, but we do want the Subclipse package next to it. Restart the application when prompted.

    4. Download the minimal Gnu Windows environment minGW from this link, whilst saying this phrase 6 times quickly. Whoever comes up with these names? The installer will run and prompt you to install lots of additional stuff. Because its an online installer, you need to allow the installer out through your firewall software, if you're running any. Accept the defaults, pretty much everywhere, but when it comes to the list of things to install, you'll also need to check Make, which is where a lot of smarts are. You can ignore all the g++, g77 etc stuff on that page.

    5. Follow these instructions. You want to add the directory C:\mingw\bin to your existing system path.

    6. Run Eclipse off the short cut you made earlier (You've already done this once, when you installed Subclipse). You'll want to click on the bottom right of the coloured balls (they clearly wanted documentation people to have to write that) and the actual workspace will appear. Right-click on the left hand panel and choose New > Other...

    7. Click on the triangle next to SVN and choose Projects from SVN. Click Next.

    8. Select Create a new suppository location. I mean repository. Location. Click Next.

    9. Next to the URL, you'll want to type either:



    or



    depending on whether you want Angband or Unangband. Then fill in the Custom Label field with either Unangband or Angband. Click Next, and breath a sigh of relief that the idiots who made this form didn't tell you that you were holding the mouse in the wrong part of the screen as well as all the pop-ups telling you that you hadn't finished typing.

    10. Select trunk (some random number), and click Finish.

    11. In the Check out Ass dialog, click Yes. I mean, in the Check out As dialog, click Finish.

    12. In the Select a wizard project, you want to select Standard Make C Project. Click Next. I have to breath slowly when I say phrases like this, in case I inadvertently cast a spell from Harry Potter. Or worse, sound like I'm trying to cast one.

    13. In the Project Name field, type either Angband, Unangband or Mildred. Click Finish.

    14. Eclipse will miraculously starting downloading the Angband or Unangband SVN repository for you. Note that this is the first time the computer has done any work on your behalf. Up until here, you have been labouring on its behalf.

    15. We're almost done.

    16. Wait until the computer is done downloading however. Click the triangle next to Angband, Unangband or Mildred.

    17. Right-click on the src directory, and choose Make Targets > Build...

    18. Click Add.

    19. Target name is default. As in, actually type in the word default. Make target is default. Again, type in the word default. Uncheck the use default under build command, and type in the box mingw32-make -f makefile.cyg

    20. Just to be clear. There are no spaces between mingw32 and the minus sign, and make, and there is a space before and after the minus f. It might be easier if you just copy the above.

    21. Click Create.

    22. Select the default build target, and click Build. You'll see lots of gibberish in the console window that people who should know better get wildly excited over. However, at the end of it, you'll have an angband.exe sitting in C:\workspace\angband\trunk\angband\src or something similar (or unangband or mildred).

    23. Don't double-click on it. Instead curse the incompatibilities between windows and Unix, and copy the angband.exe file up one level, so it sits in the folder that holds the src folder. You'll be doing this particular activity a lot.

    24. Double-click on angband.exe.

    25. You're done.

    Now to keep up to date with any more recent changes, all you have to do is run Eclipse right-click on the Angband / Unangband / Mildred project, choose Team > Update, then repeat steps 17, then 22, 23 and 24, in that order (and nothing in between).

    Hopefully this will get you addicted further to tweaking around with Unangband source code, and ideally contributing to one of these projects.
    Last edited by andrewdoull; July 27, 2007, 14:18.
    The Roflwtfzomgbbq Quylthulg summons L33t Paladins -more-
    In UnAngband, the level dives you.
    ASCII Dreams: http://roguelikedeveloper.blogspot.com
    Unangband: http://unangband.blogspot.com
  • andrewdoull
    Unangband maintainer
    • Apr 2007
    • 872

    #2
    Originally posted by andrewdoull
    If the above sentence scared you, I definitely want you to read on.

    I'll translate: 'This is how you get the latest, up to the minute version of Unangband (or Angband) made easy for Windows users.'
    Pav, please sticky. Comments, criticisms, broken links, pointing out errors and outrageous lies here please.

    Andrew
    The Roflwtfzomgbbq Quylthulg summons L33t Paladins -more-
    In UnAngband, the level dives you.
    ASCII Dreams: http://roguelikedeveloper.blogspot.com
    Unangband: http://unangband.blogspot.com

    Comment

    • takkaria
      Veteran
      • Apr 2007
      • 1951

      #3
      Originally posted by andrewdoull
      19. Target name is default. As in, actually type in the word default. Make target is default. Again, type in the word default. Uncheck the use default under build command, and type in the box mingw32-make -f makefile.cyg
      For V, that wants to be makefile.win. I didn't just change it to annoy everyone; that makefile can now use either mingw (on either windows or unix) or cygwin, and compile either the pdcurses or native versions, I figured it made more sense to use the .win ending.

      EDIT: In V, makefile.win also automatically moves the executable up a directory, making 23 unnecessary. If you use mingw32-make -f makefile.cyg MINGW=yes install in Un, or maybe set the "target" to "install", then you get a similar effect. Saves a lot of time.

      I've also started autobuilding the Windows port every night to catch compile errors and the like. When the new homepage is up (http://rephial.org/), then I'll start making those builds available.
      Last edited by takkaria; January 7, 2008, 03:54.
      takkaria whispers something about options. -more-

      Comment

      • Bandobras
        Knight
        • Apr 2007
        • 726

        #4
        What a sneaky way of inducing gullible newbies to the horrifying world of UnAngband (and source code diving). ;D

        And I haven't found a bullet about the blue screens... :P

        Comment

        • Matthias
          Adept
          • Apr 2007
          • 201

          #5
          Is there any way to find out if you are just in the middle of changing something on the files, or are you one of the three persons on earth who only commit complete changes?

          Comment

          • andrewdoull
            Unangband maintainer
            • Apr 2007
            • 872

            #6
            Originally posted by takkaria
            For V, that wants to be makefile.win. I didn't just change it to annoy everyone; that makefile can now use either mingw (on either windows or unix) or cygwin, and compile either the pdcurses or native versions, I figured it made more sense to use the .win ending.

            EDIT: In V, makefile.win also automatically moves the executable up a directory, making 23 unnecessary. If you use mingw32-make -f makefile.cyg install in Un, or maybe set the "target" to "install", then you get a similar effect. Saves a lot of time.
            The Unangband makefile.cyg is supposed to do this with make install, but fails (it tries a mv -f, which is not a valid windows command). It also does a cleanobjs on make install.

            You're right though - I should update the Unangband makefiles. Adopting the Angband improvements is a 0.6.3 item - still stability bugs to iron out in the game play.

            I've also started autobuilding the Windows port every night to catch compile errors and the like. When the new homepage is up (http://rephial.org/), then I'll start making those builds available.

            But that would mean people won't know how to roll their own, which is what this article is about.
            The Roflwtfzomgbbq Quylthulg summons L33t Paladins -more-
            In UnAngband, the level dives you.
            ASCII Dreams: http://roguelikedeveloper.blogspot.com
            Unangband: http://unangband.blogspot.com

            Comment

            • andrewdoull
              Unangband maintainer
              • Apr 2007
              • 872

              #7
              Originally posted by Matthias
              Is there any way to find out if you are just in the middle of changing something on the files, or are you one of the three persons on earth who only commit complete changes?
              I'm good on ensuring that the game compiles - although the platform I ensure this on varies (was Windows, now OS/X).

              I'm not so good on ensuring the game is 'playable': for instance, I did a number of incremental updates to mage spells that left mages unplayable for about 2 weeks. This is primarily because I also use SVN as a backup tool.

              I'm very clear about when I break save file compatibility, and try to queue up the save file compatibility changes and do them all at once. This is because a few people do play direct from the SVN updates, and I also repair the occasional save file for other people, which means I have to be more judicious about save file changes.

              For instance, I'm going to do a save file 'bump' at some point, to add level_flags to the save file, status about whether or not the player is using their mana reserve, and a few other small fixes (fixing up mage spell book ordering etc). This'll be done just prior to beta1 of 0.6.2 I expect.

              So you're pretty safe playing from the SVN version.

              Andrew
              The Roflwtfzomgbbq Quylthulg summons L33t Paladins -more-
              In UnAngband, the level dives you.
              ASCII Dreams: http://roguelikedeveloper.blogspot.com
              Unangband: http://unangband.blogspot.com

              Comment

              • takkaria
                Veteran
                • Apr 2007
                • 1951

                #8
                Originally posted by andrewdoull
                The Unangband makefile.cyg is supposed to do this with make install, but fails (it tries a mv -f, which is not a valid windows command). It also does a cleanobjs on make install.
                Ah, yeah. I wonder if there's any way to test inside the makefile whether you're on Windows or not.
                takkaria whispers something about options. -more-

                Comment

                • pav
                  Administrator
                  • Apr 2007
                  • 793

                  #9
                  Heh, that's hell of a guide. Wouldn't it be easier to
                  1) pull down the zip archive with the branch from SVN web interface, thus eliminating Eclipse
                  2) get Cygwin up and running, thus eliminating hacking system PATHs all around the place and nuff?
                  See the elves and everything! http://angband.oook.cz

                  Comment

                  • andrewdoull
                    Unangband maintainer
                    • Apr 2007
                    • 872

                    #10
                    Originally posted by pav
                    Heh, that's hell of a guide. Wouldn't it be easier to
                    1) pull down the zip archive with the branch from SVN web interface, thus eliminating Eclipse
                    Unless you want to stay up to date, where repeatedly downloading a zip file, expanding it, and building it is more time consuming then selecting two menu items within Eclipse (Team, Update and Make Targets, Build...)

                    2) get Cygwin up and running, thus eliminating hacking system PATHs all around the place and nuff?
                    I'm not familiar enough with Cygwin, having decided on Mingw early on in Unangband's development. IIRC, Cygwin required that you get your end users to set up a Cygwin environment to run the application you distribute, whereas Mingw produced 'stand alone' executables.

                    The hack the path work is minimal.
                    The Roflwtfzomgbbq Quylthulg summons L33t Paladins -more-
                    In UnAngband, the level dives you.
                    ASCII Dreams: http://roguelikedeveloper.blogspot.com
                    Unangband: http://unangband.blogspot.com

                    Comment

                    • pav
                      Administrator
                      • Apr 2007
                      • 793

                      #11
                      Repeated downloading a zip file is no big deal in broadband times, and, most importantly, it avoid spamming the box with Java and Eclipse...

                      And yes, Cygwin can build fully standalone executables, if you want it to. I used to build my own modded EyAngband executables with it back in 2001, so I had something to play during long evenings in army service.
                      See the elves and everything! http://angband.oook.cz

                      Comment

                      • Nick
                        Vanilla maintainer
                        • Apr 2007
                        • 9647

                        #12
                        Originally posted by pav
                        And yes, Cygwin can build fully standalone executables, if you want it to.
                        Yes, I build all my windows executables with cygwin.
                        One for the Dark Lord on his dark throne
                        In the Land of Mordor where the Shadows lie.

                        Comment

                        • takkaria
                          Veteran
                          • Apr 2007
                          • 1951

                          #13
                          Originally posted by Nick
                          Yes, I build all my windows executables with cygwin.
                          *coughs* http://cygwin.com/license.html

                          The cygwin DLL (which gets linked into your binary if you use -mno-cygwin) is GPL with an exception for applications with OSI-free licences. Angband isn't one of those, so you have no licence to distribute a cygwin-compiled version of the game under the Angband licence...

                          Not that I suspect anyone will care, anyway. Licencing sucks.
                          takkaria whispers something about options. -more-

                          Comment

                          • pav
                            Administrator
                            • Apr 2007
                            • 793

                            #14
                            Ah suckage. I know GCC have a special clause that extempts binaries compiled with it (against it runtime libraries) from being GPL-poisoned. Too bad Red Hat haven't did the same for Cygwin.

                            Well, at least now I see a point of GPL'ing Angband
                            See the elves and everything! http://angband.oook.cz

                            Comment

                            • Fuma
                              Adept
                              • May 2007
                              • 114

                              #15
                              Originally posted by takkaria
                              Ah, yeah. I wonder if there's any way to test inside the makefile whether you're on Windows or not.
                              Maybe check some environment variables? I know one can set whatever variables he wants, but how many linux people have (for example) OS set to Windows_NT ? (just copied my results, so YMMV)
                              www.snowleopard.org - International Snow Leopard Trust

                              Comment

                              Working...
                              😀
                              😂
                              🥰
                              😘
                              🤢
                              😎
                              😞
                              😡
                              👍
                              👎