On Mon, Mar 14, 2016 at 06:00:09PM +0000, Martin Oppegaard wrote:
> I get it to build, but it doesn't install the binary.  It installs
> libledger.so instead.  From the patch:
>
> -@bin bin/ledger
> +@lib bin/libledger.so.${LIBledger_VERSION}
>

Thanks a lot for testing. This bug has been fixed in the diff below.

Please apply with patch -p0 < ledger.patch so that all necessary
directories are created. This should fix any build issues one might
have.

Regards,
Florian

Index: Makefile
===================================================================
RCS file: /cvs/ports/productivity/ledger/Makefile,v
retrieving revision 1.14
diff -u -p -u -r1.14 Makefile
--- Makefile    7 Aug 2013 21:58:00 -0000       1.14
+++ Makefile    14 Mar 2016 18:43:37 -0000
@@ -1,44 +1,49 @@
 # $OpenBSD: Makefile,v 1.14 2013/08/07 21:58:00 naddy Exp $

 COMMENT=       command line double-entry accounting ledger
+V=             3.1.1

-DISTNAME=      ledger-2.6.3
-REVISION=      2
+DISTNAME=      ${GH_PROJECT}-${V}
 CATEGORIES=    productivity

 HOMEPAGE=      http://www.ledger-cli.org/

 MAINTAINER=    Sergey Bronnikov <este...@gmail.com>

-SHARED_LIBS=   amounts 0.0
+SHARED_LIBS=   ledger  0.0

 # BSD
 PERMIT_PACKAGE_CDROM=  Yes

-MASTER_SITES=  https://github.com/downloads/jwiegley/ledger/
+GH_ACCOUNT =   ledger
+GH_PROJECT =   ledger
+GH_TAGNAME =   v${V}
+
+WANTLIB+=      boost_date_time-mt boost_filesystem-mt boost_iostreams-mt
+WANTLIB+=      boost_regex-mt boost_system-mt boost_unit_test_framework-mt
+WANTLIB+=      c estdc++ gmp>=4 m mpfr pthread
+
+BUILD_DEPENDS= lang/gcc/4.9,-c++>=4.9 \
+               devel/cmake
+
+LIB_DEPENDS=   devel/boost \
+               devel/gmp \
+               devel/mpfr \
+               ${MODGCC4_CPPLIBDEP}

-WANTLIB=       c gmp>=4 m pcre stdc++
+MODULES=       devel/cmake \
+               gcc4

-LIB_DEPENDS=   devel/gmp \
-               devel/pcre
+MODGCC4_LANGS= c++
+MODGCC4_ARCHS= *

 SEPARATE_BUILD=        Yes

-
-CONFIGURE_STYLE=gnu
-CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \
-               LDFLAGS="-L${LOCALBASE}/lib" \
-               EMACS=no
-CONFIGURE_ARGS=        --disable-xml \
-               --disable-ofx
+CONFIGURE_ENV= CC=egcc CXX=eg++
+CONFIGURE_ARGS=        -DUSE_PYTHON=OFF -DBUILD_LIBRARY=ON

 post-install:
