<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Thanks Joshua. </div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
I have never seen "<span style="font-family:"Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, "system-ui", Roboto, "Helvetica Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, 255);display:inline !important">-Xarch" before
in a Makefile. That looks like very simple and elegant way to address the issue. I will give it a shot. I will be able to easily verify that it works because Intel builds will fail <span style="background-color:rgb(255, 255, 255);display:inline !important">with
following error</span> if CFLAGS contains the -faltivec flag:</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<span style="font-family:"Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, "system-ui", Roboto, "Helvetica Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, 255);display:inline !important"><br>
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<span style="font-family:"Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, "system-ui", Roboto, "Helvetica Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, 255);display:inline !important">
<p class="p1 elementToProof" style="margin:0px 0px 0px 12px;text-indent:-12px;font:11px Menlo">
</p>
<blockquote style="margin-top:0;margin-bottom:0">
<div><span style="font-size: 11pt;">clang: error: invalid argument '-faltivec' only allowed with 'ppc/ppc64'</span></div>
</blockquote>
<p></p>
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<span style="font-family:"Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, "system-ui", Roboto, "Helvetica Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, 255);display:inline !important"><br>
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<span style="font-family:"Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, "system-ui", Roboto, "Helvetica Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, 255);display:inline !important">I am glad to hear that I can
use conditional expressions in my Portfiles, if need be. It looks like I will need to brush up on my Tcl.</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<span style="font-family:"Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, "system-ui", Roboto, "Helvetica Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, 255);display:inline !important"><br>
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<span style="font-family:"Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, "system-ui", Roboto, "Helvetica Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, 255);display:inline !important">Thanks again,</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<span style="font-family:"Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, "system-ui", Roboto, "Helvetica Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, 255);display:inline !important"><br>
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<div>Rob</div>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Joshua Root <jmr@macports.org><br>
<b>Sent:</b> July 31, 2022 9:38 PM<br>
<b>To:</b> Robert Kennedy <amtor@hotmail.com><br>
<b>Cc:</b> MacPorts Development <macports-dev@lists.macports.org><br>
<b>Subject:</b> Re: Help with New Port - M2VDownsizer</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">On 2022-8-1 10:11 , Robert Kennedy wrote:<br>
> Hello everyone!<br>
> <br>
> I am working on a new port, M2VDownzsizer, which is a sister port to the <br>
> recent existing port, M2VRequantiser. Both ports are command line <br>
> programs that shrink MPEG-2 video and are commonly used when shrinking <br>
> a DVD-9 video disc to fit onto a much more affordable DVD-5 writable disc.<br>
> <br>
> M2VDownsizer was released as an open source project many years ago and <br>
> was developed as an old XCode project for Macs running PowerPC and Intel <br>
> 32 bit. The code is quite old.<br>
> <br>
> I have converted the project from an XCode project to a much simpler <br>
> project using a Makefile. I have also hacked and updated the code so it <br>
> will run on modern compilers. I also eliminated the need to compile the <br>
> very old libraries in the source code by linking to much more up to date <br>
> libraries available in Macports. I have even written a man page! <br>
> M2VDownsizer appears to run just fine on more modern Macs!<br>
> <br>
> Now my challenge is creating a Portfile! I have a couple of questions:<br>
> <br>
> 1. How do I tell Macports to copy my Makefile (which I will place in<br>
> the Files directory along with my source code patches) into my<br>
> working directory before building? (The original source never had a<br>
> Makefile so there is nothing to patch). P.S. I could always create<br>
> my own GitHub project and download the source (with the Makefile)<br>
> from there.<br>
<br>
post-extract {<br>
copy ${filespath}/Makefile ${worksrcpath}<br>
}<br>
<br>
> 2. How do I tell Macports to include the -faltivec flag in CFLAGS but<br>
> only when a ppc build is being done? I have the following in my<br>
> Makefile but I suspect it would be much better to address this issue<br>
> in the Portfile in case an Intel Mac is trying to build a ppc/x86<br>
> FAT binary:<br>
> <br>
> ifeq ($(findstring ppc, $(UNAME_P)), ppc)<br>
> CFLAGS += -faltivec<br>
> CXXFLAGS += -flativec<br>
> endif<br>
<br>
You could instead do:<br>
CFLAGS += -Xarch_ppc -faltivec<br>
CXXFLAGS += -Xarch_ppc -faltivec<br>
<br>
That will apply -faltivec only when building for ppc.<br>
<br>
> 3. Is there anything like an "if-then-else" statement in Portfiles?<br>
<br>
Yes, Portfiles are written in Tcl and can use all Tcl's control flow <br>
mechanisms.<br>
<br>
- Josh<br>
</div>
</span></font></div>
</body>
</html>