Uploaded image for project: 'Funtoo Linux'
  1. Funtoo Linux
  2. FL-10294

[next] x11-wm/fluxbox should be compiled with std=c++98 (and other issues)

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Severe (Ebuild) Severe (Ebuild)
    • None
    • None
    • emerge fluxbox
    • fluxbox needs some attention and maintenance to build as well as work reliably in next-release in particular.
    • GCC 11.3, defaults to std=c++17, but Fluxbox is c++98 code.

      Issue #1 - the main BUG
      Fluxbox is written in a beautiful c++98, but that's what it is. Apparently, it does compile with up to c++14, but I don't see a reason to try to compile with it a modern standard (even c++11) for that matter, when development is in maintenance mode and the upstream developers don't show any intention to update the code to modern CPP.

      But anyway, Funtoo now uses GCC 11.3 and it defaults to c++17 and it just won't compile. Even if it did, who knows what hidden bugs might appear when the code hasn't been reviewed to adhere to the new standards?

      So, I suggest not pretending the code is something it's not and compiling it as c++98. That can be done with simply adding "append-cppflags -std=c++98" to src_configure(),

      I am attaching a patch and the modified ebuild with that change.

      Issue #2 - upstream BUG
      Upon trying to compile it with std++98, I ran into a clear bug in the code, which should be caught in any standard: testing if a pointer is > than 0. A pointer is either 0 or not, and in that particular case, I think it would be more correct to compare it with NULL, as it referes to an Xlib data scrtructure field that will be set to NULL, as C has it.

      So I created a patch to fix that and added it to /files and referred to it in the ebuild. I haven't reported this bug to upstream.

      Issue #3 - ebuild BUG
      In src_compile(), the ebuild calls the fluxbox-generate_menu utility, which is shell script which relies on ImageMagick convert to do its job. However, the ebuild does not require that tool to be present at compile time.

      I added that to the BDEPEND variable, but it might be the case of actually adding it to RDEPEND, as the user might want to run that script on occasion after Fluxbox is installed.

      Issue #4 - cosmetic
      The ebuild makes Fluxbox output the string "gentoo" as part of it's -version output. I changed that to "funtoo".

      Issue #5 - improvement
      This ebuild currently uses EAPI 5, but it looks like it could benefit from the EAPI 7 improvements.

      Also, if there is the intention of autogenning it, I would recommend that the lastest CVS snapshot be used instead of the latest release, as I don't expect any disruptive commits to happen because the project is in maintenance mode. On the other hand, there have been bug fix commits there which we could benefit from.

      Attachments:
      1. fluxbox-1.3.7-r4.ebuild -> The relevant ebuild with my modifications.
      2. fluxbox-1.3.7-r4.ebuild.patch -> A patch to the ebuild above, so you can see what I changed.
      3 fluxbox-1.3.7-fix-compare-pointer-with-int.patch -> A patch to the upstream bug, which should go in the /files dir.

            Unassigned Unassigned
            adbosco adbosco
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: