mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-23 04:00:05 +02:00
libsunpinyin, new recipe (#6038)
This commit is contained in:
108
dev-libs/libsunpinyin/libsunpinyin-3.0.0~rc2.recipe
Normal file
108
dev-libs/libsunpinyin/libsunpinyin-3.0.0~rc2.recipe
Normal file
@@ -0,0 +1,108 @@
|
||||
SUMMARY="Chinese input method library"
|
||||
DESCRIPTION="SunPinyin is an SLM (Statistical Language Model) based input \
|
||||
method engine. To model the Chinese language, it uses a backoff bigram and \
|
||||
trigram language model."
|
||||
HOMEPAGE="https://github.com/sunpinyin/sunpinyin"
|
||||
COPYRIGHT="2010-2021 Sun Beijing Globalization team"
|
||||
LICENSE="CDDL v1
|
||||
GNU LGPL v2.1"
|
||||
REVISION="1"
|
||||
SOURCE_URI="https://github.com/sunpinyin/sunpinyin/archive/refs/tags/v${portVersion/\~/-}.tar.gz"
|
||||
CHECKSUM_SHA256="6722bd41e58b0a42bf41b7c1cb7707e6adfce810ab35597f938c5df8aa5a0af0"
|
||||
SOURCE_DIR="sunpinyin-${portVersion/\~/-}"
|
||||
PATCHES="libsunpinyin-$portVersion.patchset"
|
||||
|
||||
ARCHITECTURES="!x86_gcc2 x86_64"
|
||||
SECONDARY_ARCHITECTURES="x86"
|
||||
|
||||
libVersion="3.0"
|
||||
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
|
||||
|
||||
PROVIDES="
|
||||
libsunpinyin$secondaryArchSuffix = $portVersion
|
||||
cmd:genpyt
|
||||
cmd:getwordfreq
|
||||
cmd:idngram_merge
|
||||
cmd:ids2ngram
|
||||
cmd:mmseg
|
||||
cmd:mmseg
|
||||
cmd:slmbuild
|
||||
cmd:slminfo
|
||||
cmd:slmpack
|
||||
cmd:slmprune
|
||||
cmd:slmseg
|
||||
cmd:slmthread
|
||||
cmd:sunpinyin_dictgen
|
||||
cmd:tslmendian
|
||||
cmd:tslminfo
|
||||
lib:libsunpinyin$secondaryArchSuffix = $libVersionCompat
|
||||
"
|
||||
REQUIRES="
|
||||
haiku$secondaryArchSuffix
|
||||
lib:libiconv$secondaryArchSuffix
|
||||
lib:libsqlite3$secondaryArchSuffix
|
||||
"
|
||||
|
||||
PROVIDES_devel="
|
||||
libsunpinyin${secondaryArchSuffix}_devel = $portVersion
|
||||
devel:libsunpinyin$secondaryArchSuffix = $libVersionCompat
|
||||
"
|
||||
REQUIRES_devel="
|
||||
libsunpinyin$secondaryArchSuffix == $portVersion base
|
||||
devel:libsqlite3$secondaryArchSuffix
|
||||
"
|
||||
|
||||
BUILD_REQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel
|
||||
devel:libiconv$secondaryArchSuffix
|
||||
devel:libsqlite3$secondaryArchSuffix
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
cmd:make
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
cmd:pkg_config$secondaryArchSuffix
|
||||
cmd:pod2man
|
||||
cmd:python3
|
||||
cmd:scons
|
||||
"
|
||||
|
||||
BUILD()
|
||||
{
|
||||
export LDFLAGS=-liconv
|
||||
scons --prefix=$prefix --libdir=$libDir --datadir=$dataDir
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
export LDFLAGS=-liconv
|
||||
scons install --prefix=$prefix --libdir=$libDir --datadir=$dataDir
|
||||
|
||||
#move some things around, not handled by scons paths
|
||||
mkdir -p $docDir $includeDir $manDir
|
||||
mv $prefix/share/doc/sunpinyin/* $docDir
|
||||
mv $prefix/share/man/man1 $manDir
|
||||
mv $prefix/include/sunpinyin-2.0 $includeDir
|
||||
|
||||
# cleanup
|
||||
rm -rf $prefix/{include,share}
|
||||
|
||||
prepareInstalledDevelLib libsunpinyin
|
||||
fixPkgconfig
|
||||
|
||||
# fixPkgconfig
|
||||
if [ -n "$secondaryArchSuffix" ]; then
|
||||
sed -i 's,\/headers/x86,\/headers/x86/sunpinyin-2.0,g' \
|
||||
$prefix/$relativeDevelopLibDir/pkgconfig/sunpinyin-2.0.pc
|
||||
else
|
||||
sed -i 's,\/headers,\/headers/sunpinyin-2.0,g' \
|
||||
$prefix/$relativeDevelopLibDir/pkgconfig/sunpinyin-2.0.pc
|
||||
fi
|
||||
|
||||
packageEntries devel \
|
||||
$developDir
|
||||
}
|
||||
|
||||
TEST()
|
||||
{
|
||||
make check
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
From 94a8bacd1b28c4860f8c5bb45dd360a1ab70df23 Mon Sep 17 00:00:00 2001
|
||||
From: begasus <begasus@gmail.com>
|
||||
Date: Sat, 3 Jul 2021 10:58:32 +0000
|
||||
Subject: Fix python3 cmd path
|
||||
|
||||
|
||||
diff --git a/SConstruct b/SConstruct
|
||||
index e063c6d..c1e8ad1 100644
|
||||
--- a/SConstruct
|
||||
+++ b/SConstruct
|
||||
@@ -197,7 +197,7 @@ opts.Add('DATADIR', default='/usr/local/share')
|
||||
opts.Add('ENABLE_PLUGINS', default=False)
|
||||
opts.Add(PathVariable('PYTHON',
|
||||
'python3 interpreter used to generate header files',
|
||||
- '/usr/bin/python3',
|
||||
+ '/system/bin/python3',
|
||||
PathIsExecutable))
|
||||
|
||||
#
|
||||
--
|
||||
2.30.2
|
||||
|
||||
Reference in New Issue
Block a user