#17342 closed submission (fixed)
MacPorts - new port - shells/osh
Reported by: | jan+mp@… | Owned by: | macports-tickets@… |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 1.6.0 |
Keywords: | Cc: | ||
Port: | osh |
Description
Hello,
I have attached a working Portfile for shells/osh. I am the upstream developer/maintainer of this software. I have been using it on Mac OS X since 2005.
NOTE: Manually, it has no problem building as a universal binary, but I did not see an evident way to make this happen from the Portfile. This software does not use configure, just make and make install. -- J.A. Neitzel
Attachments (7)
Change History (24)
comment:1 Changed 16 years ago by jan+mp@…
Cc: | jan+mp@… added |
---|
comment:2 follow-up: 3 Changed 16 years ago by blb@…
Port: | osh added |
---|
With configure-based software, the universal variant usually comes free. However, if you aren't using configure you'll need to define it manually:
variant universal { steps to enable universal build here }
See zip or class-dump for a couple of examples.
comment:3 follow-up: 4 Changed 16 years ago by jan+mp@…
Thanks a lot for that info! I attached an updated Portfile. Now, it allows both native and universal (+universal) builds. I had to add:
INSTALL=${configure.install}
... to destroot.args because it seems adding the universal variant and something to do w/ configure.* stepped on INSTALL.
This caused destroot to fail because all attempted invocations of /usr/bin/install resulted in a not found error. Looks like INSTALL was equivalent to the empty string or NULL or something.
Anyway, it works now. Is there anything else I need to know? I am certainly open to suggestions. -- J.A. Neitzel
comment:4 Changed 16 years ago by jan+mp@…
Oh, environment variables ... configure/build sounds very similar to the problem I noticed w/ INSTALL. I suppose it could be related, but I do not know enough about the inner workings of MacPorts and/or TCL to say more.
So, adding INSTALL=${configure.install} to destroot.args seems reasonable in this case. But I am willing to be wrong of course ;)
comment:5 follow-up: 6 Changed 16 years ago by blb@…
It definitely looks like the Tcl env bug to me, as I removed the INSTALL=... here and had no problems building with and without +universal, on a trunk-based MacPorts.
It appears that destroot fails to work but doesn't return a non-zero exit status, so when using MacPorts 1.6 odd things will probably happen. In that case we should probably leave the INSTALL=... stuff in there just to work around the bug, with a comment that it can be removed after 1.7 is released.
Other than that, the epoch line can be removed as it defaults to 0 when not present, which is fine.
So if the removal of epoch and a comment about INSTALL is okay, I can add the port?
comment:6 follow-up: 7 Changed 16 years ago by jan+mp@…
In that case we should probably leave the INSTALL=... stuff in there just to work around the bug, with a comment that it can be removed after 1.7 is released.
OK, comment added.
... the epoch line can be removed as it defaults to 0 when not present, which is fine.
OK, epoch removed.
So if the removal of epoch and a comment about INSTALL is okay, I can add the port?
Well, I noticed and fixed another problem. It was related to build.args. Something was happening to PREFIX=... in the shuffle. This in turn caused SYSCONFDIR in the Makefile to revert to its default value of /usr/local/etc instead of the intended value of /opt/local/etc.
Thus, I replaced build.args w/ configure.pre_args. I have attached the new Portfile. This time I have covered all the bases. Testing shows everything referring to the appropriate file system locations.
If it all looks good to you, please do add the port at your convenience. Feel free to modify my INSTALL=... comment if it does not sound kosher to you. -- J.A. Neitzel
Changed 16 years ago by jan+mp@…
comment:7 Changed 16 years ago by jan+mp@…
Well, I noticed and fixed another problem. It was related to build.args. Thus, I replaced build.args w/ configure.pre_args.
This actually makes sense given that configure.cmd is equal to ${build.cmd} in this case. In effect, making build == configure turns the build phase into a no-op as as `make all' has already been performed in the configure phase.
In any case, what else needs to happen to add the port? Please let me know as time permits.
comment:8 follow-up: 9 Changed 16 years ago by blb@…
Hmm, a trunk-based MacPorts (what will be 1.7) doesn't like INSTALL being set in destroot.args but env works fine. Also, since you aren't really doing any configure steps, how about not having configure at all and moving the build stuff to just the build phase, as it does appear to simplify things a bit. Will attach what I'm thinking about, let me know.
Changed 16 years ago by jan+mp@…
Attachment: | Portfile.jan added |
---|
Changed 16 years ago by jan+mp@…
Attachment: | jan_install_osh.log added |
---|
Changed 16 years ago by jan+mp@…
Attachment: | jan_install_osh_universal.log added |
---|
comment:9 follow-ups: 10 11 Changed 16 years ago by jan+mp@…
Hmm, a trunk-based MacPorts (what will be 1.7) doesn't like INSTALL being set in destroot.args but env works fine.
Both work fine in 1.6. So, let's use the env version to cover both. Thus, the destroot phase is OK.
... how about not having configure at all and moving the build stuff to just the build phase, as it does appear to simplify things a bit.
I agree, but there is one catch.
build.args PREFIX=${prefix}
... At least in 1.6, build phase PREFIX=... gets overwritten by the +universal build.args when doing a
port install osh +universal
... Using build.pre_args globally avoids this conflict. To have a valid osh installation, PREFIX and SYSCONFDIR cannot get lost in the build phase. I have attached Portfile.jan with this fix.
Native (non-universal) installation example and results follow (debug log attached).
% sudo fd2 port -d install osh > jan_install_osh.log % port installed osh The following ports are currently installed: osh @20081122_0 (active) % file /opt/local/bin/osh /opt/local/bin/osh: Mach-O executable i386 % strings /opt/local/bin/osh | grep /opt/local/etc /opt/local/etc/osh.logout /opt/local/etc/osh.oshrc /opt/local/etc/osh.login
Universal installation example and results follow (debug log attached).
% sudo fd2 port -d install osh +universal > jan_install_osh_universal.log % port installed osh The following ports are currently installed: osh @20081122_0+universal (active) % file /opt/local/bin/osh /opt/local/bin/osh: Mach-O universal binary with 2 architectures /opt/local/bin/osh (for architecture i386): Mach-O executable i386 /opt/local/bin/osh (for architecture ppc7400): Mach-O executable ppc % strings /opt/local/bin/osh | grep /opt/local/etc /opt/local/etc/osh.login /opt/local/etc/osh.oshrc /opt/local/etc/osh.logout
Before fixing w/ build.pre_args, the output from grep was zero length w/ an exit status of 1.
comment:10 Changed 16 years ago by jan+mp@…
And for some finishing touches, I added a post-destroot to install some important docs from the osh sources. E.g., all but one of the [A-Z][A-Z]* files. Portfile.jan1 attached.
Changed 16 years ago by jan+mp@…
Attachment: | Portfile.jan1 added |
---|
comment:11 follow-up: 12 Changed 16 years ago by blb@…
Replying to jan+mp@…:
At least in 1.6, build phase PREFIX=... gets overwritten by the +universal build.args when doing a
Ah, missed that somehow, must have been too quick when testing...a cleaner solutions is to use build.args-append
in the universal variant so build.args can still be used in both places.
build.args ${build.target} PREFIX=${prefix} ... variant universal { build.args-append CFLAGS="${configure.universal_cflags}" LDFLAGS="${configure.universal_ldflags}"
comment:12 follow-up: 13 Changed 16 years ago by jan+mp@…
Replying to blb@…:
Ah, missed that somehow, must have been too quick when testing...a cleaner solutions is to use
build.args-append
in the universal variant so build.args can still be used in both places.
OK, I updated Portfile.jan2 according to your suggestion and attached it.
Thanks blb for all your help with this. The port can be added now if you agree that it is ready.
Changed 16 years ago by jan+mp@…
Attachment: | Portfile.jan2 added |
---|
comment:13 Changed 16 years ago by jan+mp@…
Oh, I forgot to say... I tested the updated Portfile.jan2 by using the same procedures as before and got the expected results.
comment:14 Changed 16 years ago by blb@…
Resolution: | → fixed |
---|---|
Status: | new → closed |
Looks good, added in r42556; thanks.
comment:16 Changed 16 years ago by jmroot (Joshua Root)
Type: | enhancement → submission |
---|
comment:17 Changed 16 years ago by (none)
Milestone: | Port Submissions |
---|
Milestone Port Submissions deleted
Cc Me!