Ticket #11747 (closed enhancement: fixed)
make 'file' universal-aware
| Reported by: | pipping@… | Owned by: | macports-tickets@… |
|---|---|---|---|
| Priority: | Low | Milestone: | |
| Component: | ports | Version: | |
| Keywords: | universal | Cc: | jay-macports@…, ryandesign@… |
| Port: | file |
Description
I've been working on making file universal-aware, by modifying Apple's patches for 4.10 to match 4.20.
Anyway, rather than throwing what I've got so far into the trash, I'm posting it here.
Attachments
Change History
Changed 6 years ago by pipping@…
- Attachment file-4.10_outdated-but-working added
patch to apply the official patches to 4.10 - working but no different to what comes with the system
comment:1 Changed 6 years ago by pipping@…
note that 'file-4.10_outdated-but-working' requires the trunk to work.
comment:2 Changed 6 years ago by nox@…
- Priority changed from Nice to have to Low
- Type changed from task to enhancement
- Summary changed from TASK: make 'file' universal-aware to make 'file' universal-aware
comment:3 Changed 4 years ago by blb@…
- Keywords file removed
- Cc jay-macports@… added
- Port set to file
comment:4 Changed 4 years ago by jay-macports@…
Good timing; I tried to upload the updates for file-5.00 the other day, but trac was misbehaving. I'm happy to roll in these patches, but I can't tell from just the patches what "universal aware" means, and how I'd know if port now works that way out of the box.. - any pointers?
comment:5 Changed 4 years ago by blb@…
It looks like pipping had started to port Apple's patches for file to 4.20 (which was probably current at the time); these patches add the ability to file to better detect universally-compiled programs/libraries. For example:
$ file /bin/ls /bin/ls: Mach-O universal binary with 2 architectures /bin/ls (for architecture i386): Mach-O executable i386 /bin/ls (for architecture ppc7400): Mach-O executable ppc $ gfile /bin/ls /bin/ls: Mach-O fat file with 2 architectures
Of course since the patches are incomplete (and probably won't apply to 5.00 as cleanly), you don't have to try to implement them.
comment:6 follow-up: ↓ 11 Changed 4 years ago by jay-macports@…
Ohhh, OK. It's nothing to do with a +universal variant; it's getting file to understand universal-format binaries.
Magic's been completely changed for file-5.00, as I understand it, but I'll take a look, and get some help from the file devs.
comment:7 Changed 4 years ago by anonymous
- Milestone Port Enhancements deleted
Milestone Port Enhancements deleted
comment:8 Changed 3 years ago by ryandesign@…
- Cc ryandesign@… added
I've got an idea. Why doesn't Apple submit their patches to the developers of the "file" program for inclusion in their master sources, so that neither Apple nor MacPorts has to have their own patchfiles.
comment:11 in reply to: ↑ 6 Changed 3 years ago by ryandesign@…
Replying to jay-macports@…:
Ohhh, OK. It's nothing to do with a +universal variant;
FYI, I reenabled the standard universal variant in r65382. It was disabled in r43943 because it apparently failed at that time, but now it seems to work fine for me, at least on Snow Leopard.
comment:12 Changed 4 weeks ago by ryandesign@…
- Status changed from new to closed
- Resolution set to fixed
I reported the problem to the developers of file: http://bugs.gw.com/view.php?id=211 and the current version now correctly identifies the architectures in a universal file:
$ port -v installed file The following ports are currently installed: file @5.14_0+universal (active) platform='darwin 12' archs='i386 x86_64' $ /opt/local/bin/file /opt/local/bin/file /opt/local/bin/file: Mach-O universal binary with 2 architectures: [x86_64: Mach-O 64-bit x86_64 executable] [i386: Mach-O i386 executable]

