Getting Angband from Github and compiling it

Collapse
This is a sticky topic.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Magnate
    Angband Devteam member
    • May 2007
    • 5110

    Getting Angband from Github and compiling it

    This tutorial assumes that you are using git at a command line. If you are using git via a GUI or IDE, you probably know all this already. Besides, there are too many possible GUIs to cover them all.

    If you are seeking to build v4 rather than V, follow the instructions below, but everywhere you see github.com/something/angband, use github.com/something/v4 instead.

    1. First, create yourself an account at github.com. We'll call this account yourname. You don't strictly have to do this: if you really don't want a github account, skip step 2.

    2. Having logged into your github account, go to http://github.com/angband/angband and click the Fork button. This will create a fork of the official repo at your github account.

    3. On your local machine do "git clone git://github.com/yourname/angband dirname". This will create a local copy of your fork of the official repo in dirname. If you didn't create a github account, just clone git://github.com/angband/angband instead, and that will create a local copy of the official repo directly. This means that you won't be able to push any changes back to github, so you can't share your brilliant fixes and customisations with the rest of us, but never mind.

    4. Change directory into dirname, and that's basically it - you are now able to build the latest nightly version of angband yourself. How you do this will depend on your build environment, but don't forget to "make clean" in between builds - and if you're on *nix, you'll need to use "./autogen.sh; ./configure" the first time you build, and after every "make distclean".

    You can use "configure --help" to see the different options available. The ones you may want to consider are

    --with-no-install, if you want to play it from the git directory, rather than installing it elsewhere on your system

    --enable-sdl, to build the SDL port (start it with "angband -msdl")

    (the rest of these are irrelevant on Windows, but useful on unix/mac)

    --enable-gtk, to build the GTK port (start with "angband -mgtk")

    --disable-x11, if you don't want it to build the x11 port

    --disable-curses, if you don't want it to build the console port

    --with-setgid=groupname, if you want a system-wide installation (i.e. for all users)
    Last edited by Magnate; October 24, 2011, 16:07. Reason: Added note about v4.
    "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles
  • myshkin
    Angband Devteam member
    • Apr 2007
    • 334

    #2
    Mac OS X users will need to have the Developer Tools installed, or some other means of getting at a compiler. Also, while the autoconf/configure toolchain works on Mac OS X, it won't yet generate Mac OS X application bundles. If you want to play under the terminal or in X11, that's fine. Otherwise, instead of Magnate's step 4, cd into the src directory and run make -f Makefile.osx. I intend to add Mac OS X support to configure.ac, but would welcome patches, as it's not highest on my to-do list.

    Comment

    • Spacebux
      Adept
      • Apr 2009
      • 231

      #3
      Little help, please... ( * o *)/~~

      Originally posted by Magnate
      (Pav - I thought I'd offer this because the stickied SVN thread is now out-of-date for V - feel free to nuke it if it's not helpful enough. Maybe it's obsolete now we have nightlies?)

      This tutorial assumes that you are using git at a command line. ...
      I cannot get past this compile error for z-file.c on Windows using Cygwin/MinGW.

      gcc -DWINDOWS -Wall -Wextra -Wno-unused-parameter -std=c99 -Wdeclaration-after-s
      tatement -O2 -I. -c -o z-file.o z-file.c
      z-file.c:25:21: direct.h: No such file or directory
      z-file.c: In function `dir_create':
      z-file.c:713: error: too few arguments to function `mkdir'
      z-file.c:716: error: too few arguments to function `mkdir'

      make: *** [z-file.o] Error 1

      I have looked, but I fail to see the issue in the code. More specifically, I'm not sure how many arguments and which are missing from mkdir.

      I've fallen and cannot get up....

      Also, I had to resort to the 3.2.0 source Makefile to get it to go... couldn't get any of the newer Makefiles to work with my Cygwin setup, even after updating MinGW. clueless...

      -SBux-

      Comment

      • d_m
        Angband Devteam member
        • Aug 2008
        • 1517

        #4
        To build for Windows, you're supposed to cd into src and then run "make -f Makefile.win"... is that what you're doing?
        linux->xterm->screen->pmacs

        Comment

        • Spacebux
          Adept
          • Apr 2009
          • 231

          #5
          Originally posted by d_m
          To build for Windows, you're supposed to cd into src and then run "make -f Makefile.win"... is that what you're doing?
          Yeah, that is what I was doing...

          It couldn't locate that certain header file, so I yanked that section out of the code, and it compiles.

          direct.h <-- file not found... so, no directory creation for me.

          -SBux-

          Comment

          • takkaria
            Veteran
            • Apr 2007
            • 1951

            #6
            Originally posted by Spacebux
            Yeah, that is what I was doing...

            It couldn't locate that certain header file, so I yanked that section out of the code, and it compiles.

            direct.h <-- file not found... so, no directory creation for me.

            -SBux-
            do you not mean dirent.h?
            takkaria whispers something about options. -more-

            Comment

            • Spacebux
              Adept
              • Apr 2009
              • 231

              #7
              Originally posted by takkaria
              do you not mean dirent.h?
              Did not thunk of that it might be a simple mis-spelling:


              #ifdef WINDOWS
              # include <windows.h>
              # include <io.h>
              # include <direct.h>
              #endif

              Comment

              • takkaria
                Veteran
                • Apr 2007
                • 1951

                #8
                Originally posted by Spacebux
                Did not thunk of that it might be a simple mis-spelling:


                #ifdef WINDOWS
                # include <windows.h>
                # include <io.h>
                # include <direct.h>
                #endif
                Actually, it's not just a simple misspelling, because that works absolutely fine when building the game for me. But if it fixes it for you, excellent.
                takkaria whispers something about options. -more-

                Comment

                • Tobias
                  Adept
                  • Dec 2009
                  • 172

                  #9
                  How do you pull changes from the main repo into your personal fork?
                  My Angband videos : http://www.youtube.com/view_play_lis...385E85F31166B2

                  Comment

                  • takkaria
                    Veteran
                    • Apr 2007
                    • 1951

                    #10
                    Originally posted by Tobias
                    How do you pull changes from the main repo into your personal fork?
                    If you branched from the official github repository, then 'git pull' should automatically merge them in for you.
                    takkaria whispers something about options. -more-

                    Comment

                    • Tobias
                      Adept
                      • Dec 2009
                      • 172

                      #11
                      Originally posted by takkaria
                      If you branched from the official github repository, then 'git pull' should automatically merge them in for you.
                      I meant, the online fork on github. How do I rebase this to a newer main version?
                      My Angband videos : http://www.youtube.com/view_play_lis...385E85F31166B2

                      Comment

                      • Magnate
                        Angband Devteam member
                        • May 2007
                        • 5110

                        #12
                        Originally posted by Tobias
                        I meant, the online fork on github. How do I rebase this to a newer main version?
                        1. Clone your fork locally using "git clone http://github.com/yourID/angband". You now have a local repo which tracks your fork as a remote called "origin".

                        2. Add the official repo as a remote with "git remote add official http://github.com/angband/angband".

                        3. Update your local tracking of the official repo with "git fetch official".

                        4. Merge the latest official changes into your local repo with "git merge official/master".

                        5. Push those changes up to your github repo with "git push origin master".

                        This assumes you have not strayed from your master branch in your local repo during this whole exercise.
                        "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

                        Comment

                        • Tobias
                          Adept
                          • Dec 2009
                          • 172

                          #13
                          Thanks Magnate, I will try this sometime.

                          Also, how can you search the online tree, or the commit log, like you could on the old system?

                          And what is the easiest way to restore a single file to the official state?
                          Last edited by Tobias; May 15, 2011, 11:42.
                          My Angband videos : http://www.youtube.com/view_play_lis...385E85F31166B2

                          Comment

                          • d_m
                            Angband Devteam member
                            • Aug 2008
                            • 1517

                            #14
                            Originally posted by Tobias
                            Also, how can you search the online tree, or the commit log, like you could on the old system?
                            Depends on what you mean. You can do things like "git log" and just scroll around to read it, or you can do "git log | grep 'hello world'" to search for 'hello world'. You can also do "git grep" if you want to find a particular piece of sourcecode (or something) that is no longer there.

                            Originally posted by Tobias
                            And what is the easiest way to restore a single file to the official state?
                            git checkout FILE will revert FILE to its current state in HEAD. This will be the same as the official state as long as you aren't committing to the repo yourself.
                            linux->xterm->screen->pmacs

                            Comment

                            • Tobias
                              Adept
                              • Dec 2009
                              • 172

                              #15
                              Originally posted by d_m
                              Depends on what you mean. You can do things like "git log" and just scroll around to read it, or you can do "git log | grep 'hello world'" to search for 'hello world'. You can also do "git grep" if you want to find a particular piece of sourcecode (or something) that is no longer there.
                              No I meant on the website. In the old days the you could search the commit log from the trac.rephial.org site. Or maybe I am remembering wrong.
                              My Angband videos : http://www.youtube.com/view_play_lis...385E85F31166B2

                              Comment

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