summaryrefslogtreecommitdiffstats
path: root/system/unac
diff options
context:
space:
mode:
author B. Watson <yalhcru@gmail.com>2021-08-20 14:59:31 -0400
committer Willy Sudiarto Raharjo <willysr@slackbuilds.org>2021-10-13 00:51:33 +0700
commit78298c73d1dfbf945211861154bebe840136dc4b (patch)
treebe6cc89ca72ebbcfa5f1b5dcb206d15b7a03f986 /system/unac
parent85ef26ae286d0aa2da88f119577445ec999ce1d2 (diff)
downloadslackbuilds-78298c73d1dfbf945211861154bebe840136dc4b.tar.gz
slackbuilds-78298c73d1dfbf945211861154bebe840136dc4b.tar.xz
system/unac: Updated for version 1.8.0_9.
Signed-off-by: B. Watson <yalhcru@gmail.com> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/unac')
-rw-r--r--system/unac/README12
-rw-r--r--system/unac/ligatures.diff (renamed from system/unac/oe_ligature.diff)9
-rw-r--r--system/unac/size_t.diff45
-rw-r--r--system/unac/slack-desc10
-rw-r--r--system/unac/unac.SlackBuild46
-rw-r--r--system/unac/unac.info10
6 files changed, 53 insertions, 79 deletions
diff --git a/system/unac/README b/system/unac/README
index d0683d9169..c45e3b107b 100644
--- a/system/unac/README
+++ b/system/unac/README
@@ -1,5 +1,7 @@
-unac is a C library and command that removes accents from a string
-It provides a command line interface that removes accents from a
-input flow or a string given in argument (unaccent command).
-In the library function and the command, the charset of the input
-is specified as an argument.
+unac (remove accents from text)
+
+unac is a C library (libunac) and command (unaccent) that removes
+accents from a string of text; it replaces accented characters in the
+given character set with their unaccented (ASCII) equivalents.
+
+See also: perl/perl-text-unaccent, for a Perl module based on this.
diff --git a/system/unac/oe_ligature.diff b/system/unac/ligatures.diff
index 1fa9a52453..aa796e04c5 100644
--- a/system/unac/oe_ligature.diff
+++ b/system/unac/ligatures.diff
@@ -1,11 +1,16 @@
diff -Naur unac-1.8.0.orig/unaccent-local-map.perl unac-1.8.0.orig.patched/unaccent-local-map.perl
--- unac-1.8.0.orig/unaccent-local-map.perl 2003-10-13 06:24:25.000000000 -0400
-+++ unac-1.8.0.orig.patched/unaccent-local-map.perl 2015-10-26 17:01:49.000000000 -0400
-@@ -23,5 +23,7 @@
++++ unac-1.8.0.orig.patched/unaccent-local-map.perl 2021-08-20 14:13:53.224474419 -0400
+@@ -23,5 +23,12 @@
%::localmap = (
"LATIN SMALL LETTER AE" => [ "LATIN SMALL LETTER A", "LATIN SMALL LETTER E" ],
"LATIN CAPITAL LETTER AE" => [ "LATIN CAPITAL LETTER A", "LATIN CAPITAL LETTER E" ],
+ "LATIN SMALL LIGATURE OE" => [ "LATIN SMALL LETTER O", "LATIN SMALL LETTER E" ],
+ "LATIN CAPITAL LIGATURE OE" => [ "LATIN CAPITAL LETTER O", "LATIN CAPITAL LETTER E" ],
++ "LATIN SMALL LETTER SHARP S" => [ "LATIN SMALL LETTER S", "LATIN SMALL LETTER S" ],
++ "LATIN SMALL LETTER HV" => [ "LATIN SMALL LETTER H", "LATIN SMALL LETTER V" ],
);
++# 20210820 bkw: Unicode standard 4.0.0 doesn't define these:
++# "LATIN CAPITAL LETTER HV" => [ "LATIN CAPITAL LETTER H", "LATIN CAPITAL LETTER V" ],
++# "LATIN CAPITAL LETTER SHARP S" => [ "LATIN CAPITAL LETTER S", "LATIN CAPITAL LETTER S" ],
diff --git a/system/unac/size_t.diff b/system/unac/size_t.diff
deleted file mode 100644
index e7ef82ba32..0000000000
--- a/system/unac/size_t.diff
+++ /dev/null
@@ -1,45 +0,0 @@
-diff -r fd7eb0d70970 unac-1.8.0/unac.c
---- a/unac-1.8.0/unac.c Fri Sep 17 10:35:14 2010 +0200
-+++ b/unac-1.8.0/unac.c Fri Sep 17 10:36:07 2010 +0200
-@@ -13873,9 +13873,9 @@
- *out_lengthp = 0;
- } else {
- char* utf16 = 0;
-- int utf16_length = 0;
-+ size_t utf16_length = 0;
- char* utf16_unaccented = 0;
-- int utf16_unaccented_length = 0;
-+ size_t utf16_unaccented_length = 0;
-
- if(convert(charset, utf16be(), in, in_length, &utf16, &utf16_length) < 0) {
- return -1;
-diff -r fd7eb0d70970 unac-1.8.0/unaccent.c
---- a/unac-1.8.0/unaccent.c Fri Sep 17 10:35:14 2010 +0200
-+++ b/unac-1.8.0/unaccent.c Fri Sep 17 10:40:34 2010 +0200
-@@ -90,7 +90,7 @@
- const char* charset = argv[optind++];
-
- char* unaccented = 0;
-- int unaccented_length = 0;
-+ size_t unaccented_length = 0;
-
- if(optind >= argc) {
- #define BUFFER_SIZE 10240
-@@ -101,7 +101,7 @@
- perror("");
- exit(1);
- }
-- printf("%.*s", unaccented_length, unaccented);
-+ printf("%.*s", (int)unaccented_length, unaccented);
- }
- } else {
- const char* string = argv[optind++];
-@@ -114,7 +114,7 @@
-
- if(debug_level > UNAC_DEBUG_NONE)
- fprintf(stderr, "unaccented version is ");
-- printf("%.*s\n", unaccented_length, unaccented);
-+ printf("%.*s\n", (int)unaccented_length, unaccented);
-
- if(optind < argc) {
- const char* expected = argv[optind++];
diff --git a/system/unac/slack-desc b/system/unac/slack-desc
index 6d1787116c..72ea1225ba 100644
--- a/system/unac/slack-desc
+++ b/system/unac/slack-desc
@@ -8,11 +8,11 @@
|-----handy-ruler------------------------------------------------------|
unac: unac (remove accents from text)
unac:
-unac: unac is a C library and command that removes accents from a string
-unac: It provides a command line interface that removes accents from a
-unac: input flow or a string given in argument (unaccent command).
-unac: In the library function and the command, the charset of the input
-unac: is specified as an argument.
+unac: unac is a C library (libunac) and command (unaccent) that removes
+unac: accents from a string of text; it replaces accented characters in the
+unac: given character set with their unaccented (ASCII) equivalents.
+unac:
+unac:
unac:
unac:
unac:
diff --git a/system/unac/unac.SlackBuild b/system/unac/unac.SlackBuild
index f7165c3946..3039ce555f 100644
--- a/system/unac/unac.SlackBuild
+++ b/system/unac/unac.SlackBuild
@@ -6,10 +6,19 @@
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+# 20210819 bkw:
+# - updated to match debian's patchlevel 9.
+# - add a few more ligatures.
+
+# Note to self: don't try to update this for Unicode standard 13.0.0.
+# It'll compile and run, but the code assumes the codepoints will fit
+# in an unsigned short (16 bits), which is no longer true in the new
+# standard.
+
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=unac
-VERSION=${VERSION:-1.8.0}
+VERSION=${VERSION:-1.8.0_9}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -22,9 +31,6 @@ if [ -z "$ARCH" ]; then
esac
fi
-# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
-# the name of the created package would be, and then exit. This information
-# could be useful to other scripts.
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
@@ -50,8 +56,13 @@ fi
set -e
-TARBALL=${PRGNAM}_${VERSION}.orig.tar.gz
-DIRNAME=${PRGNAM}-${VERSION}.orig
+# The original upstream hasn't maintained this since 2004, but
+# the Debian maintainers have been keeping it up to date.
+MAINVER="${VERSION//_*}" # e.g. 1.8.0_9 => 1.8.0
+DEBVER="${VERSION//*_}" # e.g. 1.8.0_9 => 9
+TARBALL=${PRGNAM}_${MAINVER}.orig.tar.gz
+DEBTAR=${PRGNAM}_${MAINVER}-${DEBVER}.debian.tar.xz
+DIRNAME=${PRGNAM}-${MAINVER}.orig
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
@@ -59,21 +70,19 @@ cd $TMP
rm -rf $DIRNAME
tar xvf $CWD/$TARBALL
cd $DIRNAME
+tar xvf $CWD/$DEBTAR
chown -R root:root .
-find -L . \
- \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
- -o -perm 511 \) -exec chmod 755 {} \; -o \
- \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
- -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
+ \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
-# patch taken from http://http.debian.net/debian/pool/main/u/unac/unac_1.8.0-6.diff.gz
-# (yes, it needs -p2)
-patch -p2 < $CWD/size_t.diff
+for i in $( cat debian/patches/series ); do
+ patch -p1 < debian/patches/$i
+done
-# patch by slackbuild author, add support for OE ligature
-patch -p1 < $CWD/oe_ligature.diff
+# patch by slackbuild author, add support for OE ligature, German sharp S,
+# and Hwair.
+patch -p1 < $CWD/ligatures.diff
-touch config.rpath # shut up, autocrap
autoreconf -if
CFLAGS="$SLKCFLAGS" \
@@ -89,11 +98,12 @@ CXXFLAGS="$SLKCFLAGS" \
--enable-shared \
--build=$ARCH-slackware-linux
-# this is needed for the OE ligature also
+# this is needed for the ligatures also
make -B $PRGNAM.c
make
make install-strip DESTDIR=$PKG
+rm -f $PKG/usr/lib$LIBDIRSUFFIX/*.la
gzip $PKG/usr/man/man?/*.?
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
diff --git a/system/unac/unac.info b/system/unac/unac.info
index 4379cc82e7..5c732af9e5 100644
--- a/system/unac/unac.info
+++ b/system/unac/unac.info
@@ -1,8 +1,10 @@
PRGNAM="unac"
-VERSION="1.8.0"
-HOMEPAGE="http://www.nongnu.org/unac/"
-DOWNLOAD="http://http.debian.net/debian/pool/main/u/unac/unac_1.8.0.orig.tar.gz"
-MD5SUM="8670c920969a199dec37f15c197602bf"
+VERSION="1.8.0_9"
+HOMEPAGE="https://www.nongnu.org/unac/"
+DOWNLOAD="https://deb.debian.org/debian/pool/main/u/unac/unac_1.8.0.orig.tar.gz \
+ https://deb.debian.org/debian/pool/main/u/unac/unac_1.8.0-9.debian.tar.xz"
+MD5SUM="8670c920969a199dec37f15c197602bf \
+ 5dcc4e384b015aebb7dd38569c22b6d0"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""