pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
zero-epwing-git: Import zero-epwing-master as wip/zero-epwing-git
Module Name: pkgsrc-wip
Committed By: Dean Matzkov <bapabooiee%gmail.com@localhost>
Pushed By: bapa
Date: Tue Oct 10 20:40:27 2017 -0600
Changeset: b6366b4eff6b800771b725b750e1798e5c15d885
Added Files:
zero-epwing-git/DESCR
zero-epwing-git/Makefile
zero-epwing-git/PLIST
zero-epwing-git/TODO
zero-epwing-git/distinfo
zero-epwing-git/patches/patch-CMakeLists.txt
zero-epwing-git/patches/patch-book.c
Log Message:
zero-epwing-git: Import zero-epwing-master as wip/zero-epwing-git
Zero-EPWING is a tool built to export easy to process JSON formatted
UTF-8 data from dictionaries in EPWING format.
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=b6366b4eff6b800771b725b750e1798e5c15d885
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
zero-epwing-git/DESCR | 2 +
zero-epwing-git/Makefile | 61 ++++++++++++++++++++++++++++
zero-epwing-git/PLIST | 3 ++
zero-epwing-git/TODO | 19 +++++++++
zero-epwing-git/distinfo | 4 ++
zero-epwing-git/patches/patch-CMakeLists.txt | 32 +++++++++++++++
zero-epwing-git/patches/patch-book.c | 17 ++++++++
7 files changed, 138 insertions(+)
diffs:
diff --git a/zero-epwing-git/DESCR b/zero-epwing-git/DESCR
new file mode 100644
index 0000000000..6549d4d196
--- /dev/null
+++ b/zero-epwing-git/DESCR
@@ -0,0 +1,2 @@
+Zero-EPWING is a tool built to export easy to process JSON formatted UTF-8
+data from dictionaries in EPWING format.
diff --git a/zero-epwing-git/Makefile b/zero-epwing-git/Makefile
new file mode 100644
index 0000000000..203adaa63a
--- /dev/null
+++ b/zero-epwing-git/Makefile
@@ -0,0 +1,61 @@
+# $NetBSD$
+
+PKGNAME= zero-epwing-0.1
+CATEGORIES= textproc
+
+GIT_REPOSITORIES= zero-epwing
+GIT_REPO.zero-epwing= git://github.com/FooSoft/zero-epwing.git
+
+MAINTAINER= pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE= https://github.com/FooSoft/zero-epwing
+COMMENT= Tool that converts EPWING files to JSON
+LICENSE= gnu-gpl-v3
+
+USE_CMAKE= yes
+USE_LANGUAGES= c c++
+
+USE_TOOLS+= gmake perl # required for the bundled libeb
+
+WRKSRC= ${WRKDIR}/zero-epwing
+
+INSTALLATION_DIRS+= bin
+INSTALLATION_DIRS+= share/doc/${PKGBASE}
+
+CFLAGS+= -std=gnu99
+
+
+# Okay, here's the rationale for the following mess:
+#
+# zero-epwing requires libeb, *however*, it only works with
+# the author's fork, which is included with the source code.
+# So, we have to build that fork of libeb here as well, and then
+# statically link it.
+#
+# ...unless everyone wants a libeb-but-only-for-zero-epwing pkg in pkgsrc.
+
+do-configure:
+ set -e ; cd ${WRKSRC}/eb; \
+ ./configure --disable-shared --disable-ebnet --disable-nls
+
+ set -e ; cd ${WRKSRC}; \
+ ${PKGSRC_SETENV} ${_CONFIGURE_CMAKE_ENV} \
+ cmake ${CMAKE_ARGS} ${CMAKE_ARG_PATH}
+
+do-build:
+ set -e ; cd ${WRKSRC}/eb \
+ && ${MAKE_PROGRAM}
+
+ set -e ; cd ${WRKSRC} \
+ && env ${MAKE_ENV} \
+ ${MAKE_PROGRAM} ${BUILD_MAKE_FLAGS} \
+ -f ${MAKE_FILE} \
+ ${BUILD_TARGET}
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/zero-epwing ${DESTDIR}${PREFIX}/bin
+ ${INSTALL_DATA} ${WRKSRC}/README.md ${DESTDIR}${PREFIX}/share/doc/${PKGBASE}
+
+.include "../../wip/mk/git-package.mk"
+.include "../../textproc/jansson/buildlink3.mk"
+#include "../../wip/libeb/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/zero-epwing-git/PLIST b/zero-epwing-git/PLIST
new file mode 100644
index 0000000000..69eae8ff68
--- /dev/null
+++ b/zero-epwing-git/PLIST
@@ -0,0 +1,3 @@
+@comment $NetBSD$
+bin/zero-epwing
+share/doc/zero-epwing/README.md
diff --git a/zero-epwing-git/TODO b/zero-epwing-git/TODO
new file mode 100644
index 0000000000..213e78b1c0
--- /dev/null
+++ b/zero-epwing-git/TODO
@@ -0,0 +1,19 @@
+- Haven't tested how Linux/FreeBSD/OpenBSD will react to the
+ exclusion of linking libintl via |UNIX AND NOT APPLE| in CMakeLists.txt.
+ But for now, it works on both NetBSD and macOS.
+
+- Internal (lib)eb doesn't seem to honor CFLAGS.
+
+- On NetBSD, `-std={c99,gnu99}' is required in CFLAGS for the build to succeed.
+ However, it's not required for macOS/clang, and it in fact causes the build to fail
+ on that platform.
+
+ We could either set CFLAGS depending on the platform/compiler, or patch the zero-epwing
+ code, since (at least at a cursory glance) it didn't look like too much would need to
+ be changed.
+
+- A kind and wise man has suggested that perhaps it *is* a good idea to
+ make the fork of libeb included with the source code into its own pkg
+ here on pkgsrc-wip.
+
+ It'd certainly make things easier to work with if we did.
diff --git a/zero-epwing-git/distinfo b/zero-epwing-git/distinfo
new file mode 100644
index 0000000000..160c561640
--- /dev/null
+++ b/zero-epwing-git/distinfo
@@ -0,0 +1,4 @@
+$NetBSD$
+
+SHA1 (patch-CMakeLists.txt) = 3c48e80d95db1a48e543506dd05a81d72096c0c4
+SHA1 (patch-book.c) = de46c996e5cb82d8397ca24ac94a45669d3a1c40
diff --git a/zero-epwing-git/patches/patch-CMakeLists.txt b/zero-epwing-git/patches/patch-CMakeLists.txt
new file mode 100644
index 0000000000..35a508c4c6
--- /dev/null
+++ b/zero-epwing-git/patches/patch-CMakeLists.txt
@@ -0,0 +1,32 @@
+$NetBSD$
+
+A few things are done here:
+
+1) Make libm, libz, libjansson and libiconv dynamically linked, instead of statically.
+2) Use system libjansson instead of the one included with zero-epwing.
+3) Link libintl if |UNIX AND NOT APPLE|.
+4) Specify the full path to the libeb static library, since (at least on macOS) the linker
+ has trouble linking it otherwise.
+
+--- CMakeLists.txt.orig 2017-10-06 02:15:49.000000000 +0000
++++ CMakeLists.txt
+@@ -1,10 +1,15 @@
+ cmake_minimum_required(VERSION 3.5)
+ project(zero-epwing)
+ include_directories(eb)
+-link_directories(eb/eb/.libs jansson/lib)
++link_directories(eb/eb/.libs)
+ add_executable(zero-epwing main.c book.c convert.c hooks.c)
+-target_link_libraries(zero-epwing libm.a libeb.a libm.a libz.a libjansson.a)
++target_link_libraries(zero-epwing
++ m z jansson
++ ${CMAKE_SOURCE_DIR}/eb/eb/.libs/libeb.a
++)
++if (UNIX AND NOT APPLE)
++ target_link_libraries(zero-epwing intl)
++endif (UNIX AND NOT APPLE)
+ if (WIN32 OR APPLE)
+- target_link_libraries(zero-epwing libiconv.a)
++ target_link_libraries(zero-epwing iconv)
+ endif (WIN32 OR APPLE)
+-target_link_libraries(zero-epwing)
diff --git a/zero-epwing-git/patches/patch-book.c b/zero-epwing-git/patches/patch-book.c
new file mode 100644
index 0000000000..c504368c23
--- /dev/null
+++ b/zero-epwing-git/patches/patch-book.c
@@ -0,0 +1,17 @@
+$NetBSD$
+
+Refer to the system's jansson.h header, instead of the one included
+with zero-epwing.
+
+--- book.c.orig 2017-10-05 21:42:21.000000000 +0000
++++ book.c
+@@ -28,7 +28,8 @@
+ #include "eb/eb/text.h"
+ #include "eb/eb/error.h"
+
+-#include "jansson/include/jansson.h"
++//#include "jansson/include/jansson.h"
++#include <jansson.h>
+
+ /*
+ * Local types
Home |
Main Index |
Thread Index |
Old Index