mariuz / flamerobin

FlameRobin is a database administration tool for Firebird RDBMS. Our goal is to build a tool that is: lightweight (small footprint, fast execution) cross-platform (Linux, Windows, Mac OS X, FreeBSD) dependent only on other Open Source software
http://flamerobin.org
MIT License
214 stars 66 forks source link

Build/installation on macOS Big Sur 11.4 #220

Closed Tomas2D closed 3 years ago

Tomas2D commented 3 years ago

Hey, I am trying to set up Flamerobin on my macOS Big Sur 11.4. 🍏

The compilation process went fine, except small edit of CMakeLists.txt, where I needed to do this

if (UNIX)
        if (NOT APPLE) # ADDED THIS CONDITION
                # UNIX (Linux) specific details
                list(APPEND SOURCE_LIST
                        ${SOURCEDIR}/gui/gtk/StyleGuideGTK.cpp
                )
        endif (NOT APPLE)

        add_definitions(-DIBPP_LINUX)
        add_definitions(-DFR_INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}")
        # Need to link the fbclient lib in *nix systems
        list(APPEND FR_LIBS -lfbclient)

        # Create the revision include file
        execute_process(
                COMMAND "${CMAKE_SOURCE_DIR}/update-revision-info.sh"
                WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
        )

        # Util script to help run FR in build dir
        file(COPY utils/run_flamerobin.sh  DESTINATION ${CMAKE_CURRENT_BINARY_DIR})

endif (UNIX)

then it compiles successfully, but after running make install, the Flamerobin is installed to /usr/local/bin which is not desired on macOS, it should be Flamerobin.app, which contains everything inside it (this was working in older versions of Flamerobin, probably before CMake).

I see that you have a configuration for it in Makefile.in, but it looks like that it was not executed at all. https://github.com/mariuz/flamerobin/blob/1b4bafbfdc34ee14ed1156229535bb113074670c/Makefile.in#L280-L311

Can you please give me some advice on how to edit CMakeLists/Makefile to achieve it? Thanks.

Tomas2D commented 3 years ago

I was able to make it working by manually creating the FlameRobin.app and place the required files inside.

Flamerobin.app
Flamerobin.app/Contents
Flamerobin.app/Contents/Info.plist # file
Flamerobin.app/Contents/PkgInfo  # file
Flamerobin.app/Contents/MacOS 
Flamerobin.app/Contents/MacOS/flamerobin
Flamerobin.app/Contents/Resources
Flamerobin.app/Contents/Resources/flamerobin.icns #file
Flamerobin.app/Contents/SharedSupport
Flamerobin.app/Contents/SharedSupport/html-templates
Flamerobin.app/Contents/SharedSupport/conf-defs
Flamerobin.app/Contents/SharedSupport/docs
Flamerobin.app/Contents/SharedSupport/sys-templates
Flamerobin.app/Contents/SharedSupport/code-templates

But I would like to make it works out of the box :)

arvanus commented 3 years ago

Hello @Tomas2D, sorry, I'm not used to work with Mac I know that @blumf did the port to Cmake, and he asked for mac users here #120

You can take a look at: https://github.com/mariuz/flamerobin/blob/1b4bafbfdc34ee14ed1156229535bb113074670c/CMakeLists.txt#L360-L378 And https://github.com/mariuz/flamerobin/blob/1b4bafbfdc34ee14ed1156229535bb113074670c/CMakeLists.txt#L406 if it's this lines to improve, and you know how do change, can you make a pull with the fix?

blumf commented 3 years ago

After a quick bit of Googling, maybe the changes in PR #221 might help.

Tightened up the platform detection (plain 'UNIX' covers Linux/BSD/etc. and Apple) Used MACOSX_BUNDLE properties too, hopefully, they do the right thing.

Working in the dark here, does it make any sense to you @Tomas2D ?

Tomas2D commented 3 years ago

Hey, thanks for a quick reply, I was quite busy, but today I had time to look at it and created a pull request with related changes. Quite a pain to make it work I must say 😄

But thanks for getting me on the right track and for working on this software.

PR: #222

Tomas2D commented 3 years ago

We can probably close this for now, or?