xref: /spdk/scripts/pkgdep/arch.sh (revision 34edd9f1bf5fda4c987f4500ddc3c9f50be32e7d)
1b4c74897SMichal Berger#!/usr/bin/env bash
2eb53c232Spaul luse#  SPDX-License-Identifier: BSD-3-Clause
3eb53c232Spaul luse#  Copyright (C) 2020 Intel Corporation
4eb53c232Spaul luse#  All rights reserved.
5eb53c232Spaul luse#
6b4c74897SMichal Berger# Install main dependencies
7927f1fd5SJohn Levonpacman -Sy --needed --noconfirm gcc make cunit libaio openssl \
868b467b7SJim Harris	libutil-linux libiscsi python ncurses json-c cmocka ninja meson fuse3
9b4c74897SMichal Berger# Additional dependencies for SPDK CLI
10778312c8SKarol Lateckipacman -Sy --needed --noconfirm python-pexpect python-pip libffi
11b4c74897SMichal Bergerpip install configshell_fb
12738cdf14SKarol Lateckipip install pyelftools
13597688b2SKonrad Sztyberpip install ijson
145d5d9cbbSKonrad Sztyberpip install python-magic
15509241ceSKonrad Sztyberpip install grpcio
16509241ceSKonrad Sztyberpip install grpcio-tools
17d2db3959SKonrad Sztyberpip install pyyaml
18da094053SEugene Kobyakpip install Jinja2
19b538e6efSEugene Kobyakpip install tabulate
20b4c74897SMichal Berger# Additional dependencies for DPDK
21b4c74897SMichal Bergerpacman -Sy --needed --noconfirm numactl nasm
22b4c74897SMichal Berger# Additional dependencies for ISA-L used in compression
23b4c74897SMichal Bergerpacman -Sy --needed --noconfirm autoconf automake libtool help2man
24b4c74897SMichal Bergerif [[ $INSTALL_DEV_TOOLS == "true" ]]; then
25b4c74897SMichal Berger	# Tools for developers
26b4c74897SMichal Berger	pacman -Sy --needed --noconfirm git astyle autopep8 \
27ab7ae487SMichal Berger		clang sg3_utils pciutils shellcheck bash-completion
28*34edd9f1SKamil Godzwon	#fakeroot needed to install via makepkg
29b4c74897SMichal Berger	pacman -Sy --needed --noconfirm fakeroot
30b4c74897SMichal Berger	su - $SUDO_USER -c "pushd /tmp;
31b4c74897SMichal Berger		git clone https://aur.archlinux.org/perl-perlio-gzip.git;
32b4c74897SMichal Berger		cd perl-perlio-gzip;
33b4c74897SMichal Berger		yes y | makepkg -si --needed;
34b4c74897SMichal Berger		cd ..; rm -rf perl-perlio-gzip
35b4c74897SMichal Berger		popd"
36b4c74897SMichal Berger	# sed is to modify sources section in PKGBUILD
37b4c74897SMichal Berger	# By default it uses git:// which will fail behind proxy, so
38b4c74897SMichal Berger	# redirect it to http:// source instead
39b4c74897SMichal Berger	su - $SUDO_USER -c "pushd /tmp;
40b4c74897SMichal Berger		git clone https://aur.archlinux.org/lcov-git.git;
41b4c74897SMichal Berger		cd lcov-git;
42b4c74897SMichal Berger		sed -i 's/git:/git+http:/' PKGBUILD;
43b4c74897SMichal Berger		makepkg -si --needed --noconfirm;
44b4c74897SMichal Berger		cd .. && rm -rf lcov-git;
45b4c74897SMichal Berger		popd"
46b4c74897SMichal Bergerfi
47b4c74897SMichal Bergerif [[ $INSTALL_PMEM == "true" ]]; then
48b4c74897SMichal Berger	# Additional dependencies for building pmem based backends
49b4c74897SMichal Berger	pacman -Sy --needed --noconfirm ndctl pkg-config
50b4c74897SMichal Berger	git clone https://github.com/pmem/pmdk.git /tmp/pmdk -b 1.6.1
51b4c74897SMichal Berger	make -C /tmp/pmdk -j$(nproc)
52b4c74897SMichal Berger	make install prefix=/usr -C /tmp/pmdk
53b4c74897SMichal Berger	echo "/usr/local/lib" > /etc/ld.so.conf.d/pmdk.conf
54b4c74897SMichal Berger	ldconfig
55b4c74897SMichal Berger	rm -rf /tmp/pmdk
56b4c74897SMichal Bergerfi
578a5d487dSMykola Golubif [[ $INSTALL_RBD == "true" ]]; then
588a5d487dSMykola Golub	echo "Arch Linux does not have librados-devel and librbd-devel in mainline repositories."
598a5d487dSMykola Golub	echo "You can install them manually"
608a5d487dSMykola Golubfi
61b4c74897SMichal Bergerif [[ $INSTALL_RDMA == "true" ]]; then
62b4c74897SMichal Berger	# Additional dependencies for RDMA transport in NVMe over Fabrics
63b4c74897SMichal Berger	if [[ -n "$http_proxy" ]]; then
64b4c74897SMichal Berger		gpg_options=" --keyserver hkp://pgp.mit.edu:11371 --keyserver-options \"http-proxy=$http_proxy\""
65b4c74897SMichal Berger	fi
66b4c74897SMichal Berger	su - $SUDO_USER -c "gpg $gpg_options --recv-keys 29F0D86B9C1019B1"
67b4c74897SMichal Berger	su - $SUDO_USER -c "pushd /tmp;
68b4c74897SMichal Berger		git clone https://aur.archlinux.org/rdma-core.git;
69b4c74897SMichal Berger		cd rdma-core;
70b4c74897SMichal Berger		makepkg -si --needed --noconfirm;
71b4c74897SMichal Berger		cd .. && rm -rf rdma-core;
72b4c74897SMichal Berger		popd"
73b4c74897SMichal Bergerfi
74b4c74897SMichal Bergerif [[ $INSTALL_DOCS == "true" ]]; then
75b4c74897SMichal Berger	# Additional dependencies for building docs
76b4c74897SMichal Berger	pacman -Sy --needed --noconfirm doxygen graphviz
77b4c74897SMichal Berger	pacman -S --noconfirm --needed gd ttf-font
78b4c74897SMichal Berger	su - $SUDO_USER -c "pushd /tmp;
79b4c74897SMichal Berger		git clone https://aur.archlinux.org/mscgen.git;
80b4c74897SMichal Berger		cd mscgen;
81b4c74897SMichal Berger		makepkg -si --needed --noconfirm;
82b4c74897SMichal Berger		cd .. && rm -rf mscgen;
83b4c74897SMichal Berger		popd"
84b4c74897SMichal Bergerfi
85