[MacPorts] #40631: blockout2 @2.4_0
#40631: blockout2 @2.4_0 ------------------------+-------------------------------- Reporter: jeremy@… | Owner: macports-tickets@… Type: submission | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.0 Keywords: | Port: ------------------------+-------------------------------- Hello, I have ported this GPL game: http://www.blockout.net/blockout2/ The source is from the linux version: http://sourceforge.net/projects/blockout/files/blockout/BlockOut%202.4/ Best Regards, Jeremy -- Ticket URL: <https://trac.macports.org/ticket/40631> MacPorts <http://www.macports.org/> Ports system for OS X
#40631: blockout2 @2.4_0 -------------------------+-------------------------------- Reporter: jeremy@… | Owner: macports-tickets@… Type: submission | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.0 Resolution: | Keywords: Port: | -------------------------+-------------------------------- Comment (by ryandesign@…): Thanks. Some initial observations: * The portfile uses a mixture of tabs and spaces. Portfiles should use only spaces, as the modeline states. * The distfile name doesn't contain the version number, so the dist_subdir should; see wiki:PortfileRecipes#unversioned-distfiles * I'm worried about the post-extract phase which replaces the Makefile. Could the Makefile be patched instead? * The app.executable line could be simplified by using the ${worksrcpath} variable instead of ${workpath} * The declared universal variant doesn't do anything. -- Ticket URL: <https://trac.macports.org/ticket/40631#comment:1> MacPorts <http://www.macports.org/> Ports system for OS X
#40631: blockout2 @2.4_0 -------------------------+-------------------------- Reporter: jeremy@… | Owner: ryandesign@… Type: submission | Status: assigned Priority: Normal | Milestone: Component: ports | Version: 2.2.0 Resolution: | Keywords: Port: blockout2 | -------------------------+-------------------------- Changes (by ryandesign@…): * status: new => assigned * owner: macports-tickets@… => ryandesign@… * port: => blockout2 Comment: Replying to [comment:1 ryandesign@…]:
* The distfile name doesn't contain the version number, so the dist_subdir should; see wiki:PortfileRecipes#unversioned-distfiles
On second thought I see it does contain the version number, they've just removed the period ("bl24"); in that case you may want to compute that instead of repeating it throughout the Portfile. Also, there are a great many patches. Have the issues you're patching been reported to the developers already? We would prefer not to have to maintain these patches in MacPorts forever. However I see this version is from January 2008, so perhaps the project is dead and there won't be any future versions anyway. -- Ticket URL: <https://trac.macports.org/ticket/40631#comment:2> MacPorts <http://www.macports.org/> Ports system for OS X
#40631: blockout2 @2.4_0 -------------------------+-------------------------- Reporter: jeremy@… | Owner: ryandesign@… Type: submission | Status: assigned Priority: Normal | Milestone: Component: ports | Version: 2.2.0 Resolution: | Keywords: Port: blockout2 | -------------------------+-------------------------- Comment (by ryandesign@…): Replying to [comment:1 ryandesign@…]:
* I'm worried about the post-extract phase which replaces the Makefile. Could the Makefile be patched instead?
Never mind, I see there was no top-level Makefile before. -- Ticket URL: <https://trac.macports.org/ticket/40631#comment:3> MacPorts <http://www.macports.org/> Ports system for OS X
#40631: blockout2 @2.4_0 -------------------------+-------------------------- Reporter: jeremy@… | Owner: ryandesign@… Type: submission | Status: assigned Priority: Normal | Milestone: Component: ports | Version: 2.2.0 Resolution: | Keywords: Port: blockout2 | -------------------------+-------------------------- Comment (by ryandesign@…): I notice that in BlockOut/Makefile you remove `-Dlinux` from CXXFLAGS but in ImageLib/src/Makefile you leave it in place. Is this significant? -- Ticket URL: <https://trac.macports.org/ticket/40631#comment:4> MacPorts <http://www.macports.org/> Ports system for OS X
#40631: blockout2 @2.4_0 -------------------------+-------------------------- Reporter: jeremy@… | Owner: ryandesign@… Type: submission | Status: assigned Priority: Normal | Milestone: Component: ports | Version: 2.2.0 Resolution: | Keywords: Port: blockout2 | -------------------------+-------------------------- Comment (by ryandesign@…): I committed the port in r111727 with these further changes: * Changed license to "GPL-2+". * Passed CC and CXX variables at build time to ensure we're UsingTheRightCompiler and `-arch` flags. * Fixed universal variant by patching ImageLib/src/Makefile to pass `-s` flag when invoking `ar`. * Fixed capitalization of BlockOut in top-level Makefile to avoid build failure on case-sensitive systems (like our buildbots). * Changed app.name to "BlockOut II" to match project's preferred name. * Changed app.executable to point to the installed binary so that we don't install the same binary twice. * Changed "/opt/local" to "@PREFIX@" in BlockOut/Utils.cpp to make it clear it's a placeholder. * Changed "/opt/local" to "$(PREFIX)" in Makefiles and added "PREFIX=${prefix}" to build.args and destroot.args. * It ended up linking with the MacPorts OpenGL libraries from the mesa port, not the system's OpenGL framework, so I changed the patch and dependencies. * libsdl_image doesn't appear to be used so I removed it from the dependencies. However, it doesn't run properly. It starts up and plays some sounds, but its window contains a scramble of artifacts from my other open windows. Do you see this on your system with the version I committed as well? If so, perhaps the problem relates to mesa OpenGL. -- Ticket URL: <https://trac.macports.org/ticket/40631#comment:5> MacPorts <http://www.macports.org/> Ports system for OS X
#40631: blockout2 @2.4_0 -------------------------+-------------------------- Reporter: jeremy@… | Owner: ryandesign@… Type: submission | Status: assigned Priority: Normal | Milestone: Component: ports | Version: 2.2.0 Resolution: | Keywords: Port: blockout2 | -------------------------+-------------------------- Comment (by jeremy@…): Hi Ryan, I was able to reproduce the problem you found: it was because of the mesa OpenGL as you suspected. Turns out the correct way to build against OpenGL is to use the "-Wl,-framework,OpenGL" flag. (It was working on my machine because I didn't have any conflicting OpenGL libs to pick up.) Once that change is made, the Portfile doesn't need the mesa dependence. So I'll attach the new Portfile and patch-BlockOut-Makefile.diff to this ticket. RE: your other comments: Sorry about the tabs in the Portfile - I was using vim to edit it so I assumed the modeline at the top had instructed vim the expand tabs. I don't know what to do about the universal variant (this is my first MacPorts port) - I was just copying the example Portfile I think. Leaving the -Dlinux was an oversight and should be removed (assuming it doesn't break things). As you say, the developer hasn't updated the app in many years so I don't expect active support. However, I will submit the fixes to the developer - perhaps having his game ported to OSX will revive some interest. Thanks for all the other fixes to the Portfile - as I said this is my first port. Cheers, Jeremy -- Ticket URL: <https://trac.macports.org/ticket/40631#comment:6> MacPorts <http://www.macports.org/> Ports system for OS X
#40631: blockout2 @2.4_0 -------------------------+-------------------------- Reporter: jeremy@… | Owner: ryandesign@… Type: submission | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.2.0 Resolution: fixed | Keywords: Port: blockout2 | -------------------------+-------------------------- Changes (by ryandesign@…): * status: assigned => closed * resolution: => fixed Comment: r111762 -- Ticket URL: <https://trac.macports.org/ticket/40631#comment:7> MacPorts <http://www.macports.org/> Ports system for OS X
#40631: blockout2 @2.4_0 -------------------------+-------------------------- Reporter: jeremy@… | Owner: ryandesign@… Type: submission | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.2.0 Resolution: fixed | Keywords: Port: blockout2 | -------------------------+-------------------------- Comment (by ryandesign@…): Replying to [comment:6 jeremy@…]:
I don't know what to do about the universal variant (this is my first MacPorts port) - I was just copying the example Portfile I think.
I already fixed the universal variant in r111727. The key, for build systems like blockout2's that do not regard CFLAGS etc. at configure time, is to manually get the right `-arch` flags and supply them to the build system in the right place. In this port, I chose to add the `-arch` flags to the CC and CXX environment variables, and I got the correct `-arch` flags using the `[get_canonical_archflags]` procedure. This procedure returns the correct `-arch` flags depending on whether the universal variant was selected or not -- but only if a universal variant -- even an empty one -- is defined before it is used. That is why you sometimes see "`variant universal {}`" in some ports, and indeed why it is present and needed in blockout2 now.
Leaving the -Dlinux was an oversight and should be removed (assuming it doesn't break things).
As far as I can tell the build system doesn't use this variable at all so leaving it or taking it out should have no effect, so it's simpler to not change it. -- Ticket URL: <https://trac.macports.org/ticket/40631#comment:8> MacPorts <http://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts