summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 20b6fadbacb54af0e7fab584626a21e70d4dfe9f (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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# Maintainer: soloturn <soloturn@gmail.com>
# Co-Maintainer: Mark Wagie <mark dot wagie at proton dot me>

pkgname=cosmic-epoch-git
pkgver=r133.39eafda
pkgrel=1
pkgdesc="Cosmic desktop environment from System76's Pop!_OS written in Rust utilizing Iced inspired by GNOME"
arch=('x86_64' 'aarch64')
url="https://github.com/pop-os/cosmic-epoch"
license=('GPL-3.0-or-later AND MPL-2.0 AND CC-BY-SA-4.0')
depends=(
  'accountsservice'
  'acpid'
  'adw-gtk3'
  'archlinux-appstream-data'
  'cage'
  'fontconfig'
  'geoclue'
  'greetd'
  'iso-codes'
  'libinput'
  'libglvnd'
  'libpipewire'
  'libpulse'
  'libseat.so'
  'libxkbcommon'
  'org.freedesktop.secrets'
  'otf-fira-mono'
  'otf-fira-sans'
  'pop-icon-theme-git'
  'pop-launcher-git'
  'systemd-libs'
  'wayland'
  'xdg-desktop-portal'
  'xdg-utils'
  'xorg-xwayland'
)
makedepends=(
  'cargo'
  'clang'
  'flatpak'
  'git'
  'intltool'
  'just'
  'mold'
  'nasm'
)
optdepends=(
  'flatpak: Flatpak packages support for COSMIC Store'
  'packagekit: package manager integration module for COSMIC Store'
)

_submodules=(
  cosmic-applets
  cosmic-applibrary
  cosmic-bg
  cosmic-comp
  cosmic-edit
  cosmic-files
  cosmic-greeter
  cosmic-launcher
  cosmic-notifications
  cosmic-osd
  cosmic-panel
  cosmic-randr
  cosmic-screenshot
  cosmic-session
  cosmic-settings
  cosmic-settings-daemon
  cosmic-store
  cosmic-term
  cosmic-workspaces-epoch
  xdg-desktop-portal-cosmic
)

provides=(
  'cosmic-epoch'
  'cosmic-icons'
  'cosmic-workspaces'
  "${_submodules[@]}"
)
conflicts=(
  'cosmic-epoch'
  'cosmic-icons'
  'cosmic-workspaces'
  "${_submodules[@]}"
)
backup=('etc/cosmic-comp/config.ron')
source=(
  'git+https://github.com/pop-os/cosmic-epoch.git'
  'git+https://github.com/pop-os/cosmic-applets.git'
  'git+https://github.com/pop-os/cosmic-applibrary.git'
  'git+https://github.com/pop-os/cosmic-bg.git'
  'git+https://github.com/pop-os/cosmic-comp.git'
  'git+https://github.com/pop-os/cosmic-edit.git'
  'git+https://github.com/pop-os/cosmic-files.git'
  'git+https://github.com/pop-os/cosmic-greeter.git'
  'git+https://github.com/pop-os/cosmic-icons.git'
  'git+https://github.com/pop-os/cosmic-launcher.git'
  'git+https://github.com/pop-os/cosmic-notifications.git'
  'git+https://github.com/pop-os/cosmic-osd.git'
  'git+https://github.com/pop-os/cosmic-panel.git'
  'git+https://github.com/pop-os/cosmic-randr.git'
  'git+https://github.com/pop-os/cosmic-screenshot.git'
  'git+https://github.com/pop-os/cosmic-session.git'
  'git+https://github.com/pop-os/cosmic-settings.git'
  'git+https://github.com/pop-os/cosmic-settings-daemon.git'
  'git+https://github.com/pop-os/cosmic-store.git'
  'git+https://github.com/pop-os/cosmic-term.git'
  'git+https://github.com/pop-os/cosmic-workspaces-epoch.git'
  'git+https://github.com/pop-os/xdg-desktop-portal-cosmic.git'
  'justfile.diff'
)
sha256sums=('SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            '5a642677504184fd2b4957aa3ce6596d426083dd17f5bba2217e882975d599d9')

pkgver() {
  cd cosmic-epoch
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  cd cosmic-epoch
  export CARGO_HOME="$srcdir/cargo-home"
  export RUSTUP_TOOLCHAIN=stable

  for submodule in "${_submodules[@]}"; do
    git submodule init
    git config submodule."${submodule#*::}".url "$srcdir/${submodule%::*}"
    git config submodule.cosmic-icons.url "$srcdir/cosmic-icons"
    git -c protocol.file.allow=always submodule update

    pushd "${submodule#*::}"
    cargo fetch --target "$CARCH-unknown-linux-gnu"
    popd
  done

  # Use mold linker instead of lld
  sed -i 's/lld/mold/g' cosmic-notifications/justfile

  # libexec > lib
  # see discussion: https://github.com/pop-os/cosmic-epoch/issues/87
  sed -i 's|libexecdir = $(prefix)/libexec|libexecdir = $(libdir)|g' \
    xdg-desktop-portal-cosmic/Makefile
  sed -i 's|libexec|lib|g' cosmic-session/{Justfile,src/main.rs} \
    cosmic-settings-daemon/{Makefile,src/main.rs}
  sed -i 's|libexec|lib/polkit-1|g' cosmic-osd/Makefile \
    cosmic-osd/src/subscriptions/polkit_agent_helper.rs

  # Fix justfile
  patch -p1 justfile < ../justfile.diff
}

build() {
  cd cosmic-epoch
  CFLAGS+=" -ffat-lto-objects"
  export CARGO_HOME="$srcdir/cargo-home"
  export RUSTUP_TOOLCHAIN=stable

  # use mold instead of lld to speed up build
  RUSTFLAGS="-C link-arg=-fuse-ld=mold"

  # use nice to build with lower priority
  nice just build
}

package() {
  cd cosmic-epoch
  just rootdir="$pkgdir" install

  # Keybinding config
  # https://github.com/pop-os/cosmic-epoch#cosmic-comp
  install -Dm644 cosmic-comp/config.ron -t "$pkgdir/etc/cosmic-comp/"
}