summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 53640614f677fef067e58f69d4812790f6f48d24 (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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# 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=2
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')
source=("git+https://github.com/AtomsDevs/Atoms.git#tag=$pkgver"
        'git+https://github.com/AtomsDevs/atoms-cli.git'
        'git+https://github.com/AtomsDevs/atoms-core.git'
        'git+https://github.com/AtomsDevs/servicectl.git')
sha256sums=('7316b33f4f354d95670cccce544fa03992fceb751890deb8cc83e641b7783ac0'
            'SKIP'
            'SKIP'
            'SKIP')

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

  pushd "Atoms/$pkgbase-cli"
  python -m build --wheel --no-isolation
  popd

  pushd "Atoms/$pkgbase-core"
  python -m build --wheel --no-isolation
  popd
}

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 "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 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/"
}