Bug 219777 - [NEW PORT] net/libmdf: Millistream Data Feed API library
Summary: [NEW PORT] net/libmdf: Millistream Data Feed API library
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Kubilay Kocak
URL:
Keywords: easy, feature, needs-qa
Depends on:
Blocks:
 
Reported: 2017-06-04 15:26 UTC by Henrik Holst
Modified: 2017-06-06 05:53 UTC (History)
0 users

See Also:


Attachments
libmdf.shar (1.94 KB, application/x-shar)
2017-06-04 15:26 UTC, Henrik Holst
no flags Details
Poudriere log (26.92 KB, text/x-log)
2017-06-04 15:27 UTC, Henrik Holst
no flags Details
libmdf.shar (1.95 KB, application/x-shar)
2017-06-04 15:46 UTC, Henrik Holst
no flags Details
Poudriere i386 log (26.97 KB, text/x-log)
2017-06-04 16:25 UTC, Henrik Holst
no flags Details
patch to net/libmdf/Makefile (276 bytes, patch)
2017-06-04 20:15 UTC, Henrik Holst
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Henrik Holst 2017-06-04 15:26:47 UTC
Created attachment 183207 [details]
libmdf.shar

libmdf is the Millistream Data Feed API library with which developers 
can connect to the Millistream Market Data system and subscribe to 
streaming realtime or delayed market data such as stocks, indices,
currencies, bonds, derivatives and news services.

WWW: https://millistream.com
Comment 1 Henrik Holst 2017-06-04 15:27:53 UTC
Created attachment 183208 [details]
Poudriere log

Attached the Poudriere log
Comment 2 Kubilay Kocak freebsd_committer freebsd_triage 2017-06-04 15:33:34 UTC
Thank you Henrik.

Initial review looks clean

You may want to consider adding 'finance' as a secondary category
Comment 3 Henrik Holst 2017-06-04 15:42:10 UTC
Ah, never realised that there where such a category. Will add and upload new shar in a moment.
Comment 4 Henrik Holst 2017-06-04 15:46:21 UTC
Created attachment 183210 [details]
libmdf.shar

Added 'finance' to categories
Comment 5 Kubilay Kocak freebsd_committer freebsd_triage 2017-06-04 15:49:12 UTC
Testing/QA'ing on i386
Comment 6 Henrik Holst 2017-06-04 16:25:13 UTC
Created attachment 183212 [details]
Poudriere i386 log

Attached a log from poudriere on a i386 jail
Comment 7 Kubilay Kocak freebsd_committer freebsd_triage 2017-06-04 16:42:07 UTC
./configure fails to detect OpenSSL (in FreeBSD base), given it uses PKG_CHECK_MODULES and FreeBSD does not provide a .pc file for openssl:

=================================
checking for OPENSSL... no                                                                                                                                                                                                                                    configure: error: Package requirements (openssl) were not met:

Package 'openssl', required by 'virtual:world', not found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables OPENSSL_CFLAGS
and OPENSSL_LIBS to avoid the need to call pkg-config.             
=================================

Further since the test environment used DEFAULT_VERSIONS+=ssl=openssl in 
/usr/local/etc/poudriere.d/make.conf, 'openssl' meaning 'openssl port', poudriere installs the port and the error is not observed.

This is corrected by using the following in the port Makefile:

CONFIGURE_ENV+= OPENSSL_CFLAGS=${OPENSSLINC} \
                OPENSSL_LIBS=${OPENSSLLIB}

OPENSSL{INC,LIB} are provided by Mk/Uses/ssl.mk

I have applied this to my working copy, there's no need to update the attachment/patch
Comment 8 commit-hook freebsd_committer freebsd_triage 2017-06-04 16:49:45 UTC
A commit references this bug:

Author: koobs
Date: Sun Jun  4 16:49:21 UTC 2017
New revision: 442570
URL: https://svnweb.freebsd.org/changeset/ports/442570

Log:
  [NEW PORT] net/libmdf: Millistream Data Feed API library

  libmdf is the Millistream Data Feed API library with which developers
  can connect to the Millistream Market Data system and subscribe to
  streaming realtime or delayed market data such as stocks, indices,
  currencies, bonds, derivatives and news services.

  WWW: https://millistream.com

  PR:		219777
  Submitted by:	Henrik Holst <henrik.holst millistream com>

