summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConrad Kostecki <conrad@kostecki.com>2018-10-30 12:24:00 +0100
committerMichał Górny <mgorny@gentoo.org>2018-11-10 20:18:10 +0100
commit02f92e490ec976cd87f7874207fa35745128c51f (patch)
treed33f8a7976a3795c4501ca45f4f6b5aba1761677 /app-text/msort
parentdev-libs/libuninum: New package (diff)
downloadgentoo-02f92e490ec976cd87f7874207fa35745128c51f.tar.gz
gentoo-02f92e490ec976cd87f7874207fa35745128c51f.tar.bz2
gentoo-02f92e490ec976cd87f7874207fa35745128c51f.zip
app-text/msort: New package
Msort is a program for sorting files in sophisticated ways. Closes: https://bugs.gentoo.org/154528 Signed-off-by: Conrad Kostecki <conrad@kostecki.com> Package-Manager: Portage-2.3.51, Repoman-2.3.11 Closes: https://github.com/gentoo/gentoo/pull/9986 Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'app-text/msort')
-rw-r--r--app-text/msort/Manifest1
-rw-r--r--app-text/msort/files/msort-8.53-find-utf8proc-headers.patch33
-rw-r--r--app-text/msort/files/msort-8.53-fix-icu-build.patch11
-rw-r--r--app-text/msort/files/msort-8.53-fix-missing-limits-header.patch11
-rw-r--r--app-text/msort/files/msort-8.53-fix-segfault-on-certain-input.patch11
-rw-r--r--app-text/msort/files/msort-8.53-respect-users-cflags.patch11
-rw-r--r--app-text/msort/metadata.xml25
-rw-r--r--app-text/msort/msort-8.53.ebuild47
8 files changed, 150 insertions, 0 deletions
diff --git a/app-text/msort/Manifest b/app-text/msort/Manifest
new file mode 100644
index 000000000000..9e30de57b9bd
--- /dev/null
+++ b/app-text/msort/Manifest
@@ -0,0 +1 @@
+DIST msort-8.53.tar.bz2 440307 BLAKE2B 024fa62c9424dd7f994fd9aabdb2414116ba78c2f6bbbfd88c11cde4ed1688260d7bb7f7a18dd36822f4725817df93d218c4382e8b15232fc6d3583098d44db0 SHA512 9afba189d8b703cd6668065ace86733b52a39f6783272849b3582308da5a33db8ae6747501846523ba3671c9fb38a7584fe0db2462cff446b15d79200055a573
diff --git a/app-text/msort/files/msort-8.53-find-utf8proc-headers.patch b/app-text/msort/files/msort-8.53-find-utf8proc-headers.patch
new file mode 100644
index 000000000000..9b3845bc601c
--- /dev/null
+++ b/app-text/msort/files/msort-8.53-find-utf8proc-headers.patch
@@ -0,0 +1,33 @@
+--- a/configure.ac 2010-01-11 01:56:36.000000000 +0100
++++ b/configure.ac 2018-09-27 15:05:20.205734233 +0200
+@@ -94,7 +94,7 @@
+ AC_CHECK_HEADERS([alloca.h ctype.h errno.h gnu/libc-version.h langinfo.h libintl.h limits.h locale.h stdargs.h stddef.h stdint.h stdlib.h string.h sys/file.h sys/stat.h time.h tre/tre.h unicode/umachine.h unicode/unorm.h uninum/unicode.h uninum/nsdefs.h uninum/uninum.h unistd.h wchar.h wctype.h])
+
+ if ${utf8proc}; then
+-AC_CHECK_HEADER([utf8proc.h],[AC_DEFINE([HAVE_UTF8PROC_H], [1],[Define to 1 if you have <utf8proc.h>.])],[AC_MSG_ERROR([LIB UTF8PROC and its header is obligatory. See http://www.flexiguided.de/publications.utf8proc.en.html])])
++AC_CHECK_HEADER([libutf8proc/utf8proc.h],[AC_DEFINE([HAVE_UTF8PROC_H], [1],[Define to 1 if you have <libutf8proc/utf8proc.h>.])],[AC_MSG_ERROR([LIB UTF8PROC and its header is obligatory. See http://www.flexiguided.de/publications.utf8proc.en.html])])
+ fi
+
+ if ${uninum}; then
+--- a/misc.c 2009-08-05 05:09:21.000000000 +0200
++++ b/misc.c 2018-09-27 15:10:37.355738021 +0200
+@@ -41,7 +41,7 @@
+ #include <unicode/umachine.h>
+ #include <unicode/unorm.h>
+ #else
+-#include <utf8proc.h>
++#include <libutf8proc/utf8proc.h>
+ #include "unorm.h"
+ #endif
+ #include <tre/regex.h>
+--- a/msort.c 2010-01-11 01:53:32.000000000 +0100
++++ b/msort.c 2018-09-27 15:10:30.275737936 +0200
+@@ -57,7 +57,7 @@
+ #ifndef USEUTF8PROC
+ #include <unicode/unorm.h>
+ #else
+-#include <utf8proc.h>
++#include <libutf8proc/utf8proc.h>
+ #include "unorm.h"
+ #endif
+ #ifdef HAVE_UNINUM_UNICODE_H
diff --git a/app-text/msort/files/msort-8.53-fix-icu-build.patch b/app-text/msort/files/msort-8.53-fix-icu-build.patch
new file mode 100644
index 000000000000..658be287e5ee
--- /dev/null
+++ b/app-text/msort/files/msort-8.53-fix-icu-build.patch
@@ -0,0 +1,11 @@
+--- a/Makefile.am 2009-08-05 05:09:21.000000000 +0200
++++ b/Makefile.am 2018-09-27 15:41:10.685759919 +0200
+@@ -22,7 +22,7 @@
+ LIBS+=-lutf8proc
+ AM_CFLAGS += -DUSEUTF8PROC
+ else
+-LIBS+=-licutu
++LIBS+=-licutu -licuuc
+ endif
+
+ msg: msg.tcl
diff --git a/app-text/msort/files/msort-8.53-fix-missing-limits-header.patch b/app-text/msort/files/msort-8.53-fix-missing-limits-header.patch
new file mode 100644
index 000000000000..14459d1cfd24
--- /dev/null
+++ b/app-text/msort/files/msort-8.53-fix-missing-limits-header.patch
@@ -0,0 +1,11 @@
+--- a/Makefile.am 2009-08-05 05:09:21.000000000 +0200
++++ b/Makefile.am 2018-09-27 15:32:28.685753684 +0200
+@@ -6,7 +6,7 @@
+ noinst_HEADERS = comparisons.h compdefs.h dstr.h ex_codes.h exitcode.h input.h key.h limits.h record.h retcodes.h unicode.h unorm.h utf8error.h
+ LOCALEDIR=/usr/local/share/locale
+ EXTRA_DIST = $(docs) msg.tcl CREDITS msort-${VERSION}.lsm RegressionTests SortOrders
+-AUTOMAKE_OPTIONS = dist-zip dist-bzip2
++AUTOMAKE_OPTIONS = dist-zip dist-bzip2 nostdinc
+
+ if ALLOCAOK
+ AM_CFLAGS = -DLOCALEDIR=\"${LOCALEDIR}\" -DALLOCAOK -std=gnu99
diff --git a/app-text/msort/files/msort-8.53-fix-segfault-on-certain-input.patch b/app-text/msort/files/msort-8.53-fix-segfault-on-certain-input.patch
new file mode 100644
index 000000000000..01edc69eb7da
--- /dev/null
+++ b/app-text/msort/files/msort-8.53-fix-segfault-on-certain-input.patch
@@ -0,0 +1,11 @@
+--- a/dstr.c 2009-08-05 05:09:21.000000000 +0200
++++ b/dstr.c 2018-09-27 15:43:52.815761856 +0200
+@@ -79,7 +79,7 @@
+ #ifdef SAFECALL
+ if(length == 0) return(ERROR);
+ #endif
+- if (length > tgt->c) {
++ if (length + 1 > tgt->c) {
+ if(tgt->s != NULL) free( (void *) tgt->s);
+ tgt->s = (wchar_t *) malloc((length + 1) * sizeof(wchar_t));
+ if(tgt->s == NULL) return(ERROR);
diff --git a/app-text/msort/files/msort-8.53-respect-users-cflags.patch b/app-text/msort/files/msort-8.53-respect-users-cflags.patch
new file mode 100644
index 000000000000..aefe84772447
--- /dev/null
+++ b/app-text/msort/files/msort-8.53-respect-users-cflags.patch
@@ -0,0 +1,11 @@
+--- a/configure.ac 2010-01-11 01:56:36.000000000 +0100
++++ b/configure.ac 2018-09-27 15:36:41.425756703 +0200
+@@ -78,8 +78,6 @@
+ AC_PROG_CC
+ if ${debugbuild}; then
+ CFLAGS="-ggdb -g3"
+-else
+- CFLAGS="-g -O2"
+ fi
+
+ AC_PROG_INSTALL
diff --git a/app-text/msort/metadata.xml b/app-text/msort/metadata.xml
new file mode 100644
index 000000000000..f7bd381f8067
--- /dev/null
+++ b/app-text/msort/metadata.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>ck+gentoo@bl4ckb0x.de</email>
+ <name>Conrad Kostecki</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <longdescription>
+ Msort is a program for sorting files in sophisticated ways.
+ It was originally developed for alphabetizing dictionaries of "exotic" languages
+ in formats like those used by Shoebox and Toolbox, for which it has been extensively used,
+ but is useful for many other purposes.
+ Msort differs from typical sort utilities in providing greater flexibility in parsing
+ the input into records and identifying key fields and greater control over the sort order.
+ </longdescription>
+ <use>
+ <flag name="heap">Use heap instead of alloca()</flag>
+ <flag name="icu">Use <pkg>dev-libs/icu</pkg> instead of <pkg>dev-libs/libutf8proc</pkg>.</flag>
+ <flag name="libuninum">Use <pkg>dev-libs/libuninum</pkg> for conversion.</flag>
+ </use>
+</pkgmetadata>
diff --git a/app-text/msort/msort-8.53.ebuild b/app-text/msort/msort-8.53.ebuild
new file mode 100644
index 000000000000..d401053463c1
--- /dev/null
+++ b/app-text/msort/msort-8.53.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools
+
+DESCRIPTION="A program for sorting files in sophisticated ways"
+HOMEPAGE="https://billposer.org/Software/msort.html"
+SRC_URI="https://billposer.org/Software/Downloads/${P}.tar.bz2"
+
+KEYWORDS="~amd64 ~x86"
+LICENSE="GPL-3 LGPL-3"
+SLOT="0"
+IUSE="heap +icu +libuninum"
+
+RDEPEND="dev-libs/tre
+ icu? ( dev-libs/icu:= )
+ !icu? ( dev-libs/libutf8proc:= )
+ libuninum? ( dev-libs/libuninum:= )"
+
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}/${P}-find-utf8proc-headers.patch"
+ "${FILESDIR}/${P}-fix-icu-build.patch"
+ "${FILESDIR}/${P}-fix-missing-limits-header.patch"
+ "${FILESDIR}/${P}-fix-segfault-on-certain-input.patch"
+ "${FILESDIR}/${P}-respect-users-cflags.patch"
+ )
+
+src_prepare() {
+ default
+
+ eautoreconf
+}
+
+src_configure() {
+ local myeconfargs=(
+ $(use_enable !heap allocaok)
+ $(use_enable !icu utf8proc)
+ $(use_enable libuninum uninum)
+ --disable-debugbuild
+ )
+
+ econf "${myeconfargs[@]}"
+}