Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: haikuports/haikuports
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 6d29426eb33f
Choose a base ref
...
head repository: haikuports/haikuports
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 58332d0dc23c
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Jul 4, 2021

  1. Copy the full SHA
    58332d0 View commit details
Showing with 130 additions and 0 deletions.
  1. +108 −0 dev-libs/libsunpinyin/libsunpinyin-3.0.0~rc2.recipe
  2. +22 −0 dev-libs/libsunpinyin/patches/libsunpinyin-3.0.0~rc2.patchset
108 changes: 108 additions & 0 deletions dev-libs/libsunpinyin/libsunpinyin-3.0.0~rc2.recipe
Original file line number Diff line number Diff line change
@@ -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
}
22 changes: 22 additions & 0 deletions dev-libs/libsunpinyin/patches/libsunpinyin-3.0.0~rc2.patchset
Original file line number Diff line number Diff line change
@@ -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