Re: Reinplace
At 3:25 PM -0400 4/2/12, Craig Treleaven wrote: At 5:14 AM +1000 4/3/12, Joshua Root wrote: On 2012-4-3 04:01 , Jeremy Lavergne wrote: Nope, none of those characters have special meanings to Tcl nor to the regular expression engine. It looks like a perfectly valid regular expression to me. Hopefully it will become clearer to me when I actually try to build the port. Please hold on. My computer is currently occupied upgrading another port. When it's done, I'll give mythtv another go. I'm wondering if ' versus " matters here. All the Tcl documentation and all our existinting replace using " Yes, that is going to be an issue. Single quotes don't mean anything special to Tcl. Braces in Tcl do what single quotes do in sh. Wait a minute. The line of code at issue is: system "find ${configure.dir} -name \"Makefile\" -exec sed -i '' 's/ -L / /g' {} \\; " If I replace the single quotes (') double-quotes ("), I would have to escape them all. Is the whole string being passed to a shell for expansion? Its not hard, so I'll try it that way... That still doesn't explain, though, why find proceeds merrily for 22 of the 78 directories and then quits without error. Yeah, exact same result with: system "find ${configure.dir} -name \"Makefile\" -exec sed -i \"\" \"s/ -L / /g\" {} \\; " Except it is harder to read! Craig ___ macports-dev mailing list macports-dev@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macports-dev
Re: Reinplace
At 5:14 AM +1000 4/3/12, Joshua Root wrote: On 2012-4-3 04:01 , Jeremy Lavergne wrote: Nope, none of those characters have special meanings to Tcl nor to the regular expression engine. It looks like a perfectly valid regular expression to me. Hopefully it will become clearer to me when I actually try to build the port. Please hold on. My computer is currently occupied upgrading another port. When it's done, I'll give mythtv another go. I'm wondering if ' versus " matters here. All the Tcl documentation and all our existinting replace using " Yes, that is going to be an issue. Single quotes don't mean anything special to Tcl. Braces in Tcl do what single quotes do in sh. Wait a minute. The line of code at issue is: system "find ${configure.dir} -name \"Makefile\" -exec sed -i '' 's/ -L / /g' {} \\; " If I replace the single quotes (') double-quotes ("), I would have to escape them all. Is the whole string being passed to a shell for expansion? Its not hard, so I'll try it that way... That still doesn't explain, though, why find proceeds merrily for 22 of the 78 directories and then quits without error. Craig ___ macports-dev mailing list macports-dev@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macports-dev
Re: Reinplace
At 12:56 PM -0500 4/2/12, Ryan Schmidt wrote: On Apr 2, 2012, at 12:39, Craig Treleaven wrote: Maybe that's the problem--it is not supposed to be a "regular expression"; it is a literal string of 'space-hyphen-capital ell-space'. Does hyphen have special meaning in a regex? Nope, none of those characters have special meanings to Tcl nor to the regular expression engine. It looks like a perfectly valid regular expression to me. Hopefully it will become clearer to me when I actually try to build the port. Please hold on. My computer is currently occupied upgrading another port. When it's done, I'll give mythtv another go. Ryan, for building, remember that you need qt-4mac +mysql +debug. Craig ___ macports-dev mailing list macports-dev@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macports-dev
Re: Traversing the source directories
At 12:17 PM -0500 4/2/12, Ryan Schmidt wrote: On Apr 1, 2012, at 20:17, Craig Treleaven wrote: http://dl.dropbox.com/u/26787680/Portfile.2012Apr01 In this email I'll offer some suggestions on how the Portfile is written. Later, I'll try to build the port, and in a second email I'll try to help you figure out why there are empty "-L" arguments and what's going wrong with your efforts to remove them. github.setupMythTV mythtv v0.25-rc-0-g92f7d1f The version number in the github.setup line should only be the version number, typically as it appears in the tag name. There should not be a "v" or other prefix, nor the git revision/branch number. The github.setup procedure accepts a fourth argument for the tag prefix, and the portgroup automatically handles the presence of the randomish branch number in the folder name. So you want simply: github.setupMythTV mythtv 0.25-rc v OK, but when I went the the MythTV GitHub page and manually downloaded the tarball: https://nodeload.github.com/MythTV/mythtv/tarball/v0.25-rc The exact file name I got was MythTV-mythtv-v0.25-rc-0-g92f7d1f.tar.gz. When I plugged that in as above, the port fetch worked. configure.args-delete "-arch i386" There is no "-arch i386" in configure.args, so this statement does nothing. configure.cflags-delete "-arch i386" configure.cflags-append "-m32" Why delete "-arch i386" and append "-m32"? Aren't those the same thing? configure.ldflags-append"-m32 -F/System/Library/Frameworks" configure.cppflags-append "-m32" configure.cxxflags-append "-m32" configure.ldflags and configure.cxxflags similarly already have "-arch i386" in them and thus shouldn't need "-m32". configure.cppflags doesn't need arch flags because the preprocessor doesn't compile anything. Sorry, we went around this last week. I'm trying to recreate a Perl-based build system (that bundles everything into an .app) and there are notes that if you want a 32 bit build, put "-m32" into those places. If I can get a working build, I'll experiment with removing it. configure.env-appendQMAKESPEC="macx-g++" \ QMAKE_LIBDIR_OPENGL="/opt/local/lib" \ Don't hardcode /opt/local; use ${prefix}. Good catch. configure.env-delete-arch i386 # messes up qmake? That's not a valid environment specifier (which would always have the form KEY=value). So I don't believe this statement does anything. If you really want MacPorts not to add the -arch flags it normally adds, clear the configure.cc_archflags configure.cxx_archflags configure.ld_archflags variables. Normally you don't want to do that. Thanks, I'll give that a go. > system "find ${configure.dir} -name \"Makefile\" -print " system "find ${configure.dir} -name \"Makefile\" -exec sed -i '' 's/ -L / /g' {} \\; " "find" can print and exec in the same invocation: system "find ${configure.dir} -name \"Makefile\" -print -exec sed -i '' 's/ -L / /g' {} \\; " BTW, I wondered if OS X's metadata update and/or DropBox were to blame. I've disabled both but no change. The last three times, it has listed exactly 22 of the directories. It appears to be going alphabetically down the root directory but I see nothing special about the next directory in the list (mythtv/filters). Craig -- -- Craig Treleaven, CA -- Clearview Consulting (905) 829-2054 ctrelea...@cogeco.ca ___ macports-dev mailing list macports-dev@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macports-dev
Re: Reinplace
At 12:31 PM -0500 4/2/12, Ryan Schmidt wrote: On Apr 1, 2012, at 08:53, Craig Treleaven wrote: At 10:20 AM -0400 3/31/12, Jeremy Lavergne wrote: > cd cd "/opt/local/var/macports/build/_Users_craigtreleaven_MacPortsTemp_Myth.25/mythtv/work/mythtv-v0.25-rc-0-g92f7d1f/mythtv" sudo find . -name "Makefile" -exec sed -i '' 's/ -L / /g' {} \; This is what MacPorts Reinplace extension is for, right? Would this be the right syntax? post-configure { reinplace 's/ -L / /g' ${worksrcpath}/Makefile } Reinplace will do a recursive search from the specified directory on down, right? reinplace will only operate on the files you give to it. You need to give it a complete list or you might use it in conjunction with fs-traverse (see `man portfile`). I'm struggling with this. Did I mention I'm new to MacPorts AND tcl? ;) What I've got so far is this: post-configure { fs-traverse myfile ${configure.dir} { if { [ file tail $myfile ] == "Makefile" } { #ui_info "Removing any spurious -L from ${myfile}" reinplace "s/ -L / /g" ${myfile} } } } The trouble is that it does the reinplace on less than half the 20 or so files that need it. Since you've subsequently noticed the same problem when running "find", I suspect your regular expression is not correct. I will try to build the port later and see if I can figure out what's going on. Maybe that's the problem--it is not supposed to be a "regular expression"; it is a literal string of 'space-hyphen-capital ell-space'. Does hyphen have special meaning in a regex? Craig ___ macports-dev mailing list macports-dev@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macports-dev
Traversing the source directories
Hi: I'm experiencing a weird error--neither fs_traverse or system "find . blah" will consistently walk through _all_ of the directories in the source of the port. Background: for reasons unknown, I'm getting Makefiles that include -L in the LIBS = line. There are 78 Makefiles and the expedient thing to do is find them all and strip out the bad bits. I ran the port configure step (this patching is done post-configure) and it took MANY tries to finally get all 78 Makefiles searched and patched. Many times, it was apparent that _some_ of the Makefiles had been patched; but not all. I thought it was my inexperience with tcl so I gave up on fs_traverse. Once or twice, it seemed "find . -name "Makefile" -exec sed -i '' 's/ -L / /g' {} \;" _also_ stopped midway but then it worked. I thought I'd found the magic formula. Shortly after I achieved my first successful build of MythTV doing it step by step. (Port fetch ... port install.) I wanted to start fresh so I uninstalled and did a port clean then kicked off a port install. The portfile and the debug log are linked below. http://dl.dropbox.com/u/26787680/Portfile.2012Apr01 http://dl.dropbox.com/u/26787680/Post_configure%20error%202012Apr01.txt The find command then quit after finding 22 of the 78 Makefiles. (Because of the problems I've been having, I print them out to the log first and then patch them all.) Of course, linking then fell over after receiving one of the blasted -Ls that it hates so much. Is it possible that some of the Makefiles are still in use/open for access when this command is running and that is causing fs_traverse and/or find to silently give up the search? Or something else? Should I do this step pre-build for some reason? Any help gratefully accepted. Craig ___ macports-dev mailing list macports-dev@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macports-dev
Re: Reinplace
At 10:20 AM -0400 3/31/12, Jeremy Lavergne wrote: > cd cd "/opt/local/var/macports/build/_Users_craigtreleaven_MacPortsTemp_Myth.25/mythtv/work/mythtv-v0.25-rc-0-g92f7d1f/mythtv" sudo find . -name "Makefile" -exec sed -i '' 's/ -L / /g' {} \; This is what MacPorts Reinplace extension is for, right? Would this be the right syntax? post-configure { reinplace 's/ -L / /g' ${worksrcpath}/Makefile } Reinplace will do a recursive search from the specified directory on down, right? reinplace will only operate on the files you give to it. You need to give it a complete list or you might use it in conjunction with fs-traverse (see `man portfile`). I'm struggling with this. Did I mention I'm new to MacPorts AND tcl? ;) What I've got so far is this: post-configure { fs-traverse myfile ${configure.dir} { if { [ file tail $myfile ] == "Makefile" } { #ui_info "Removing any spurious -L from ${myfile}" reinplace "s/ -L / /g" ${myfile} } } } The trouble is that it does the reinplace on less than half the 20 or so files that need it. BTW, in debug output, it spews the following for every file that it fixes. DEBUG: Executing proc-post-org.macports.configure-configure-0 DEBUG: euid/egid changed to: 0/0 DEBUG: chowned /opt/local/var/macports/build/_Users_craigtreleaven_MacPortsTemp_Myth.25/mythtv/work/mythtv-v0.25-rc-0-g92f7d1f/mythtv/Makefile to macports DEBUG: euid/egid changed to: 506/502 DEBUG: euid/egid changed to: 0/0 DEBUG: setting attributes on /opt/local/var/macports/build/_Users_craigtreleaven_MacPortsTemp_Myth.25/mythtv/work/mythtv-v0.25-rc-0-g92f7d1f/mythtv/Makefile DEBUG: euid/egid changed to: 506/502 DEBUG: euid/egid changed to: 0/0 DEBUG: chowned /opt/local/var/macports/build/_Users_craigtreleaven_MacPortsTemp_Myth.25/mythtv/work/mythtv-v0.25-rc-0-g92f7d1f/mythtv/bindings/perl/Makefile to macports DEBUG: euid/egid changed to: 506/502 DEBUG: euid/egid changed to: 0/0 DEBUG: setting attributes on /opt/local/var/macports/build/_Users_craigtreleaven_MacPortsTemp_Myth.25/mythtv/work/mythtv-v0.25-rc-0-g92f7d1f/mythtv/bindings/perl/Makefile DEBUG: euid/egid changed to: 506/502 I noticed the ".asroot" whatchamacallit but I don't seem to be able to add that to post-configure. Is there some way to run the whole segment with appropriate permissions? Thanks for the hand-holding! Craig ___ macports-dev mailing list macports-dev@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macports-dev
Reinplace
Hi: Sorry for all the newbie questions but could I'd appreciate some help. Ten or so of the Makefiles include extraneous " -L " flags that I need to strip out or linking fails. Manually, I did: cd cd "/opt/local/var/macports/build/_Users_craigtreleaven_MacPortsTemp_Myth.25/mythtv/work/mythtv-v0.25-rc-0-g92f7d1f/mythtv" sudo find . -name "Makefile" -exec sed -i '' 's/ -L / /g' {} \; This is what MacPorts Reinplace extension is for, right? Would this be the right syntax? post-configure { reinplace 's/ -L / /g' ${worksrcpath}/Makefile } Reinplace will do a recursive search from the specified directory on down, right? Thanks, Craig ___ macports-dev mailing list macports-dev@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macports-dev
Re: DESTDIR not supported
At 4:09 PM +1100 3/31/12, Joshua Root wrote: On 2012-3-31 09:54 , Ryan Schmidt wrote: On Mar 30, 2012, at 15:45, Craig Treleaven wrote: Well, it's been an interesting exercise getting this far and now I find out that MythTV doesn't support DESTDIR. Is there a standard approach to handling this problem? (Myth's configure is >5,000 lines; I'm concerned about trying to path it.) The MacPorts defailt is: destroot.destdir DESTDIR=${destroot} The standard is for build systems to support DESTDIR; if it doesn't, all bets are off. Most build systems still support a way to specify where to install things, for example using a PREFIX or prefix variable. If so, you can tell MacPorts something like: destroot.destdir PREFIX=${destroot}${prefix} If the build system's install target is too confused to do even that properly, then you can throw it away and write your own destroot block and do everything yourself, as Jeremy said. But I would consider that a last resort. You might also look at other distros that package MythTV; maybe one of them fixed this. It seems that INSTALL_ROOT= works but that's a good point. Do you know of another port system that use destroot or similar? I just looked and it seems FreeBSD does not. Craig ___ macports-dev mailing list macports-dev@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macports-dev
Re: DESTDIR not supported
At 5:54 PM -0500 3/30/12, Ryan Schmidt wrote: On Mar 30, 2012, at 15:45, Craig Treleaven wrote: Well, it's been an interesting exercise getting this far and now I find out that MythTV doesn't support DESTDIR. Is there a standard approach to handling this problem? (Myth's configure is >5,000 lines; I'm concerned about trying to path it.) The MacPorts defailt is: destroot.destdir DESTDIR=${destroot} The standard is for build systems to support DESTDIR; if it doesn't, all bets are off. Most build systems still support a way to specify where to install things, for example using a PREFIX or prefix variable. If so, you can tell MacPorts something like: destroot.destdir PREFIX=${destroot}${prefix} If the build system's install target is too confused to do even that properly, then you can throw it away and write your own destroot block and do everything yourself, as Jeremy said. But I would consider that a last resort. Thanks, yes, PREFIX is supported. I'll give that a go. Craig ___ macports-dev mailing list macports-dev@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macports-dev
DESTDIR not supported
Hi: Well, it's been an interesting exercise getting this far and now I find out that MythTV doesn't support DESTDIR. Is there a standard approach to handling this problem? (Myth's configure is >5,000 lines; I'm concerned about trying to path it.) Craig ___ macports-dev mailing list macports-dev@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macports-dev
Re: Help with QT-based port?
At 8:47 AM -0500 3/29/12, Ryan Schmidt wrote: On Mar 28, 2012, at 19:14, Craig Treleaven wrote: I've run into a wall trying to port MythTV. The linker barfs complaining: ld: -L must be immediately followed by a directory path (no space) Debug-level log from my most recent attempt is here: http://dl.dropbox.com/u/26787680/0.25%20macports%20build%20fail%202012Mar28.txt I do agree with the error message... the log shows these arguments being used on a g++ invocation: -L -lQtGui_debug Perhaps some directory name variable is not being set and is therefore empty. Portfile in development* is here: http://dl.dropbox.com/u/26787680/Portfile fetch.type git git.branch 92f7d1f51c Does the 0.25-rc tarball posted on github not work? This is hundreds of MB and takes a long time to fetch, which happens every time I clean and try again, which is something I do often when troubleshooting and/or developing a port, which makes it hard to work on the port. Sorry, I'm branch new to developing a port. Exactly, what should I do to use the tarball? I agree that the git clone is quite slow. license GPL Can you be more specific about what version(s) of the GPL? Need to research this. First, though, I want to get a working build! ;) maintainers ctreleaven openmaintainer Since you are not a committer, the maintainers line should contain your actual (obfuscated) email address: maintainers cogeco.ca:ctreleaven openmaintainer Noted, thanks. pre-configure { append worksrcpath "/mythtv" } This is an odd way of setting worksrcpath, and fails if you ask MacPorts to break the installation into separate steps, as in: $ cd mythtv $ sudo port configure $ sudo port build So you simply want: worksrcdir ${name}-${version}/mythtv Will correct. You'll also want to remove the version line; the github.setup line sets the version for you. configure.env-appendMACOSX_DEPLOYMENT_TARGET="10.5" \ CFLAGS="-m32" \ CPPFLAGS="-m32" \ CXXFLAGS="-m32" \ LDFLAGS="-m32 -F/System/Library/Frameworks -L/usr/lib -L${prefix}/lib" \ ECXXFLAGS="-m32" I wouldn't think you'd need to specify -m32 everywhere, since MacPorts already sets -arch i386 everywhere for you, which should be the same thing. I'm copying the existing build processes. Eventually, I want to install some optional Perl and Python dependencies and I believe one of them fails in a 64 bit environment. If I can get 32 bit working, I'll go on and try 64 bit. Note that MacPorts has special variables for most of these env vars, which you should set or append to, instead of manually appending to the environment: macosx_deployment_target configure.cflags configure.cppflags configure.cxxflags configure.ldflags Found those later, I'll change. I'm surprised you need to specify -L/usr/lib, since /usr/lib is a standard library directory that should be searched anyway. Or are you just trying to force that /usr/lib is searched before ${prefix}/lib? If so, I'd be curious to know why, since that's the opposite of what we usually want. Ignorance on my part. I'll fix. It is a problem that the port is building using "gcc" and "g++"; see: https://trac.macports.org/wiki/UsingTheRightCompiler Sorry, I've read the page but I don't understand the problem. My output includes the following: CXX='ccache /usr/bin/g++-4.2' CC='ccache /usr/bin/gcc-4.2' Is this a problem? It appears to be compiling its own version of libavcodec. The version that the ffmpeg port provides is not sufficient? Correct. Myth compiles its own version of ffmpeg because there is too much variability in arguments that various versions of ffmpeg accept. For each major MythTV version, they resync ffmpeg. See output of "port lint --nitpick" for some whitespace nits. Will do. Finally, I fail with: dvdnav/dvdnav.c: In function 'dvdnav_open': dvdnav/dvdnav.c:79: error: 'DVDNAV_SVN_REV' undeclared (first use in this function) dvdnav/dvdnav.c:79: error: (Each undeclared identifier is reported only once dvdnav/dvdnav.c:79: error: for each function it appears in.) Strange. *Needs qt4-mac +mysql5. Takes 1 hour plus to build the dependencies on my quad-core MBP. Admittedly I have not done this yet. Guess I'd better get started. In specifying the port dependency, how does one check that a particular variant is present? Also, some more searching suggests that qt ver 4.6.3 might work where the default 4.7.4 doesn't. How does one get a list of the versions of a port that may be installed? Many thanks for
Help with QT-based port?
Hi: I've run into a wall trying to port MythTV. The linker barfs complaining: ld: -L must be immediately followed by a directory path (no space) Debug-level log from my most recent attempt is here: http://dl.dropbox.com/u/26787680/0.25%20macports%20build%20fail%202012Mar28.txt Portfile in development* is here: http://dl.dropbox.com/u/26787680/Portfile There are currently two building systems for Myth on Mac. First, a perl script has been in place for several years and is regularly maintained by the Myth devs. See oxs-packager.pl at: https://github.com/MythTV/packaging/tree/master/OSX/build Second, Myth also has a buildbot network set up including a Mac OS X slave. See: http://code.mythtv.org/buildbot/builders/master-osx-snow-leopard The buildbot shows quite clearly the environment variables and parameters passed to mythtv/config. Both systems build using the MythTV code straight from GitHub--no patching. I've spent a lot of time poring over that and the osx-packager.pl script but I can't come up with a combination of parameters that ends up with a happy linker. Myth uses Nokia's QT stuff so qmake is getting called in there. One difference is that both the buildbot and osx-packager.pl are using QT 4.6.3 whereas I've used MacPorts qt4-mac which is at 4.7.4. Could this be my problem? I've asked for help on the MythTV-dev list but the most active contributor to the Mac port is busy on other things and unwilling to spend any time on this. Any suggestions gratefully welcomed! Thanks, Craig *Needs qt4-mac +mysql5. Takes 1 hour plus to build the dependencies on my quad-core MBP. ___ macports-dev mailing list macports-dev@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macports-dev
Re: MythTV port?
At 6:46 AM -0700 3/23/12, Bradley Giesbrecht wrote: On Mar 22, 2012, at 6:10 PM, Craig Treleaven wrote: > I'm going to *attempt* to be a maintainer--I'm very worried that I'm biting off far more than I can chew. If you are not familiar with MacPorts, start simple and build the port in phases. https://trac.macports.org/wiki/CommittersTipsAndTricks#TestingPortPhases http://guide.macports.org/#reference.phases You can work on anywhere convienent if you execute the port commands from within the directory. Create a directory somewhere named MythTV: $ mkdir ~/Desktop/MythTV $ cd ~/Desktop/MythTV $ touch Portfile Edit Portfile adding items 1 thru 13 here: http://guide.macports.org/#development.introduction Then test the fetch phase: $ sudo port -v fetch Continue on to patch etc... Thanks, I appreciate the pointers. I take it that it is not necessary to use SVN, at least to begin with? BTW, your last comment is about patching--if that is necessary, this is over! ;) But I know the code builds on OS X so I hope it is just a case of getting the right configure flags, etc. Craig ___ macports-dev mailing list macports-dev@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macports-dev