Bug 199408 - [maintainer] chinese/ibus-libpinyin: fix build on older systems
Summary: [maintainer] chinese/ibus-libpinyin: fix build on older systems
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: Jan Beich
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-13 04:54 UTC by Henry Hu
Modified: 2015-04-26 11:32 UTC (History)
0 users

See Also:


Attachments
patch to fix ibus-libpinyin (1.24 KB, patch)
2015-04-13 04:54 UTC, Henry Hu
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Henry Hu 2015-04-13 04:54:52 UTC
Created attachment 155533 [details]
patch to fix ibus-libpinyin

Currently, chinese/ibus-libpinyin fails to build on fbsd9.3 and fbsd8.4.
Makefile says "USES=compiler:c++0x". As a result, on old systems it uses clang 3.4.
However, the port also uses c++0x/c++11 headers. These headers are not present or not c++0x/c++11 compatible on older systems.
This patch changes the USES to c++11-lib. As a result, on older systems new gcc would be picked. It comes with usable headers.
This patch also adds #include <stdio.h>, which is required for getline() and fopen(). On newer systems, other headers already includes stdio.h.
Comment 1 Jan Beich freebsd_committer freebsd_triage 2015-04-25 18:19:22 UTC
Thanks. Fixed. 

Please, use |make makepatch| format for new patches unless you want to add comments within or split changes according to features/bugs.

https://www.freebsd.org/doc/en/books/porters-handbook/slow-patch.html#slow-patch-rules
Comment 2 commit-hook freebsd_committer freebsd_triage 2015-04-25 18:19:40 UTC
A commit references this bug:

Author: jbeich
Date: Sat Apr 25 18:19:16 UTC 2015
New revision: 384747
URL: https://svnweb.freebsd.org/changeset/ports/384747

Log:
  Unbreak build on FreeBSD 8.x/9.x and DragonFly

  ./PYSignal.h:35:22: error: expected namespace name
  using namespace std::placeholders;
                  ~~~~~^
  ./PYSignal.h:49:18: error: no type named 'function' in namespace 'std'
      typedef std::function<R()> func_type;
              ~~~~~^
  ./PYEditor.h:37:14: error: no type named 'shared_ptr' in namespace 'std'
  typedef std::shared_ptr<Editor> EditorPtr;
          ~~~~~^
  PYLibPinyin.cc:223:54: error: 'getline' was not declared in this scope
       while ((read = getline (&linebuf, &size, dictfile)) != -1) {
                                                        ^
  PR:		199408
  Reported by:	pkg-fallout, DPorts
  Submitted by:	Henry Hu <henry.hu.sh@gmail.com> (maintainer)

Changes:
  head/chinese/ibus-libpinyin/Makefile
  head/chinese/ibus-libpinyin/files/
  head/chinese/ibus-libpinyin/files/patch-src_PYLibPinyin.cc
Comment 3 commit-hook freebsd_committer freebsd_triage 2015-04-26 11:32:04 UTC
A commit references this bug:

Author: jbeich
Date: Sun Apr 26 11:31:33 UTC 2015
New revision: 384774
URL: https://svnweb.freebsd.org/changeset/ports/384774

Log:
  MFH: r384747

  Unbreak build on FreeBSD 8.x/9.x and DragonFly

  ./PYSignal.h:35:22: error: expected namespace name
  using namespace std::placeholders;
                  ~~~~~^
  ./PYSignal.h:49:18: error: no type named 'function' in namespace 'std'
      typedef std::function<R()> func_type;
              ~~~~~^
  ./PYEditor.h:37:14: error: no type named 'shared_ptr' in namespace 'std'
  typedef std::shared_ptr<Editor> EditorPtr;
          ~~~~~^
  PYLibPinyin.cc:223:54: error: 'getline' was not declared in this scope
       while ((read = getline (&linebuf, &size, dictfile)) != -1) {
                                                        ^
  PR:		199408
  Reported by:	pkg-fallout, DPorts
  Submitted by:	Henry Hu <henry.hu.sh@gmail.com> (maintainer)
  Approved by:	ports-secteam (delphij)

Changes:
_U  branches/2015Q2/
  branches/2015Q2/chinese/ibus-libpinyin/Makefile
  branches/2015Q2/chinese/ibus-libpinyin/files/