Changes:
  head/net/Makefile
  head/net/libmdf/
  head/net/libmdf/Makefile
  head/net/libmdf/distinfo
  head/net/libmdf/pkg-descr
  head/net/libmdf/pkg-plist
Comment 9 Kubilay Kocak freebsd_committer freebsd_triage 2017-06-04 16:53:17 UTC
Committed with changes:

- Add configure environment variables to prevent pkg-config from being run, causing non-detection of OpenSSL in base, and configure error.
- Group, sort and space separate sections
- Sort USES

Thank you Henrik
Comment 10 Henrik Holst 2017-06-04 19:49:31 UTC
Hmm, something went wrong. It's now not linked with libcrypto.so anymore so there are tons of undefined references to OpenSSL functions when you try to link with the library. Looking at why this happens.
Comment 11 Henrik Holst 2017-06-04 20:15:25 UTC
Created attachment 183218 [details]
patch to net/libmdf/Makefile

Found the problem. The pkgconfig part in automake relies on pkgconfig to supply "-lcrypto" which of course OPENSSL_LIBS doesn't. I don't know if there is a cleaner better way to handle it than what I did by adding "LDFLAGS+=-lcrypto", but now it links atleast.
Comment 12 Kubilay Kocak freebsd_committer freebsd_triage 2017-06-05 15:20:05 UTC
@Henrik, I can add -lcrypto to the existing OPENSSL_LIBS (./configure) environment variable in the port, to be "OPENSSL_LIBS=${OPENSSLLIB} -lcrypto", or I can use LDFLAGS, or another variable at your direction. It may be worth testing the former to see if there are any side effects or other issues.

All else being equal I understand separation of LDFLAGS and LIBS is "a good thing" TM (using -lfoo in the latter), but the implementation of ./configure or the PKG_CHECK_MODULES m4 module may already be prescriptive or specific in this regard.
Comment 13 Henrik Holst 2017-06-05 16:04:48 UTC
I've just tested with "OPENSSL_LIBS=${OPENSSLLIB} -lcrypto" and it works fine, I tested it yesterday but forgot to add the "" so it didn't work leading me to the LDFLAGS solution.

Since you propose to use OPENSSL_LIBS I reckon that this is the cleaner way (I'm quite new to FreeBSD) and since it does work, I say that we go with that one.

Just noticed why this whole ssl thing begun in the first place, not knowing FreeBSD I thought that openssl-devel was the package that contained headers since that is how it works on most Linux distributions (where there is a -dev package to libraries) so I installed that and that package seams to have installed a pkg-config profile for OpenSSL.

Many thanks for your patience with this newcomer :)
Comment 14 Kubilay Kocak freebsd_committer freebsd_triage 2017-06-06 04:35:35 UTC
(In reply to Henrik Holst from comment #13)

For a newbie you did an exceptional job on your submission and issue report, so thank you.

And yep, foo-devel in (current) FreeBSD parlance is just a defacto nnaming convention for the 'development version' of a corresponding "foo" port. I don't know the history, but I would guess it was not called '-dev' specifically to avoid confusing it with 'development' subpackages on other operating systems.

There will come a time where FreeBSD has 'subpackages' that are more programmatically created across the board (say -debug packages providing only debug symbols), though there are quite a few existing examples where software has been split into multiple ports/packages already (libx264/x264 is one).
Comment 15 commit-hook freebsd_committer freebsd_triage 2017-06-06 05:51:14 UTC
A commit references this bug:

Author: koobs
Date: Tue Jun  6 05:50:50 UTC 2017
New revision: 442742
URL: https://svnweb.freebsd.org/changeset/ports/442742

Log:
  net/libmdf: Add missing openssl library argument

  The build relies on pkg-config to supply "-lcrypto" but we're using
  OPENSSL_CFLAGS and OPENSSL_LIBS (not pkg-config), to enable libmdf to find
  openssl in base, which does not provide an openssl.pc file.

  The previous commit neglected to explicitly include the library to link with
  (-lcrypto), resulting in undefined references to OpenSSL functions when
  attempting to link with the libmdf library.

  PR:		219777
  Reported by:	Henrik Holst <henrik.holst millistream com>

Changes:
  head/net/libmdf/Makefile
Comment 16 Kubilay Kocak freebsd_committer freebsd_triage 2017-06-06 05:53:35 UTC
Committed, thank you for the report Henrik.