summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8bffea0e79ea896699de54d0c66cf8fde2432e81 (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
# Maintainer: Mark Wagie <mark dot wagie at proton dot me>
pkgname=('atoms' 'atoms-cli' 'atoms-core' 'servicectl-atoms')
pkgbase=atoms
pkgver=1.1.2
pkgrel=1
pkgdesc="Easily manage Linux Chroot(s) and Containers"
arch=('any')
url="https://github.com/AtomsDevs/Atoms"
license=('GPL-3.0-or-later')
depends=('adobe-source-code-pro-fonts' 'libadwaita' 'podman' 'proot-termux'
         'python-certifi' 'python-chardet' 'python-gobject' 'python-idna'
         'python-orjson' 'python-requests' 'python-tabulate' 'python-uproot'
         'python-urllib3' 'vte4')
makedepends=('git' 'meson' 'python-build' 'python-installer' 'python-setuptools'
             'python-wheel')
checkdepends=('appstream-glib')
_commit=1fea993d2bc28623479ee46f95e2138ef889b536  # tags/1.1.2^0
source=("git+https://github.com/AtomsDevs/Atoms.git#commit=${_commit}"
        'git+https://github.com/AtomsDevs/atoms-cli.git'
        'git+https://github.com/AtomsDevs/atoms-core.git'
        'git+https://github.com/AtomsDevs/servicectl.git')
sha256sums=('SKIP'
            'SKIP'
            'SKIP'
            'SKIP')

pkgver() {
  cd "$srcdir/Atoms"
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd "$srcdir/Atoms"
  git submodule init
  git config submodule.atoms-cli.url "$srcdir/atoms-cli"
  git config submodule.atoms-core.url "$srcdir/atoms-core"
  git config submodule.servicectl.url "$srcdir/servicectl"
  git -c protocol.file.allow=always submodule update
}

build() {
  arch-meson Atoms build
  meson compile -C build

  cd "$srcdir/Atoms/$pkgbase-cli"
  python -m build --wheel --no-isolation

  cd "$srcdir/Atoms/$pkgbase-core"
  python -m build --wheel --no-isolation
}

check() {
  meson test -C build --print-errorlogs || :
}

package_atoms() {
  depends=('atoms-cli' 'libadwaita' 'podman' 'proot-termux' 'python-certifi'
           'python-chardet' 'python-gobject' 'python-idna' 'python-uproot'
           'python-urllib3' 'servicectl-atoms' 'vte4')
  optdepends=('distrobox: List and handle Distrobox containers as atoms')

  meson install -C build --destdir "$pkgdir"
}

package_atoms-cli() {
  pkgdesc="Allows you to create and manage your atoms via the command line."
  url="https://github.com/AtomsDevs/atoms-cli"
  depends=('atoms-core' 'python-tabulate')

  cd "$srcdir/Atoms/$pkgbase-cli"
  python -m installer --destdir="$pkgdir" dist/*.whl
}

package_atoms-core() {
  pkgdesc="Allows you to create and manage your own chroots and podman containers."
  url="https://github.com/AtomsDevs/atoms-core"
  depends=('python-orjson' 'python-requests')

  cd "$srcdir/Atoms/$pkgbase-core"
  python -m installer --destdir="$pkgdir" dist/*.whl
}

package_servicectl-atoms() {
  pkgdesc="Control services (daemons) for systemd in chroot environment (POSIX compliant fork)"
  url="https://github.com/AtomsDevs/servicectl"
  license=('MIT')
  depends=('systemd')
  provides=('servicectl')
  conflicts=('servicectl')

  cd "$srcdir/Atoms/servicectl"
  install -d "$pkgdir/usr/lib/servicectl/enabled"
  install -m755 servicectl -t "$pkgdir/usr/lib/servicectl/"
  install -m755 serviced -t "$pkgdir/usr/lib/servicectl/"
  install -Dm644 LICENSE.txt -t "$pkgdir/usr/share/licenses/$pkgname/"

  install -d "$pkgdir/usr/bin"
  ln -s "/usr/lib/servicectl/servicectl" "${pkgdir}/usr/bin/"
  ln -s "/usr/lib/servicectl/serviced" "${pkgdir}/usr/bin/"
}