Bug 179394 - [PATCH] devel/libsysinfo: fixed kvm dependency
Summary: [PATCH] devel/libsysinfo: fixed kvm dependency
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: William Grzybowski
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-07 09:20 UTC by oleg
Modified: 2013-06-17 01:52 UTC (History)
1 user (show)

See Also:


Attachments
libsysinfo-0.0.2.patch (333 bytes, patch)
2013-06-07 09:20 UTC, oleg
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description oleg 2013-06-06 18:58:04 UTC
> How can I reproduce the problem that this patch is meant to solve?

Ok, test case:

example test.c:
-------------------------
#include <stdio.h>
#include <sys/sysinfo.h>

int main() {
	int sy;
	struct sysinfo info;

	sy =  sysinfo(&info);
	printf("ok\n");
}
-------------------------


compile, link and run with original devel/libsysinfo:
-----------------------------------------------
gcc -I/usr/local/include -L/usr/local/lib -lsysinfo -o test test.c && ./test
/usr/local/lib/libsysinfo.so: undefined reference to `kvm_open'
/usr/local/lib/libsysinfo.so: undefined reference to `kvm_getprocs'
/usr/local/lib/libsysinfo.so: undefined reference to `kvm_getswapinfo'
/usr/local/lib/libsysinfo.so: undefined reference to `kvm_getloadavg'
/usr/local/lib/libsysinfo.so: undefined reference to `kvm_close'
-----------------------------------------------

the only way is to explicitly specify -lkvm:
-----------------------------------------------
gcc -I/usr/local/include -L/usr/local/lib -lsysinfo -lkvm -o test test.c && ./test
ok
-----------------------------------------------
but our program doesn't use libkvm directly, it use libsysinfo only ;)


compile, link and run with properly built devel/libsysinfo:
-----------------------------------------------
gcc -I/usr/local/include -L/usr/local/lib -lsysinfo -o test test.c && ./test
ok
-----------------------------------------------

-- 
Cheers,
Oleg A. Mamontov

mailto:  oleg@mamontov.net

skype:   lonerr11
jabber:  lonerr@charla.mamontov.net
icq uin: 79-521-617
cell:    +7(903)798-1352
Comment 1 Jason W. Bacon freebsd_committer 2013-06-07 04:03:40 UTC
Change approved, thanks.

     JB

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Jason W. Bacon
   jwbacon@tds.net

   Circumstances don't make a man:
   They reveal him.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Comment 2 oleg 2013-06-07 09:20:03 UTC
[DESCRIBE CHANGES]

Port maintainer (jwbacon@tds.net) is cc'd.

Generated with FreeBSD Port Tools 0.99_7 (mode: change, diff: suffix)
Comment 3 Edwin Groothuis freebsd_committer 2013-06-07 09:20:20 UTC
Maintainer of devel/libsysinfo,

Please note that PR ports/179394 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/179394

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 4 Edwin Groothuis freebsd_committer 2013-06-07 09:20:21 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 5 Jason W. Bacon freebsd_committer 2013-06-07 13:54:29 UTC
Approved.

On 06/07/13 03:20, Edwin Groothuis wrote:
> Maintainer of devel/libsysinfo,
>
> Please note that PR ports/179394 has just been submitted.
>
> If it contains a patch for an upgrade, an enhancement or a bug fix
> you agree on, reply to this email stating that you approve the patch
> and a committer will take care of it.
>
> The full text of the PR can be found at:
>      http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/179394
>


-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Jason W. Bacon
   jwbacon@tds.net

   Circumstances don't make a man:
   They reveal him.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Comment 6 William Grzybowski freebsd_committer 2013-06-07 16:31:02 UTC
Responsible Changed
From-To: freebsd-ports-bugs->wg

I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=179394 

Date: Thu, 06 Jun 2013 11:14:58 -0500
Comment 7 dfilter service freebsd_committer 2013-06-07 16:47:00 UTC
Author: wg
Date: Fri Jun  7 15:46:47 2013
New Revision: 320219
URL: http://svnweb.freebsd.org/changeset/ports/320219

Log:
  - Fix libkvm dependency link [1]
  - Trim Makefile header
  - Use space for WWW in pkg-descr
  
  PR:		ports/179394 [1]
  Submitted by:	Oleg A. Mamontov <oleg@mamontov.net> [1]
  Approved by:	culot / jpaetzel (mentors, implicit), maintainer

Modified:
  head/devel/libsysinfo/Makefile
  head/devel/libsysinfo/pkg-descr

Modified: head/devel/libsysinfo/Makefile
==============================================================================
--- head/devel/libsysinfo/Makefile	Fri Jun  7 15:43:53 2013	(r320218)
+++ head/devel/libsysinfo/Makefile	Fri Jun  7 15:46:47 2013	(r320219)
@@ -1,9 +1,5 @@
-# New ports collection makefile for:	libsysinfo
-# Date created:		14 April 2012
-# Whom:			Jason Bacon <jwbacon@tds.net>
-#
+# Created by: Jason Bacon <jwbacon@tds.net>
 # $FreeBSD$
-#
 
 PORTNAME=	libsysinfo
 PORTVERSION=	0.0.2
@@ -18,6 +14,8 @@ LICENSE=	BSD
 USE_LDCONFIG=	yes
 PROJECTHOST=	sysinfo-bsd
 
+LDFLAGS+=	-lkvm
+
 PLIST_FILES=	include/sys/sysinfo.h \
 	lib/libsysinfo.a \
 	lib/libsysinfo.so \

Modified: head/devel/libsysinfo/pkg-descr
==============================================================================
--- head/devel/libsysinfo/pkg-descr	Fri Jun  7 15:43:53 2013	(r320218)
+++ head/devel/libsysinfo/pkg-descr	Fri Jun  7 15:46:47 2013	(r320219)
@@ -2,4 +2,4 @@ The sysinfo(3) function is a GNU interfa
 about the configuration and state of the system, such as is returned by
 sysctl(3) and sysconf(3).
 
-WWW:	http://code.google.com/p/sysinfo-bsd/
+WWW: http://code.google.com/p/sysinfo-bsd/
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 8 William Grzybowski freebsd_committer 2013-06-07 16:47:02 UTC
State Changed
From-To: feedback->closed

Committed. Thanks!