-       ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/ledger
-       ${INSTALL_DATA} ${WRKSRC}/scripts/* ${PREFIX}/share/doc/ledger
-.for f in ledger.texi ledger.vim
-       ${INSTALL_DATA} ${WRKSRC}/${f} ${PREFIX}/share/doc/ledger
-.endfor
        ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/ledger
-       ${INSTALL_DATA} ${WRKSRC}/sample.dat ${PREFIX}/share/examples/ledger
+       ${INSTALL_DATA} ${WRKSRC}/test/input/sample.dat 
${PREFIX}/share/examples/ledger

 .include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /cvs/ports/productivity/ledger/distinfo,v
retrieving revision 1.5
diff -u -p -u -r1.5 distinfo
--- distinfo    18 Jan 2015 03:14:59 -0000      1.5
+++ distinfo    14 Mar 2016 18:43:37 -0000
@@ -1,2 +1,2 @@
-SHA256 (ledger-2.6.3.tar.gz) = s+zQF0o1ALuW/gR2F7HuhwzFGW3rAjA5PZM9zq639xc=
-SIZE (ledger-2.6.3.tar.gz) = 660752
+SHA256 (ledger-3.1.1.tar.gz) = kPBlYatpKxktRtZ7wQYVjanGxoE8w4SLUDJDqd/YVIo=
+SIZE (ledger-3.1.1.tar.gz) = 842364
Index: patches/patch-src_CMakeLists_txt
===================================================================
RCS file: patches/patch-src_CMakeLists_txt
diff -N patches/patch-src_CMakeLists_txt
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_CMakeLists_txt    14 Mar 2016 18:43:37 -0000
@@ -0,0 +1,53 @@
+$OpenBSD$
+--- src/CMakeLists.txt.orig    Mon Jan 11 16:59:38 2016
++++ src/CMakeLists.txt Mon Mar 14 19:19:50 2016
+@@ -263,21 +263,21 @@ include(GNUInstallDirs)
+
+ if (BUILD_LIBRARY)
+   set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
+-  add_library(libledger SHARED ${LEDGER_SOURCES})
+-  add_ledger_library_dependencies(libledger)
+-  set_target_properties(libledger PROPERTIES
+-    PREFIX ""
++  add_library(ledger SHARED ${LEDGER_SOURCES})
++  add_ledger_library_dependencies(ledger)
++  set_target_properties(ledger PROPERTIES
+     INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}"
+     VERSION ${Ledger_VERSION_MAJOR}
+     SOVERSION ${Ledger_VERSION_MAJOR})
+
+-  add_executable(ledger main.cc global.cc)
+-  target_link_libraries(ledger libledger)
++  add_executable(ledger-bin main.cc global.cc)
++  set_target_properties(ledger-bin PROPERTIES OUTPUT_NAME ledger)
++  target_link_libraries(ledger-bin ledger)
+   if (CMAKE_SYSTEM_NAME STREQUAL Darwin AND HAVE_BOOST_PYTHON)
+-    target_link_libraries(ledger ${PYTHON_LIBRARIES})
++    target_link_libraries(ledger-bin ${PYTHON_LIBRARIES})
+   endif()
+
+-  install(TARGETS libledger DESTINATION ${CMAKE_INSTALL_LIBDIR})
++  install(TARGETS ledger DESTINATION ${CMAKE_INSTALL_LIBDIR})
+   install(FILES ${LEDGER_INCLUDES}
+     DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ledger)
+ else()
+@@ -308,9 +308,9 @@ print(s.get_python_lib(True, prefix=''))"
+     # execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink ...).
+     # Windows will need a special case due to not supporting symlinks.
+     add_custom_command(
+-      TARGET libledger POST_BUILD
++      TARGET ledger POST_BUILD
+       COMMAND ${CMAKE_COMMAND} -E copy_if_different
+-      $<TARGET_FILE:libledger> 
"${CMAKE_BINARY_DIR}/${_ledger_python_module_name}")
++      $<TARGET_FILE:ledger> 
"${CMAKE_BINARY_DIR}/${_ledger_python_module_name}")
+     install(
+       FILES "${CMAKE_BINARY_DIR}/${_ledger_python_module_name}"
+       DESTINATION ${PYTHON_SITE_PACKAGES})
+@@ -319,6 +319,6 @@ print(s.get_python_lib(True, prefix=''))"
+   endif()
+ endif()
+
+-install(TARGETS ledger DESTINATION ${CMAKE_INSTALL_BINDIR})
++install(TARGETS ledger-bin DESTINATION ${CMAKE_INSTALL_BINDIR})
+
+ ### CMakeLists.txt ends here
Index: patches/patch-test_unit_CMakeLists_txt
===================================================================
RCS file: patches/patch-test_unit_CMakeLists_txt
diff -N patches/patch-test_unit_CMakeLists_txt
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-test_unit_CMakeLists_txt      14 Mar 2016 18:43:37 -0000
@@ -0,0 +1,10 @@
+$OpenBSD$
+--- test/unit/CMakeLists.txt.orig      Wed Jan 13 21:53:23 2016
++++ test/unit/CMakeLists.txt   Wed Jan 13 21:53:33 2016
+@@ -1,5 +1,5 @@
+ macro(add_ledger_test _name)
+-  target_link_libraries(${_name} libledger)
++  target_link_libraries(${_name} ledger)
+   add_test(Ledger${_name} ${PROJECT_BINARY_DIR}/${_name})
+   set_tests_properties(Ledger${_name}
+     PROPERTIES ENVIRONMENT "TZ=${Ledger_TEST_TIMEZONE}")
Index: pkg/PFRAG.shared
===================================================================
RCS file: pkg/PFRAG.shared
diff -N pkg/PFRAG.shared
--- pkg/PFRAG.shared    14 Oct 2010 00:02:24 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,4 +0,0 @@
-@comment $OpenBSD: PFRAG.shared,v 1.1 2010/10/14 00:02:24 jim Exp $
-@lib lib/libamounts.so.${LIBamounts_VERSION}
-lib/libledger-2.6.3.so
-lib/libledger.so
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/productivity/ledger/pkg/PLIST,v
retrieving revision 1.2
diff -u -p -u -r1.2 PLIST
--- pkg/PLIST   14 Oct 2010 00:02:24 -0000      1.2
+++ pkg/PLIST   14 Mar 2016 18:43:37 -0000
@@ -1,55 +1,67 @@
 @comment $OpenBSD: PLIST,v 1.2 2010/10/14 00:02:24 jim Exp $
-%%SHARED%%
 @bin bin/ledger
 include/ledger/
-include/ledger/acconf.h
+include/ledger/account.h
 include/ledger/amount.h
+include/ledger/annotate.h
 include/ledger/balance.h
-include/ledger/binary.h
-include/ledger/config.h
+include/ledger/chain.h
+include/ledger/commodity.h
+include/ledger/compare.h
+include/ledger/context.h
+include/ledger/convert.h
 include/ledger/csv.h
-include/ledger/datetime.h
-include/ledger/debug.h
-include/ledger/derive.h
+include/ledger/draft.h
 include/ledger/emacs.h
 include/ledger/error.h
+include/ledger/expr.h
+include/ledger/exprbase.h
+include/ledger/filters.h
+include/ledger/flags.h
 include/ledger/format.h
-include/ledger/gnucash.h
+include/ledger/generate.h
+include/ledger/global.h
+include/ledger/history.h
+include/ledger/item.h
+include/ledger/iterators.h
 include/ledger/journal.h
-include/ledger/ledger.h
+include/ledger/lookup.h
 include/ledger/mask.h
-include/ledger/ofx.h
+include/ledger/op.h
 include/ledger/option.h
+include/ledger/org.h
+include/ledger/output.h
 include/ledger/parser.h
-include/ledger/qif.h
+include/ledger/pool.h
+include/ledger/post.h
+include/ledger/precmd.h
+include/ledger/predicate.h
+include/ledger/print.h
+include/ledger/pstream.h
+include/ledger/ptree.h
+include/ledger/pyfstream.h
+include/ledger/pyinterp.h
+include/ledger/pyutils.h
+include/ledger/query.h
 include/ledger/quotes.h
-include/ledger/reconcile.h
 include/ledger/report.h
-include/ledger/textual.h
-include/ledger/timing.h
-include/ledger/util.h
-include/ledger/valexpr.h
+include/ledger/scope.h
+include/ledger/select.h
+include/ledger/session.h
+include/ledger/stats.h
+include/ledger/stream.h
+include/ledger/strptime.h
+include/ledger/system.hh
+include/ledger/temps.h
+include/ledger/timelog.h
+include/ledger/times.h
+include/ledger/token.h
+include/ledger/unistring.h
+include/ledger/utils.h
 include/ledger/value.h
-include/ledger/walk.h
-include/ledger/xml.h
-@info info/ledger.info
-lib/libamounts.a
-lib/libamounts.la
-lib/libledger.a
-lib/libledger.la
-share/doc/ledger/
-share/doc/ledger/README
-share/doc/ledger/bal
-share/doc/ledger/bal-huquq
-share/doc/ledger/entry
-share/doc/ledger/getquote
-share/doc/ledger/ledger-du
-share/doc/ledger/ledger.texi
-share/doc/ledger/ledger.vim
-share/doc/ledger/report
-share/doc/ledger/tc
-share/doc/ledger/ti
-share/doc/ledger/to
-share/doc/ledger/trend
+include/ledger/views.h
+include/ledger/xact.h
+@lib lib/libledger.so.${LIBledger_VERSION}
+@man man/man1/ledger.1
 share/examples/ledger/
 share/examples/ledger/sample.dat

Reply via email to