Page 1 of 2

Installing FreeCiv on Apple Silicon

Posted: Tue Jun 18, 2024 4:56 pm
by mkd
I am trying to install FreeCiv on Apple Silicon and I am running into the following issue:

- I installed GTK(3?) following these steps: https://wiki.gnome.org/Projects/GTK/OSX/Building
- GTK was installed in /Users/myuser/gtk/inst

When I run the freeciv ./configure script I get an error that none of the client dependencies are found:

Code: Select all

checking for gtk+-3.0 >= 3.22.0... no
checking for gtk+-3.0 >= 3.10.0... no
checking for gtk4 >= 4.0.0... no
checking for qtpaths... no
checking for sdl2 >= 2.0.0... no
checking for sdl2-config... (cached) no
So then I tried running ./configure with the environment variable set

Code: Select all

PKG_CONFIG_PATH=/Users/myuser/gtk/inst/lib/pkgconfig
. I also checked the binaries and my impression is that the gtk version I had installed is 3.24.42:

Code: Select all

> /Users/myuser/gtk/inst/bin/gtk-launch --version
3.24.42
So that should suffice, no? What am I doing wrong?

Re: Installing FreeCiv on Apple Silicon

Posted: Tue Jun 18, 2024 7:14 pm
by Elefant
Reading the instructions, it seems that it provides a virtual environment for building programs. So just running ./configure will not have access to the build libraries. You probably need to run something like

Code: Select all

$ alias jhbuild="PATH=.new_local/bin:$PATH jhbuild"
, then

Code: Select all

jhbuild ./configure
. I don't know for sure, though.

Re: Installing FreeCiv on Apple Silicon

Posted: Tue Jun 18, 2024 7:16 pm
by Elefant
The packages installed to the user folder are probably just the runtime libs.

Re: Installing FreeCiv on Apple Silicon

Posted: Tue Jun 18, 2024 10:00 pm
by cazfi
Can you attach config.log from your configure run for us to check what happens with those configure checks?

Re: Installing FreeCiv on Apple Silicon

Posted: Tue Jun 18, 2024 10:18 pm
by mkd
edit: wrong file was uploaded by accident.

Re: Installing FreeCiv on Apple Silicon

Posted: Tue Jun 18, 2024 10:57 pm
by cazfi
In that config.log configure had terminated for the lack of libcurl development files.

Re: Installing FreeCiv on Apple Silicon

Posted: Wed Jun 19, 2024 12:29 am
by mkd
Ooops, I am sorry. It seems I had an editor that had the older version of the log open. I attached the most recent one.

Re: Installing FreeCiv on Apple Silicon

Posted: Wed Jun 19, 2024 5:33 am
by mkd
Elefant wrote: Tue Jun 18, 2024 7:14 pm Reading the instructions, it seems that it provides a virtual environment for building programs. So just running ./configure will not have access to the build libraries. You probably need to run something like

Code: Select all

$ alias jhbuild="PATH=.new_local/bin:$PATH jhbuild"
, then

Code: Select all

jhbuild ./configure
. I don't know for sure, though.
I ran the following two commands in this order:

Code: Select all

alias jhbuild="PATH=/Users/myuser/.new_local/bin:$PATH jhbuild"
PKG_CONFIG_PATH=/Users/myuser/src/curl-8.8.0/artifacts/lib/pkgconfig jhbuild ./configure
And got the following error:

Code: Select all

Loading .env environment variables...
Found Command Line Tools 'version: 15.3.0.0.1.1708646388'
Command Line Tools version 15.300000
Traceback (most recent call last):
  File "/Users/myuser/.new_local/share/pyenv/versions/3.11.7/lib/python3.11/pkgutil.py", line 496, in find_loader
    spec = importlib.util.find_spec(fullname)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib.util>", line 94, in find_spec
ModuleNotFoundError: No module named 'jhbuild.commands.'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/myuser/.new_local/libexec/run_jhbuild.py", line 17, in <module>
    jhbuild.main.main(sys.argv[1:])
  File "/Users/myuser/Source/jhbuild/jhbuild/main.py", line 120, in main
    rc = jhbuild.commands.run(command, config, args, help=lambda: print_help(parser))
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/myuser/Source/jhbuild/jhbuild/commands/__init__.py", line 175, in run
    try_import_module('jhbuild.commands.%s' % command)
  File "/Users/myuser/Source/jhbuild/jhbuild/utils/misc.py", line 39, in try_import_module
    if pkgutil.get_loader(module_name) is None:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/myuser/.new_local/share/pyenv/versions/3.11.7/lib/python3.11/pkgutil.py", line 482, in get_loader
    return find_loader(fullname)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/myuser/.new_local/share/pyenv/versions/3.11.7/lib/python3.11/pkgutil.py", line 502, in find_loader
    raise ImportError(msg.format(fullname, type(ex), ex)) from ex
