#4050 Freeciv 2.3.0 update

closed-out-of-date
5
2012-12-30
2011-10-23
David Lowe
No

Does this package have OS version restrictions? - none that i'm aware of, though i did have to patch to get it to build on 10.5
Which section does it belong in? - games
Have you built it with -m --build-as-nobody? yes

I have not been able to test on 10.7 yet...

Discussion

  • David Lowe

    David Lowe - 2011-10-23

    2.3.0

     
  • David Lowe

    David Lowe - 2011-10-23

    IPV6 patch for Leopard

     
  • David Lowe

    David Lowe - 2011-10-23
    • assigned_to: nobody --> nieder
     
  • Hanspeter Niederstrasser

    Currently only have 10.7 to test this on. It fails with these errors:

    1)
    /bin/sh ../libtool --preserve-dup-deps --silent --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I/sw/include -DLOCALEDIR="\"/sw/share/locale\"" -DBINDIR="\"/sw/bin\"" -DDEFAULT_DATA_PATH="\".:data:~/.freeciv/2.3:/sw/share/freeciv\"" -DDEFAULT_SAVES_PATH="\"\"" -DDEFAULT_SCENARIO_PATH="\".:data/scenario:~/.freeciv/2.3/scenarios:~/.freeciv/scenarios:/sw/share/freeciv/scenario\"" -Wall -Wpointer-arith -Wcast-align -Wmissing-prototypes -Wmissing-declarations -Wno-unused-but-set-variable -Werror -g -O2 -fsigned-char -c -o shared.lo shared.c
    shared.c:370:36: error: comparison of unsigned expression >= 0 is always true [-Werror,-Wtautological-compare]
    while (mantissa != 0 && exponent >= 0) {
    ~~~~~~~~ ^ ~
    /bin/sh ../libtool --preserve-dup-deps --silent --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I/sw/include -DLOCALEDIR="\"/sw/share/locale\"" -DBINDIR="\"/sw/bin\"" -DDEFAULT_DATA_PATH="\".:data:~/.freeciv/2.3:/sw/share/freeciv\"" -DDEFAULT_SAVES_PATH="\"\"" -DDEFAULT_SCENARIO_PATH="\".:data/scenario:~/.freeciv/2.3/scenarios:~/.freeciv/scenarios:/sw/share/freeciv/scenario\"" -Wall -Wpointer-arith -Wcast-align -Wmissing-prototypes -Wmissing-declarations -Wno-unused-but-set-variable -Werror -g -O2 -fsigned-char -c -o md5.lo md5.c
    md5.c:148:5: error: cast from 'const unsigned char *' to 'MD5_u32plus *' (aka 'unsigned int *') increases required alignment from 1 to 4 [-Werror,-Wcast-align]
    STEP(F, a, b, c, d, SET(0), 0xd76aa478, 7)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Clang (the default 10.7 compiler) is much more strict than gcc. These errors can be worked around temporarily by setting the field "SetCC: llvm-gcc-4.2" on 10.7, but if you're in contact with the freeciv programmers, they should fix the code itself.

    *******
    2)
    Defaulting to llvm-gcc-4.2 however, fails later with warnings registry.c that are turned on by the parameter "--enable-debug".

    *******
    3)
    During ./configure, it prints out this warning.
    configure: WARNING: for requested client 'gtk' enabled gtk2-client, but that default may change in the future

    Apparently, the proper value for --enable-client is now "gtk2". Not a fatal error for now, but it might be in the future.

    ********
    4)
    Finally, does the perl command actually do anything as changed? I don't see "client_LAST" anywhere in the source code, while the previous "GUI_LAST" is still present.

     
  • Hanspeter Niederstrasser

    • milestone: 373615 --> Awaiting_Update_from_Submitter
     
  • David Lowe

    David Lowe - 2011-10-24

    1) I already have to file a ticket upstream, so that'll be just one more thing to do while i'm there. For the SetCC: field, i was looking for an example in the info files and i didn't find one. Should it be in a conditional test, or is it okeh to expose everybody to it?

    2) I've turned off debug for now until this can be taken care of.

    3) This is fixed now, and i apologize for not catching it myself...

    4) I need to research this one.

    I'll send up a new info file after i deal with #1 and #4.

     
  • Hanspeter Niederstrasser

    Unfortunately, "SetCC: llvm-gcc-4.2" can't be used for everyone because that compiler doesn't exist across all supported systems. There's also no way to set conditionals in SetENVVAR fields so it's only applied for, say, 10.7. The choices would be to 1) have different files for 10.4+ and 10.7, with the field only existing on the 10.7 file, or 2) move setting CC to a conditional inside CompileScript and so the two files would not diverge.

    Something like this:
    (this is not working code, but the idea is right)

    CompileScript: <<
    #!/bin/sh -ev
    if $OSX >= 10.7 {
    export CC=llvm-gcc-4.2
    fi
    %{default_script}
    <<

    The OSX version can be found by parsing the output of "sw_vers -productVersion", and there are several packages in unstable that use a similar construct. Searching for "productVersion" in that tree should give you some examples where people have done similar conditionals.

     
  • David Lowe

    David Lowe - 2011-10-27

    1) Upstream raised a question about the ' -Werror' argument. If you strike out "--enable-debug" do you still get this failure?

    2) I'm not seeing the registry.c warnings either. Can you please send me a log?

    If turning off enable-debug solves both, then it would be a good fix all around. Otherwise i would still need to turn it off for 10.7 in addition to the compiler change. In that case, i might prefer having separate files.

     
  • Hanspeter Niederstrasser

    1) and 2) Ahh. I'd only removed --enable-debug after I had switched to llvm-gcc-4.2. But if I remove --enable-debug when still using the default clang, then the build finishes successfully on 10.7 and freeciv-2.3 runs. So there would be no need to change the default compiler on 10.7.

    2) For the record, this is the warning (made fatal because of -Werror via --enable-debug) that I get for registry.c when building with llvm-gcc-4.2 if upstream is still interested in it.

    /bin/sh ../libtool --preserve-dup-deps --silent --tag=CC --mode=compile llvm-gcc-4.2 -DHAVE_CONFIG_H -I. -I.. -I/sw/include -DLOCALEDIR="\"/sw/share/locale\"" -DBINDIR="\"/sw/bin\"" -DDEFAULT_DATA_PATH="\".:data:~/.freeciv/2.3:/sw/share/freeciv\"" -DDEFAULT_SAVES_PATH="\"\"" -DDEFAULT_SCENARIO_PATH="\".:data/scenario:~/.freeciv/2.3/scenarios:~/.freeciv/scenarios:/sw/share/freeciv/scenario\"" -Wall -Wpointer-arith -Wcast-align -Wmissing-prototypes -Wmissing-declarations -Werror -g -O2 -c -o registry.lo registry.c
    cc1: warnings being treated as errors
    registry.c: In function 'secfile_entry_delete':
    registry.c:1713: warning: return makes integer from pointer without a cast
    registry.c: In function 'secfile_lookup_plain_enum_full':
    registry.c:2116: warning: return makes integer from pointer without a cast
    registry.c:2117: warning: return makes integer from pointer without a cast
    registry.c:2118: warning: return makes integer from pointer without a cast
    registry.c:2119: warning: return makes integer from pointer without a cast
    registry.c: In function 'secfile_lookup_bitwise_enum_full':
    registry.c:2258: warning: return makes integer from pointer without a cast
    registry.c:2259: warning: return makes integer from pointer without a cast
    registry.c:2260: warning: return makes integer from pointer without a cast
    registry.c:2261: warning: return makes integer from pointer without a cast
    registry.c: In function 'secfile_lookup_enum_data':
    registry.c:2440: warning: return makes integer from pointer without a cast
    registry.c:2441: warning: return makes integer from pointer without a cast
    registry.c:2442: warning: return makes integer from pointer without a cast

    5) One new thing I noticed: "fink list freeciv" gives the following for the package Description:

    (. = .) Multiplayer Strategy Game, GTK Client

    While that is a neat trick that you're trying, it looks like the parser only parses the % expansion, but doesn't evaluate the conditional. Until the SDL based frontend package is ready, I would remove the % expansion from the Description field (keep all the others since they are working as expected).

     
  • David Lowe

    David Lowe - 2012-12-30

    Let's just write this off as obsolete. I'll open a new ticket with the latest version.

     
  • David Lowe

    David Lowe - 2012-12-30
    • status: open --> closed-out-of-date
     

Log in to post a comment.