summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d11d84d4b28b8fbdc06c19343c76a5944469b23a (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
112
113
114
115
116
117
#@IgnoreInspection BashAddShebang
# Maintainer: Natalia Portillo <claunia@claunia.com>
_netcoretarget='netcoreapp2.0'
_dicbase=discimagechef
packager='Natalia Portillo <claunia@claunia.com>'
pkgbase='discimagechef-git'
pkgname=('discimagechef-git' 'discimagechef-gtk-git')
pkgver=v4.5.1.1692.r811.g16849ea2
pkgrel=1
pkgdesc='Disc image management and creation tool for disks, tapes, optical and solid state media'
arch=('x86_64' 'armv7h' 'aarch64')
url='http://www.discimagechef.app'
license=('GPL')
source=('git://github.com/DiscImageChef/discimagechef')
makedepends=('dotnet-sdk>=2.0.0' 'git')
options=('!strip' 'staticlibs')
sha256sums=('SKIP')
provides=('discimagechef')
conflicts=('discimagechef')
depends=('icu' 'krb5' 'libcurl.so' 'libunwind' 'openssl-1.0' 'zlib')

if [ $arch == 'aarch64' ]; then
    dotnet_rid=linux-arm64
elif [ $arch == 'armv7h' ]; then
    dotnet_rid=linux-arm
else
    dotnet_rid=linux-x64
fi

pkgver() {
  cd "$SRCDEST"
  git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd "${srcdir}"/"${_dicbase}"
  git submodule update --init --checkout --recursive
}

build() {
    cd "${srcdir}"/"${_dicbase}"
    dotnet restore DiscImageChef.sln
    dotnet build -f ${_netcoretarget} -c Debug DiscImageChef.sln
    dotnet publish -f ${_netcoretarget} -c Debug --self-contained -r ${dotnet_rid} DiscImageChef.sln
    dotnet restore DiscImageChef.Gtk.sln
    dotnet build -f ${_netcoretarget} -c Debug DiscImageChef.Gtk.sln
    dotnet publish -f ${_netcoretarget} -c Debug --self-contained -r ${dotnet_rid} DiscImageChef.Gtk.sln
}

package_discimagechef-git() {
    cd "${srcdir}"/"${_dicbase}"/DiscImageChef/bin/Debug/${_netcoretarget}/${dotnet_rid}/publish

    # Create destination directory
    install -d -m0755 -g 0 "${pkgdir}"/opt/DiscImageChef

    # Copy Linux binary
    install -m0755 -g 0 -t "${pkgdir}"/opt/DiscImageChef DiscImageChef

    # Copy Linux dependencies
    install -m0755 -g 0 -t "${pkgdir}"/opt/DiscImageChef *.so
    install -m0755 -g 0 -t "${pkgdir}"/opt/DiscImageChef *.a
    install -m0755 -g 0 -t "${pkgdir}"/opt/DiscImageChef createdump
    install -m0755 -g 0 -t "${pkgdir}"/opt/DiscImageChef sosdocsunix.txt

    # Copy .NET dependencies
    install -m0755 -g 0 -t "${pkgdir}"/opt/DiscImageChef *.dll

    # Copy .NET configuration files
    install -m0644 -g 0 -t "${pkgdir}"/opt/DiscImageChef *.json

    # Copy documentation files
    install -m0644 -g 0 -t "${pkgdir}"/opt/DiscImageChef *.md
    install -m0644 -g 0 -t "${pkgdir}"/opt/DiscImageChef LICENSE*

    # Copy .NET debug files
    install -m0644 -g 0 -t "${pkgdir}"/opt/DiscImageChef *.pdb

    # Link executable
    install -d -m0755 -g 0 "${pkgdir}"/usr/bin
    ln -sf /opt/DiscImageChef/DiscImageChef "${pkgdir}"/usr/bin/dic
}

# TODO: Can optimize so no need to install separately with a depend?
package_discimagechef-gtk-git() {
    depends=('gtk3')

    cd "${srcdir}"/"${_dicbase}"/DiscImageChef.Gtk/bin/Debug/${_netcoretarget}/${dotnet_rid}/publish

    # Create destination directory
    install -d -m0755 -g 0 "${pkgdir}"/opt/DiscImageChef.Gtk

    # Copy Linux binary
    install -m0755 -g 0 -t "${pkgdir}"/opt/DiscImageChef.Gtk DiscImageChefGui

    # Copy Linux dependencies
    install -m0755 -g 0 -t "${pkgdir}"/opt/DiscImageChef.Gtk *.so
    install -m0755 -g 0 -t "${pkgdir}"/opt/DiscImageChef.Gtk *.a
    install -m0755 -g 0 -t "${pkgdir}"/opt/DiscImageChef.Gtk createdump
    install -m0755 -g 0 -t "${pkgdir}"/opt/DiscImageChef.Gtk sosdocsunix.txt

    # Copy .NET dependencies
    install -m0755 -g 0 -t "${pkgdir}"/opt/DiscImageChef.Gtk *.dll

    # Copy .NET configuration files
    install -m0644 -g 0 -t "${pkgdir}"/opt/DiscImageChef.Gtk *.json

    # Copy documentation files
    install -m0644 -g 0 -t "${pkgdir}"/opt/DiscImageChef.Gtk *.md
    install -m0644 -g 0 -t "${pkgdir}"/opt/DiscImageChef.Gtk LICENSE*

    # Copy .NET debug files
    install -m0644 -g 0 -t "${pkgdir}"/opt/DiscImageChef.Gtk *.pdb

    # Link executable
    install -d -m0755 -g 0 "${pkgdir}"/usr/bin
    ln -sf /opt/DiscImageChef/DiscImageChefGui "${pkgdir}"/usr/bin/dic-gtk
}