ImportError: Error while finding loader for 'jhbuild.commands../configure' (<class 'ModuleNotFoundError'>: No module named 'jhbuild.commands.')
When I just run

Code: Select all

PKG_CONFIG_PATH=/Users/myuser/src/curl-8.8.0/artifacts/lib/pkgconfig ./configure
without the jhbuild before the ./configure things seem to go better. Then things usually die off around:

Code: Select all

checking for bzlib.h... yes
checking for lzma_code in -llzma... yes
checking for lzma.h... no
checking for ZSTD_compress in -lzstd... no
checking for MagickWand... no
checking for MagickWand-6.Q16HDRI... no
checking for MagickWand-config in default path... no
checking for threads availability... pthreads for C and C++
checking for sdl2 >= 2.0.0... no
checking for sdl2-config... no
checking for SDL2.framework... *** The sdl2-config script installed by SDL2 could not be found
*** If SDL2 was installed in PREFIX, make sure PREFIX/bin is in
*** your path, or set the SDL2_CONFIG environment variable to the
*** full path to sdl2-config.
configure: checking for which client to compile:...
checking for gtk+-3.0 >= 3.22.0... no
checking for gtk+-3.0 >= 3.10.0... no
checking for gtk4 >= 4.0.0... no
checking for qtpaths... no
checking for sdl2 >= 2.0.0... no
checking for sdl2-config... (cached) no
checking for SDL2.framework... *** The sdl2-config script installed by SDL2 could not be found
*** If SDL2 was installed in PREFIX, make sure PREFIX/bin is in
*** your path, or set the SDL2_CONFIG environment variable to the
*** full path to sdl2-config.
configure: error: can not build any of the supported clients

Re: Installing FreeCiv on Apple Silicon

Posted: Wed Jun 19, 2024 5:59 am
by mkd
What confuses me now is that the config.log is now complaining about not finding zlib.pc while checking for gtk+-3.0:

Code: Select all

configure:32281: checking for sdl2-config
configure:32318: result: no
configure:32330: checking for SDL2.framework
configure:32803: checking for which client to compile:...
configure:32815: checking for gtk+-3.0 >= 3.22.0
configure:32822: $PKG_CONFIG --exists --print-errors "gtk+-3.0 >= 3.22.0"
Package zlib was not found in the pkg-config search path.
Perhaps you should add the directory containing `zlib.pc'
to the PKG_CONFIG_PATH environment variable
Package 'zlib', required by 'freetype2', not found
configure:32825: $? = 1
configure:32839: $PKG_CONFIG --exists --print-errors "gtk+-3.0 >= 3.22.0"
Package zlib was not found in the pkg-config search path.
Perhaps you should add the directory containing `zlib.pc'
to the PKG_CONFIG_PATH environment variable
Package 'zlib', required by 'freetype2', not found
configure:32842: $? = 1
configure:32856: result: no
Package 'zlib', required by 'freetype2', not found
configure:32926: checking for gtk+-3.0 >= 3.10.0
configure:32933: $PKG_CONFIG --exists --print-errors "gtk+-3.0 >= 3.10.0"
Package zlib was not found in the pkg-config search path.
Perhaps you should add the directory containing `zlib.pc'
to the PKG_CONFIG_PATH environment variable
Package 'zlib', required by 'freetype2', not found
configure:32936: $? = 1
configure:32950: $PKG_CONFIG --exists --print-errors "gtk+-3.0 >= 3.10.0"
Package zlib was not found in the pkg-config search path.
Perhaps you should add the directory containing `zlib.pc'
to the PKG_CONFIG_PATH environment variable
Package 'zlib', required by 'freetype2', not found
configure:32953: $? = 1
configure:32967: result: no
Package 'zlib', required by 'freetype2', not found
configure:33032: checking for gtk4 >= 4.0.0
configure:33039: $PKG_CONFIG --exists --print-errors "gtk4 >= 4.0.0"
Package gtk4 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk4.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk4' found
configure:33042: $? = 1
configure:33056: $PKG_CONFIG --exists --print-errors "gtk4 >= 4.0.0"
Package gtk4 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk4.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk4' found
configure:33059: $? = 1
configure:33073: result: no
No package 'gtk4' found
configure:33165: checking for qtpaths
configure:33199: result: no
configure:34636: checking for sdl2 >= 2.0.0
configure:34643: $PKG_CONFIG --exists --print-errors "sdl2 >= $min_sdl2_version"
Package sdl2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `sdl2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'sdl2' found


Re: Installing FreeCiv on Apple Silicon

Posted: Wed Jun 19, 2024 3:19 pm
by Elefant
Sorry. Command should be

Code: Select all

 jhbuild run ./configure 
(I don't have a mac, so I can't test it)(I can't be sure about this command either, but the idea is to run ./configure in the jhbuild virtual environment).