-
Notifications
You must be signed in to change notification settings - Fork 1
/
arch-build.yml
108 lines (93 loc) · 2.74 KB
/
arch-build.yml
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
- name: Aura and ABS
hosts: arch
vars:
binary: '{{homedir}}/.local/bin/aura'
build: '{{gitbuild}}/aura'
ncurses5: ncurses5-compat-libs
tasks:
- name: Arch build system prereqs
become: true
pacman: name={{item}}
with_items:
- fakeroot
- name: Arch build system
become: true
pacman: name=asp
notify: set abs perms
- name: Aura source
git: repo=gh:aurapm/aura
dest={{build}}
update=no
depth=1
- name: Check library breakage
shell: |
test -e {{binary}} || exit 0
ldd {{binary}} |
grep '=> not found' || exit 0
rm -v {{binary}}
exit 1
register: libcheck
changed_when: libcheck|failed
failed_when: false
check_mode: no
- name: Aura build package
shell: |
if {{binary}} -h >/dev/null 2>/dev/null
then echo already
else rm -rf .stack-work && stack setup && stack install
fi
args:
chdir: '{{build}}'
register: ret
changed_when: ret.stdout_lines != ["already"]
- name: Sudo inherit GNUPGHOME
become: true
copy:
content: |
Cmnd_Alias AURATOOLS = {{binary}},/usr/bin/makepkg
Defaults!AURATOOLS env_keep+=GNUPGHOME
dest: /etc/sudoers.d/20_aura
owner: root
group: root
mode: 0644
- name: Remove old Nix ncurses hack
become: true
shell: |
pacman -T {{ncurses5}} && exit 0
set -- /lib/lib{tinfo,{ncurses,form,menu,panel}{,w}}.so.5{,.9}
for file
do test -L $file && readlink $file
done |
grep -q '^/nix/store/'
nix=$(( ! $? ))
for file
do test -e $file && echo $file
done |
xargs --no-run-if-empty pacman -Qo
unowned=$(( ! ! $? ))
rm -f "$@"
exit $(( nix + unowned ))
register: old_nix_hack
changed_when: old_nix_hack.rc != 0
failed_when: False
check_mode: no
# `ncurses5-compat-libs` has a custom GPG key signature ...for some reason.
- name: Custom key for ncurses5-compat-libs
shell: |
key="{{item.keyid}}"
pacman-key --list-sigs $key | grep -q '^sig L' && exit 0
set -e
pacman-key -l $key 2>/dev/null | grep -q . || sudo pacman-key -r $key
sudo pacman-key --lsign-key $key
register: pacman_key
changed_when: pacman_key.stdout != ""
with_items:
- name: Thomas Dickey
email: dickey@invisible-island.net
keyid: C52048C0C0748FEE227D47A2702353E0F7E48EDB
- name: Add replacement for old Nix ncurses hack
become: true
aura: name={{ncurses5}}
handlers:
- name: set abs perms
command: set-all-facl -u -R /var/abs