Homebrew / legacy-homebrew

💀 The former home of Homebrew/homebrew (deprecated)
https://brew.sh
27.02k stars 11.37k forks source link

gnu-barcode failed to build on OSX 10.10.3 (sort of) #41115

Closed jcavalieri closed 8 years ago

jcavalieri commented 9 years ago

Hi Hombrew folks,

First thanks for making my life easier, brew rocks.

I'm trying to update the gnu-barcode formula locally to this (with the intention of creating a PR): https://gist.github.com/jcavalieri/2eff1c5237f8ef8f90f5

Quite simply I bumped up the version number from .98 to .99 (and aslo generated a new sha256 hash).

The reason I want to use this version is because .99 includes support for writing out barcodes as SVG (as oppose to just PS, EPS, and PDF).

However (sadpanda) I am getting a build error:

ld: 12 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [barcode] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

FYI I believe I have the latest XCode and CMT (version 6.3.2). I've also ran brew update and brew doctor.

Here is the gist log: https://gist.github.com/1e77fb27a639269cecf0

I'd appreciate any advice on how to fix the problem or investigate it further.

Thanks, John

jcavalieri commented 9 years ago

This looks like the root of the issue:

duplicate symbol _streaming in:
    ./.libs/libbarcode.a(library.o)
    ./.libs/libbarcode.a(ean.o)
duplicate symbol _streaming in:
    ./.libs/libbarcode.a(library.o)
    ./.libs/libbarcode.a(code128.o)
duplicate symbol _streaming in:
    ./.libs/libbarcode.a(library.o)
    ./.libs/libbarcode.a(code39.o)
duplicate symbol _streaming in:
    ./.libs/libbarcode.a(library.o)
    ./.libs/libbarcode.a(code93.o)
duplicate symbol _streaming in:
    ./.libs/libbarcode.a(library.o)
    ./.libs/libbarcode.a(i25.o)
duplicate symbol _streaming in:
    ./.libs/libbarcode.a(library.o)
    ./.libs/libbarcode.a(msi.o)
duplicate symbol _streaming in:
    ./.libs/libbarcode.a(library.o)
    ./.libs/libbarcode.a(plessey.o)
duplicate symbol _streaming in:
    ./.libs/libbarcode.a(library.o)
    ./.libs/libbarcode.a(codabar.o)
duplicate symbol _streaming in:
    ./.libs/libbarcode.a(library.o)
    ./.libs/libbarcode.a(ps.o)
duplicate symbol _streaming in:
    ./.libs/libbarcode.a(library.o)
    ./.libs/libbarcode.a(svg.o)
duplicate symbol _streaming in:
    ./.libs/libbarcode.a(library.o)
    ./.libs/libbarcode.a(pcl.o)
duplicate symbol _streaming in:
    ./.libs/libbarcode.a(library.o)
    ./.libs/libbarcode.a(code11.o)
ld: 12 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
jacknagel commented 9 years ago

This is a known issue, and why we haven't updated the formula. See https://github.com/Homebrew/homebrew/pull/29920#issuecomment-45831151

jcavalieri commented 9 years ago

ahh, okay

I don't think it was reported upstream to the gnu team I don't see it on the mailing list. I'll make a post there.

jcavalieri commented 9 years ago

I've sent an email out the gnu barcode mailing list. I'll report back when I hear something.

jcavalieri commented 9 years ago

I did get a response from one of the maintainers who doesn't own a mac. He wasn't aware of the issue and said he would be willing to accept a patch. I'll see if I can get something working.

jcavalieri commented 9 years ago

Oh and I posted to their mailing list. I haven't heard anything yet. http://lists.gnu.org/archive/html/bug-barcode/2015-06/msg00000.html

jcavalieri commented 9 years ago

I passed a patch along. It was just an int/extern int issue.

Also, @jacknagel what you said about passing ac_cv_func_calloc_0_nonnull=yes to configure worked.

E.g., ./configure ac_cv_func_calloc_0_nonnull=yes; make; make install

I'll let you know when I hear an update.

-John

jcavalieri commented 8 years ago

Another update. I got word that the patch will be rolled into a release in about a month or two.

dunn commented 8 years ago

Great! If you don't want to wait to update the formula, you can add the patch to the formula, with an explanation of what it does (and when it should be removed) and a link to the relevant mailing list archives.

jcavalieri commented 8 years ago

That's an excellent idea! I'll do that when I get a chance.

jcavalieri commented 8 years ago

sorry for the delay, working on this now

jcavalieri commented 8 years ago

Alrighty, here is the PR https://github.com/Homebrew/homebrew/pull/43008

tested locally

Pretty simple, fixes their bad extern int that Clang complains about, and adds the compile command mentioned earlier in the thread.

bacrossland commented 8 years ago

:+1: