# Template file for 'rime-plum'
pkgname=rime-plum
version=0.2024.4.17
revision=1
build_style=gnu-makefile
hostmakedepends="librime"
depends="librime"
short_desc="Rime configuration manager and input schema repository"
maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
license="LGPL-3.0-or-later"
homepage="https://rime.im/"
provides="brise-${version}_${revision}"
replaces="brise>=0"

_rev=4c28f11f451facef809b380502874a48ba964ddb
_bopomofo=c7618f4f5728e1634417e9d02ea50d82b71956ab
_cangjie=0ac8452eeb4abbcd8dd1f9e7314012310743285f
_essay=0cd115e038b9bdfa4488cd502b5f6887dc1062a9
_luna_pinyin=0418e912d023c2325598b53b8cdfbefb049d6130
_prelude=3803f09458072e03b9ed396692ce7e1d35c88c95
_stroke=65fdbbf2f9485cc907cb9a6d6b9210938a50f71e
_terra_pinyin=333ec4128fa1f93924a0707da3c623ccd92a73f0
distfiles="
 https://github.com/rime/plum/archive/${_rev}.tar.gz>plum-${_rev}.tar.gz
 https://github.com/rime/rime-bopomofo/archive/$_bopomofo.tar.gz>bopomofo-${_bopomofo}.tar.gz
 https://github.com/rime/rime-cangjie/archive/$_cangjie.tar.gz>cangjie-${_cangjie}.tar.gz
 https://github.com/rime/rime-essay/archive/$_essay.tar.gz>essay-${_essay}.tar.gz
 https://github.com/rime/rime-luna-pinyin/archive/$_luna_pinyin.tar.gz>luna-pinyin-${_luna_pinyin}.tar.gz
 https://github.com/rime/rime-prelude/archive/$_prelude.tar.gz>prelude-${_prelude}.tar.gz
 https://github.com/rime/rime-stroke/archive/$_stroke.tar.gz>stroke-${_stroke}.tar.gz
 https://github.com/rime/rime-terra-pinyin/archive/$_terra_pinyin.tar.gz>terra-pinyin-${_terra_pinyin}.tar.gz
"
checksum="121d5a405dd1457582609d2a4cc0c6c55f9ada8750e524b5c0b6585dbc5268c8
 37bc156bca8bca93b001b112ee440fc498207a4f6fbcaa2d2c306cfdd4560577
 7fea467b08aeb38b0ebc6260a086f11578615549b1ac423bd4a5c6734ccf1ea8
 43f2664684e0c5deaf2f2f8f5efe86239a48ab7dcbc23d9994c85fe4b68721a3
 ffd1fd5020ce6c95110ce16f82cccb97f44ee274c1d2c24a13601d96cca84cfa
 afa07cd98c540a0ac2d1d6e98ffa776549c535e617d3e41eb6ef80806df806f2
 b0dfbb9b43cabf7e6d970ec345808c3197d507cbafdb80e3fb8f366ba70f05fd
 5f94ac60a156ee45c7a01598af3a1bdc7b829e2c1d75da590a9ae024bb3c49dd"

skip_extraction="
 bopomofo-${_bopomofo}.tar.gz
 cangjie-${_cangjie}.tar.gz
 essay-${_essay}.tar.gz
 luna-pinyin-${_luna_pinyin}.tar.gz
 prelude-${_prelude}.tar.gz
 stroke-${_stroke}.tar.gz
 terra-pinyin-${_terra_pinyin}.tar.gz
"

post_extract() {
	local _file _pkg
	for _file in $skip_extraction; do
		_pkg=${_file%-*}
		mkdir -p "package/rime/${_pkg}"
		vsrcextract -C "package/rime/${_pkg}" "$_file"
	done
}

do_install() {
	DESTDIR=${DESTDIR} make install
	vbin rime-install
}

brise_package() {
	# reverts="brise-0.38.20180515_1 brise-0.38.20180515_2 brise-0.38.20180515_3"
	depends="${sourcepkg}>=${version}_${revision}"
	metapackage=yes
}
