summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e59c0d4392c4df580d7cd62a59946f12d1d02598 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# Maintainer: Sergey V. Zhdanovskih (aka Norseman) <gedkeeper@yandex.ru>


_gitname=GEDKeeper
_communicator=GKCommunicator
_genetix=GKGenetix
_pkgname=gedkeeper
pkgname=${_pkgname}-git
pkgver=v3.5.1.r4.g03c755c6
pkgrel=2
pkgdesc="Personal genealogical database editor"
arch=('x86_64' 'i686')
url="https://github.com/serg-norseman/gedkeeper"
license=('GPLv3')
depends=('sqlite3' 'dotnet-runtime-6.0' 'lua')
makedepends=('dotnet-sdk-6.0')

provides=("gedkeeper=${pkgver}")
source=("git+https://github.com/Serg-Norseman/${_gitname}.git"
"git+https://github.com/Serg-Norseman/${_communicator}.git"
"git+https://github.com/Serg-Norseman/${_genetix}.git")
sha256sums=('SKIP' 'SKIP' 'SKIP')

pkgver() {
  cd "${srcdir}/${_gitname}"
  ( set -o pipefail
    git describe --long --tags 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
  )
}

prepare() {
  cd "${srcdir}/${_gitname}"
  git submodule init
  git config submodule.projects/GKCommunicator.url "${srcdir}/${_communicator}"
  git config submodule.projects/GKGenetix.url "${srcdir}/${_genetix}"
  git -c protocol.file.allow=always submodule update
}

build() {
	cd "${srcdir}"
	dotnet build "${_gitname}/projects/GKCore/GKCore.nstd.csproj" --configuration Release -p:Platform="Linux" --no-self-contained
	dotnet build "${_gitname}/projects/GKMap/GKMap.Core/GKMap.Core.nstd.csproj" --configuration Release -p:Platform="Linux" --no-self-contained
	dotnet build "${_gitname}/projects/GKMap/GKMap.EtoForms/GKMap.EtoForms.csproj" --configuration Release -p:Platform="Linux" --no-self-contained	
	dotnet build "${_gitname}/projects/GKv3/GKComponents/GKComponents.csproj" --configuration Release -p:Platform="Linux" --no-self-contained
	dotnet build "${_gitname}/projects/GKGenetix/GKGenetix.Core/GKGenetix.Core.nstd.csproj" --configuration Release -p:Platform="Linux" --no-self-contained
	dotnet build "${_gitname}/projects/GKGenetix/GKGenetix.UI.EtoForms/GKGenetix.UI.EtoForms.csproj" --configuration Release -p:Platform="Linux" --no-self-contained
	dotnet build "${_gitname}/projects/GKCommunicator/GKNetCore/GKNetCore.nstd.csproj" --configuration Release -p:Platform="Linux" --no-self-contained
	dotnet build "${_gitname}/projects/GKCommunicator/GKNetUI.EtoForms/GKNetUI.net.csproj" --configuration Release -p:Platform="Linux" --no-self-contained
	dotnet build "${_gitname}/projects/GKv3/GEDKeeper3.sln" --configuration Release -p:Platform="Linux" --no-self-contained
}

package() {
	BASE_PATH="${srcdir}/${_gitname}"
	BIN_PATH="${pkgdir}/usr/bin"
	LIB_PATH="${pkgdir}/usr/lib/gedkeeper"
	EXT_PATH="${pkgdir}/usr/lib/gedkeeper/externals"
	
	rm -rf ${pkgdir}

	mkdir -p ${pkgdir}
	mkdir -p $BIN_PATH
	mkdir -p $LIB_PATH
	mkdir -p $EXT_PATH

	mkdir -p ${pkgdir}/usr/share/applications
	mkdir -p ${pkgdir}/usr/share/pixmaps
	mkdir -p ${pkgdir}/usr/share/mime/packages
	mkdir -p ${pkgdir}/usr/share/metainfo/
	
	cp ${BASE_PATH}/deploy/gk_run.sh $BIN_PATH/gedkeeper
	chmod a+x $BIN_PATH/gedkeeper

	cp ${BASE_PATH}/deploy/gedkeeper.png $LIB_PATH
	cp ${BASE_PATH}/deploy/gedkeeper.png ${pkgdir}/usr/share/pixmaps
	cp ${BASE_PATH}/deploy/gedkeeper.desktop ${pkgdir}/usr/share/applications
	sed -i 's/gk_run.sh/gedkeeper/g' ${pkgdir}/usr/share/applications/gedkeeper.desktop
	cp ${BASE_PATH}/deploy/application-x-gedkeeper.xml ${pkgdir}/usr/share/mime/packages
	cp ${BASE_PATH}/deploy/gedkeeper.appdata.xml ${pkgdir}/usr/share/metainfo/

	cp ${BASE_PATH}/LICENSE $LIB_PATH

	cp -r ${BASE_PATH}/bin/ $LIB_PATH/
	cp -r ${BASE_PATH}/plugins/ $LIB_PATH/
	rm -r $LIB_PATH/plugins/runtimes
	rm -r $LIB_PATH/bin/*.so

	cp -r ${BASE_PATH}/backgrounds/ $LIB_PATH/
	cp -r ${BASE_PATH}/externals/resources.yaml $EXT_PATH/
	cp -r ${BASE_PATH}/locales/ $LIB_PATH/
	cp -r ${BASE_PATH}/samples/ $LIB_PATH/
	cp -r ${BASE_PATH}/scripts/ $LIB_PATH/
	cp -r ${BASE_PATH}/themes/ $LIB_PATH/

	find $LIB_PATH/bin -type f -iname "*.dll" -exec chmod -x {} \;
	find $LIB_PATH/plugins -type f -exec chmod -x '{}' \;

	find $LIB_PATH/backgrounds -type f -exec chmod -x '{}' \;
	find $EXT_PATH -type f -exec chmod -x '{}' \;
	find $LIB_PATH/locales -type f -exec chmod -x '{}' \;
	find $LIB_PATH/samples -type f -exec chmod -x '{}' \;
	find $LIB_PATH/scripts -type f -exec chmod -x '{}' \;
	find $LIB_PATH/themes -type f -exec chmod -x '{}' \;

	chmod -x $LIB_PATH/LICENSE
	chmod -x $LIB_PATH/gedkeeper.png
	chmod -x ${pkgdir}/usr/share/pixmaps/gedkeeper.png
	chmod -x ${pkgdir}/usr/share/applications/gedkeeper.desktop
	chmod -x ${pkgdir}/usr/share/mime/packages/application-x-gedkeeper.xml
	chmod -x ${pkgdir}/usr/share/metainfo/gedkeeper.appdata.xml
}