Bug 103157 - CMake: patches for mingw build
Summary: CMake: patches for mingw build
Status: RESOLVED FIXED
Alias: None
Product: poppler
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-09 09:23 UTC by Sandro Mani
Modified: 2017-11-04 11:48 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Add soversion suffix to dlls (3.50 KB, patch)
2017-10-09 09:23 UTC, Sandro Mani
Details | Splinter Review
Install pkgconfig files (812 bytes, patch)
2017-10-09 09:23 UTC, Sandro Mani
Details | Splinter Review
Add soversion suffix to dlls (V2) (5.29 KB, patch)
2017-11-02 22:32 UTC, Sandro Mani
Details | Splinter Review
Add soversion suffix to dlls (V3) (3.95 KB, patch)
2017-11-02 23:17 UTC, Sandro Mani
Details | Splinter Review

Description Sandro Mani 2017-10-09 09:23:22 UTC
Created attachment 134761 [details] [review]
Add soversion suffix to dlls

In the Fedora mingw-poppler package I used the two attached patches to:
- Add a soversion suffix to the dlls, as they used to be named with the autotools build
- Ensure the pkgconfig files are installed
Comment 1 Sandro Mani 2017-10-09 09:23:41 UTC
Created attachment 134762 [details] [review]
Install pkgconfig files
Comment 2 Albert Astals Cid 2017-10-30 23:23:12 UTC
I don't see a reason why the suffix should be added.
Comment 3 Albert Astals Cid 2017-10-30 23:24:57 UTC
i pushed the pkgconfig change
Comment 4 Sandro Mani 2017-10-31 08:52:40 UTC
suffix: well I suppose it's the same reason why there is an so version under linux, it is by no means uncommon, and indeed the default behaviour of i.e. autotools. In any event, as you please, I have no problems just carrying the patch downstream.
Comment 5 Albert Astals Cid 2017-11-01 22:31:53 UTC
(In reply to Sandro Mani from comment #4)
> suffix: well I suppose it's the same reason why there is an so version under
> linux, it is by no means uncommon, and indeed the default behaviour of i.e.
> autotools. In any event, as you please, I have no problems just carrying the
> patch downstream.

But is it the default of windows? i've never seen a dll in windows having a suffix number
Comment 6 Sandro Mani 2017-11-01 22:45:37 UTC
It depends on the toolchain I suppose, with mingw it is certainly not uncommon. How about just adding them for MINGW?
Comment 7 Albert Astals Cid 2017-11-01 23:14:06 UTC
I wouldn't disagree with that if it seems that is actually what mingw does.

Is there a guideline or something you could share?
Comment 8 Sandro Mani 2017-11-02 09:35:05 UTC
I've looked around a bit and can't really find much, except that besides autotools also qmake appears to do it by default, as I gather from [1].

As an experiment, I looked at all dlls of all Fedora mingw packages:

$ dnf provides '/usr/x86_64-w64-mingw32/sys-root/mingw/bin/*.dll' | grep Filename | awk '{print $3}' | sort | uniq > dlls

$ cat dlls | wc -l
714

$ cat dlls | grep -Ev '[0-9].dll' | grep -v "^Qt5" | wc -l
343

So out of 714 dlls, 343 have no versioning.

A strong argument for versioning IMO is that from a packaging point of view it enforces versioned dependencies between packages, i.e.:

$ rpm -q --requires mingw64-gdal
mingw64(iconv.dll)
mingw64(kernel32.dll)
mingw64(libcfitsio-3.dll)
mingw64(libcurl-4.dll)
mingw64(libexpat-1.dll)
mingw64(libfreexl-1.dll)
mingw64(libgcc_s_seh-1.dll)
mingw64(libgeos_c-1.dll)
mingw64(libgeotiff-2.dll)
mingw64(libgif-7.dll)
mingw64(libgrib2c.dll)
mingw64(libgta-0.dll)
mingw64(libjasper-4.dll)
mingw64(libjpeg-62.dll)
mingw64(libkmlbase.dll)
mingw64(libkmldom.dll)
mingw64(libkmlengine.dll)
mingw64(libpcre-1.dll)
mingw64(libpng16-16.dll)
mingw64(libpoppler-71.dll)
mingw64(libpq.dll)
mingw64(libproj-12.dll)
mingw64(libspatialite-4.dll)
mingw64(libsqlite3-0.dll)
mingw64(libstdc++-6.dll)
mingw64(libtiff-5.dll)
mingw64(libwebp-7.dll)
mingw64(libxerces-c-3-1.dll)
mingw64(libxml2-2.dll)
mingw64(msvcrt.dll)
mingw64(odbc32.dll)
mingw64(odbccp32.dll)
mingw64(psapi.dll)
mingw64(user32.dll)
mingw64(ws2_32.dll)
mingw64(zlib1.dll)

[1] https://stackoverflow.com/questions/404774/why-library-name-gets-an-additional-0-in-its-name
Comment 9 Albert Astals Cid 2017-11-02 21:59:07 UTC
ok, if you can provice a better patch than the one you proposed, i.e. one where you don't duplicate the numbers like the one that you proposed, i guess i'd accept it.
Comment 10 Sandro Mani 2017-11-02 22:32:33 UTC
Created attachment 135216 [details] [review]
Add soversion suffix to dlls (V2)

Here you go
Comment 11 Albert Astals Cid 2017-11-02 22:47:06 UTC
can you please try to see if there's another way of doing that doesn't involve new variables? this kind of breaks my release workflow
Comment 12 Sandro Mani 2017-11-02 22:51:24 UTC
Hmm I think the only alternative is

set_target_properties(poppler PROPERTIES VERSION 71.0.0 SOVERSION 71)
if(MINGW)
    get_target_property(LIBPOPPLER_SOVERSION poppler SOVERSION)
    set_target_properties(poppler PROPERTIES SUFFIX "-${LIBPOPPLER_SOVERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}")
endif(MINGW)

would that work?
Comment 13 Albert Astals Cid 2017-11-02 23:00:04 UTC
if that works, yes, that is fine, i just want the patch to be

if (mingw)
things i should never touch
endif()

wihtout touching the rest of the code as much as possible :)
Comment 14 Sandro Mani 2017-11-02 23:17:48 UTC
Created attachment 135217 [details] [review]
Add soversion suffix to dlls (V3)
Comment 15 Albert Astals Cid 2017-11-04 11:48:55 UTC
pushed


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.