#264 Please create SONAME library

closed-fixed
Jim Pattee
None
7
2015-01-03
2014-01-17
Thomas Spura
No

codeblocks currently bundles astyle, which is forbidden in Fedora. As part of the unbundling process, it would be great to have a astyle library with a SONAME.

Could you please provide a astyle library with SONAME?

See these bugs as references:
- https://bugzilla.redhat.com/show_bug.cgi?id=1050825
- https://bugzilla.redhat.com/show_bug.cgi?id=1054422

Discussion

  • Jim Pattee
    Jim Pattee
    2014-04-17

    The CodeBlocks website has a binary install for Fedora. It looks like it may use different compile options than the Debian install.

    Won't this work? Or do I not understand the problem?

     
  • Thomas Spura
    Thomas Spura
    2014-04-22

    CodeBlocks must be build inside the Fedora build system, if it should be installable right out of the box from the package manager. In order to unbundle astyle from there, we create a shared library of astyle as:

    g++ $RPM_OPT_FLAGS -fPIC -c ASBeautifier.cpp ASEnhancer.cpp ASFormatter.cpp ASResource.cpp
    g++ -shared -o libastyle-%{version}.so *.o -Wl,-soname,libastyle-%{version}.so
    ln -s libastyle-%{version}.so libastyle.so
    g++ $RPM_OPT_FLAGS -c ASLocalizer.cpp astyle_main.cpp
    g++ $RPM_OPT_FLAGS -o astyle ASLocalizer.o astyle_main.o -L. -lastyle
    

    And install it with:

    mkdir -p $RPM_BUILD_ROOT{%{_bindir},%{_libdir},%{_includedir}}
    install -p -m 755 astyle $RPM_BUILD_ROOT%{_bindir}
    install -p -m 755 libastyle-%{version}.so $RPM_BUILD_ROOT%{_libdir}
    cp -P libastyle.so $RPM_BUILD_ROOT%{_libdir}
    install -p -m 644 astyle.h $RPM_BUILD_ROOT%{_includedir}
    

    This is a feature request to do this directly in the astyle Makefile, so:
    1. it is easier to build/install
    2. the so version number is under your control as you know better than anyone else, when you break the ABI/API and need to introdue an increased version of the library.

    It "works" as is and we can continue to generate the shared library with soname ourselves, but I'd like to push this change back upstream to you.

    I can try to adjust that to the makefile and come with a more explicite patch, if you are willing to accept something like that?

     
  • Jim Pattee
    Jim Pattee
    2014-04-23

    The previous examples look like you are using a version number in the filename instead of a soname. This would be better for astyle since the shared library must be compatible with the options in the calling program.

    Would this be acceptable instead of a soname?

     
  • Thomas Spura
    Thomas Spura
    2014-04-24

    The codeblock maintainer reasons the versioned library as there is "no ABI/API compatibility guaranteed".

    But both are just fine and will work just fine.

    Thanks!

     
  • Jim Pattee
    Jim Pattee
    2014-05-04

    Added version number to the file name.

     
  • Jim Pattee
    Jim Pattee
    2014-05-04

    • status: open --> open-fixed
    • assigned_to: Jim Pattee
    • Priority: 5 --> 7
     
  • Jim Pattee
    Jim Pattee
    2014-11-20

    • Status: open-fixed --> closed-fixed