<div dir="ltr"><div>Ok, that all sounds logical. I'll work on putting together the code, and then I'll report back to everyone here on the mailing list before I start actually trying to add anything to the tree. I'll probably end up with some additional questions along the way.</div><div><br></div><div>Jason<br></div><div><br></div><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>-- </div><div>Jason Liu<br></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jun 4, 2020 at 4:10 PM Christopher Jones <<a href="mailto:jonesc@hep.phy.cam.ac.uk">jonesc@hep.phy.cam.ac.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;">Hi,<div><div><br><blockquote type="cite"><div>On 4 Jun 2020, at 3:06 pm, Jason Liu <<a href="mailto:jasonliu@umich.edu" target="_blank">jasonliu@umich.edu</a>> wrote:</div><br><div><div dir="ltr"><div>Well, Blender and MaterialX both use cmake to build, so hopefully it'll work without any major issues.</div><div><br></div><div>Then, my next question is: If the header that I'm going to be wrapping is <span style="font-family:monospace">#include <AppKit/AppKit.h></span>, then where should I be putting my file in the macports-legacy-support package? I'm assuming inside the <span style="font-family:monospace">include/</span> folder, but then what? Do I need to create an <span style="font-family:monospace">AppKit/</span> subfolder inside there?</div></div></div></blockquote><div><br></div><div>yes, under the include/ dir. you need to replicate the same structure as would normally be included, so if that is</div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace"><AppKit/AppKit.h></span></div><div><br></div><div>then you need to replicate exactly that.</div><div><br></div><div>Then, inside that file there are certain things you need to do. check some of the other examples. but it boils down to</div><div><br></div><div>1. use </div><div><br></div><div>#include_next <span style="color:rgb(0,0,0);font-family:monospace"><AppKit/AppKit.h></span></div><div><span style="color:rgb(0,0,0);font-family:monospace"><br></span></div><div><span style="color:rgb(0,0,0);font-family:monospace">that triggers the inclusion of the header that would have been used, if the wrapper did not exist. Doing this makes builds blind to the fact they are using the wrapper.</span></div><div><span style="color:rgb(0,0,0);font-family:monospace"><br></span></div><div><span style="color:rgb(0,0,0);font-family:monospace">2. Inside appropriate OSX version checks, add the additional bits and pieces you need to add to support older OSX versions. The checks should be specific to make sure its only done when needed. See </span></div><div><span style="color:rgb(0,0,0);font-family:monospace"><br></span></div><div><font face="monospace" color="#000000"><span>MacportsLegacySupport.h</span></font></div><div><font face="monospace" color="#000000"><span><br></span></font></div><div><font face="monospace" color="#000000"><span>for how this is done.</span></font></div><div><font face="monospace" color="#000000"><span><br></span></font></div><div><font face="monospace" color="#000000">If all you need to do is add a few typedefs to deal with some type renaming, then what you need to add insider the OS check is quite simple (i.e. doesn’t need an associated X.c file).</font></div><div><font face="monospace" color="#000000"><br></font></div><div><font face="monospace" color="#000000">3. Finally, we really like to have basic tests to validate the new features. Whatever you think makes minimal sense. see the test dir for examples.</font></div><div><font face="monospace" color="#000000"><br></font></div><div><font face="monospace" color="#000000">Chris</font></div><div><br></div><div><br></div><div><br></div><blockquote type="cite"><div><div dir="ltr"><div><br></div><div>Actually, the reality is a bit more complicated than that. The source codes of Blender and MaterialX actually use <span style="font-family:monospace">#include <Cocoa/Cocoa.h></span>, which if you take a look at the file located at <span style="font-family:monospace">/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h</span>, has <span style="font-family:monospace">#import <AppKit/AppKit.h></span>. Hopefully just wrapping AppKit.h will be sufficient?</div><div><br></div><div>Jason<br></div><div><br></div><div><div><div dir="ltr"><div dir="ltr"><div>-- </div><div>Jason Liu<br></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jun 4, 2020 at 5:49 AM Christopher Jones <<a href="mailto:jonesc@hep.phy.cam.ac.uk" target="_blank">jonesc@hep.phy.cam.ac.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><br><div><br><blockquote type="cite"><div>On 4 Jun 2020, at 5:50 am, Jason Liu <<a href="mailto:jasonliu@umich.edu" target="_blank">jasonliu@umich.edu</a>> wrote:</div><br><div><div dir="ltr"><div>Looking through the link that Chris provided, it looks like the MacPorts legacy support package might indeed be the perfect place to add my AppKit compatibility layer file. One tiny question that I have is: In the readme, where it says "GNU make is a hard build dependency", does that sentence mean that the MacPorts legacy support package itself needs GNU make, or does it mean that any portfile that uses the legacysupport PortGroup needs to add GNU make as a build dependency?</div></div></div></blockquote><div><br></div>Just the former. ports using it can use other build systems. it works well with most build systems, but not all. which do you have in mind ?</div><div><br></div><div>Chris</div><div><br><blockquote type="cite"><div><div dir="ltr"><div><br></div><div>Jason</div><div><br></div><div><div dir="ltr"><div dir="ltr"><div>-- </div><div>Jason Liu<br></div></div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jun 3, 2020 at 5:34 PM Jason Liu <<a href="mailto:jasonliu@umich.edu" target="_blank">jasonliu@umich.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Great, I'll have a look at the stuff in that area. Thanks, Chris.</div><div><br></div><div>Jason<br></div><div><br></div><div><div><div dir="ltr"><div dir="ltr"><div>-- </div><div>Jason Liu<br></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jun 3, 2020 at 2:38 PM Christopher Jones <<a href="mailto:jonesc@hep.phy.cam.ac.uk" target="_blank">jonesc@hep.phy.cam.ac.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Hi,<div><br></div><div>Sounds like this *could* be a candidate for something to add to our legacy support package. see</div><div><br></div><div><a href="https://github.com/macports/macports-legacy-support" target="_blank">https://github.com/macports/macports-legacy-support</a></div><div><br></div><div>A port for this exists in MacPorts, and is applied as required to ports that need the support layer using the legacysupport PortGroup.</div><div><br></div><div>I think if we are to have a compatibility layer, as you describe below, putting it in the same place as the above is the way to go, so please take a look and submit MRs adding what you think is needed to it.</div><div><br></div><div>Chris</div><div><br><div><blockquote type="cite"><div>On 3 Jun 2020, at 7:01 pm, Jason Liu <<a href="mailto:jasonliu@umich.edu" target="_blank">jasonliu@umich.edu</a>> wrote:</div><br><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>In my course of packaging some new ports, I've run across a couple instances of applications which are claimed by their devs to only be compatible with "macOS 10.12 and above". However, I've discovered that in reality, the only reason they're no longer compatible with older versions of macOS is because the names of a lot of constants changed in AppKit starting in 10.12. All of these constants appear to be related to either the drawing of GUI Cocoa windows or UI events (e.g. mouse down, mouse dragged, etc.).</div><div dir="ltr"><br></div><div dir="ltr">So far, I've encountered two pieces of software where this is happening: Blender and MaterialX.<br><div><br></div><div>A solution I found which some projects (e.g. Qemu) have implemented basically replaces the new AppKit constants with the old AppKit ones using <font face="monospace"><b>#define</b></font> directives if the OS version is below 10.12. I've created a separate header file that gathers together a list of the constants I've been able to find, which is modeled on information from this message:</div><div><br></div><div><a href="https://lists.gnu.org/archive/html/qemu-devel/2017-04/msg04330.html" target="_blank">https://lists.gnu.org/archive/html/qemu-devel/2017-04/msg04330.html</a><br></div><div><br></div><div>I'm doing my portfile development on a machine running 10.11, and have verified that my patch seems to allow me to build these applications without any noticeable issues (no runtime crashes, segfaults, etc.).</div><div><br></div><div>So my question to everyone is: Should I just add my header file to the <font face="monospace">files/</font> folder for whichever ports need it? Or is this something that might benefit from me creating a project in GitHub? I'm guessing that there could be other software packages which might benefit from such a compatibility layer.</div><div><div><br clear="all"><div><div dir="ltr"><div dir="ltr"><div>-- </div><div>Jason Liu</div></div></div></div></div></div></div></div></div></div>
</div></blockquote></div><br></div></div></blockquote></div>
</blockquote></div>
</div></blockquote></div><br></div></blockquote></div>
</div></blockquote></div><br></div></div></blockquote></div>