Good morning / afternoon.

I’ve been investigating how to build hugin properly for Apple Silicon (and if I 
manage to iron out the bugs), I’d be willing to help maintain a build for the 
recent OS.

I’ve found a few issues, which I was able to fix, mostly by updating to newer 
library versions.

The levmar code has an issue identical to 
https://github.com/astromatic/psfex/issues/12, which I fixed using the same fix 
as 
https://github.com/astromatic/psfex/commit/f096d495c7e1f21dedbd40b207935f500850a88e

However, the following code, in 
hugin-2025.0.0/src/hugin1/ptbatcher/ChangeUserDefinedDialog.cpp, seems to be 
wrong and cannot compile on macOS.

/** return path to data directory, it depends on operating system */
wxString GetDataPath()
{
#if defined __WXMSW__
    wxFileName exePath(wxStandardPaths::Get().GetExecutablePath());
    exePath.RemoveLastDir();
    const wxString huginRoot = exePath.GetPath(wxPATH_GET_VOLUME | 
wxPATH_GET_SEPARATOR);
    return huginRoot + "share\\hugin\\data\\";
#elif defined __WXMAC__ && defined MAC_SELF_CONTAINED_BUNDLE
    // initialize paths
    {
        wxString thePath = MacGetPathToBundledResourceFile(CFSTR("xrc"));
        if (thePath.IsEmpty())
        {
            hugin_utils::HuginMessageBox(_("xrc directory not found in 
bundle"), _("PTBatcherGUI"), wxOK|wxICON_ERROR, this);
            return wxEmptyString;
        }
        return thePath + "/";
    }
#elif defined UNIX_SELF_CONTAINED_BUNDLE
    // initialize paths
    {
        wxFileName exePath(wxStandardPaths::Get().GetExecutablePath());
        exePath.RemoveLastDir();
        const wxString huginRoot = exePath.GetPath(wxPATH_GET_VOLUME | 
wxPATH_GET_SEPARATOR);
        return huginRoot + "share/hugin/data/";
    }
#else
    // add the locale directory specified during configure
    return INSTALL_DATA_DIR;
#endif
}

Under defined __WXMAC__ && defined MAC_SELF_CONTAINED_BUNDLE, this results in 
attempting to compile the line
hugin_utils::HuginMessageBox(_("xrc directory not found in bundle"), 
_("PTBatcherGUI"), wxOK|wxICON_ERROR, this);
while being outside of a class method.

This looks like a refactor issue using a non method helper.

Since I’m more a git than a hg person, I haven’t gotten around figuring out 
when that issue was introduced though.

Anyone more familiar can comment on this, and what should the proper fix be ?

(More generally, is it the case that macOS builds have not been tested at all 
for a while?)

Guillaume DIDIER

-- 
A list of frequently asked questions is available at: 
http://wiki.panotools.org/Hugin_FAQ
--- 
You received this message because you are subscribed to the Google Groups 
"hugin and other free panoramic software" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/hugin-ptx/BC86C047-7C8D-4DFA-8CA1-7C294F43E409%40outlook.fr.
  • [hugin-ptx] Build i... Guillaume Didier

Reply via email to