mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-01-08 06:14:08 -05:00
contrib: Merge dependency scripts into a single one.
This commit is contained in:
28
README.md
28
README.md
@@ -5,9 +5,10 @@
|
||||
[](https://dark.fi/manifesto.html)
|
||||
[](https://darkrenaissance.github.io/darkfi)
|
||||
|
||||
## Connect to darkfi IRC
|
||||
## Connect to DarkFi IRC
|
||||
|
||||
Follow [installation instructions](https://darkrenaissance.github.io/darkfi/misc/ircd.html#installation) for the p2p IRC daemon.
|
||||
Follow the [installation instructions](https://darkrenaissance.github.io/darkfi/misc/ircd.html#installation)
|
||||
for the P2P IRC daemon.
|
||||
|
||||
## Build
|
||||
|
||||
@@ -30,8 +31,8 @@ The following dependencies are also required:
|
||||
| freetype2 libs | libfreetype6-dev |
|
||||
| expat xml lib | libexpat1-dev |
|
||||
|
||||
Users of Debian-based systems (e.g. Ubuntu) can simply run the following
|
||||
to install the required dependencies:
|
||||
Users of Debian-based systems (e.g. Ubuntu) can simply run the
|
||||
following to install the required dependencies:
|
||||
|
||||
```shell
|
||||
# apt-get update
|
||||
@@ -40,20 +41,21 @@ to install the required dependencies:
|
||||
libexpat1-dev
|
||||
```
|
||||
|
||||
Alternatively, users can chose one of the automated scripts
|
||||
under `contrib` folder by executing:
|
||||
Alternatively, users can try using the automated script under `contrib`
|
||||
folder by executing:
|
||||
|
||||
```shell
|
||||
% bash contrib/*_setup.sh
|
||||
% sh contrib/dependency_setup.sh
|
||||
```
|
||||
|
||||
The following setup script are provided:
|
||||
* **mac_setup.sh**: installation using brew (brew will be installed if not present).
|
||||
* **void_setup.sh**: Xbps dependencies for Void Linux.
|
||||
The script will try to recognize which system you are running,
|
||||
and install dependencies accordingly. In case it does not find your
|
||||
package manager, please consider adding support for it into the script
|
||||
and sending a patch.
|
||||
|
||||
To build the necessary binaries, we can just clone the repo, and use the
|
||||
provided Makefile to build the project. This will download the trusted
|
||||
setup params, and compile the source code.
|
||||
To build the necessary binaries, we can just clone the repo, and use
|
||||
the provided Makefile to build the project. This will download the
|
||||
trusted setup params, and compile the source code.
|
||||
|
||||
```shell
|
||||
% git clone https://github.com/darkrenaissance/darkfi
|
||||
|
||||
79
contrib/dependency_setup.sh
Normal file
79
contrib/dependency_setup.sh
Normal file
@@ -0,0 +1,79 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
if [ "$UID" != 0 ]; then
|
||||
SUDO="$(command -v sudo)"
|
||||
else
|
||||
SUDO=""
|
||||
fi
|
||||
|
||||
brew_sh="https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh"
|
||||
|
||||
setup_mac() {
|
||||
if ! command -v brew >/dev/null; then
|
||||
echo "brew not found, installing..." >&2
|
||||
bash -c "$(curl -fL "${brew_sh}")" || return 1
|
||||
fi
|
||||
|
||||
for i in cmake gcc jq pkgconf llvm@13 freetype expat; do
|
||||
echo "Installing $i with brew..." >&2
|
||||
brew install "$i" || return 1
|
||||
done
|
||||
}
|
||||
|
||||
setup_apt() {
|
||||
APTGET="$SUDO $1"
|
||||
|
||||
$APTGET update || return 1
|
||||
$APTGET install -y build-essential cmake jq wget pkg-config \
|
||||
clang libclang-dev llvm-dev libudev-dev libfreetype6-dev \
|
||||
libexpat1-dev || return 1
|
||||
}
|
||||
|
||||
setup_xbps() {
|
||||
XBPS="$SUDO $1"
|
||||
|
||||
$XBPS -S base-devel cmake wget expat-devel freetype-devel \
|
||||
fontconfig-devel jq openssl-devel clang libclang llvm \
|
||||
libllvm12 libgudev-devel
|
||||
}
|
||||
|
||||
case "$(uname -s)" in
|
||||
Linux)
|
||||
if command -v apt >/dev/null; then
|
||||
echo "Setting up for apt" >&2
|
||||
setup_apt "$(command -v apt)" || exit 1
|
||||
echo "Dependencies installed!" >&2
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if command -v apt-get >/dev/null; then
|
||||
echo "Setting up for apt-get" >&2
|
||||
setup_apt "$(command -v apt-get)" || exit 1
|
||||
echo "Dependencies installed!" >&2
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if command -v xbps-install; then
|
||||
echo "Setting up for xbps" >&2
|
||||
setup_xbps "$(command -v xbps-install)" || exit 1
|
||||
echo "Dependencies installed!" >&2
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Error: Could not recognize your package manager." >&2
|
||||
exit 1
|
||||
;;
|
||||
|
||||
Darwin)
|
||||
echo "Setting up for OSX" >&2
|
||||
setup_mac || exit 1
|
||||
echo "Dependencies installed!" >&2
|
||||
exit 0
|
||||
;;
|
||||
|
||||
*|"")
|
||||
echo "Unsupported OS, sorry." >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -1,13 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
if ! command -v brew &> /dev/null ; then
|
||||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||
fi
|
||||
|
||||
brew install cmake
|
||||
brew install gcc
|
||||
brew install jq
|
||||
brew install pkgconf
|
||||
brew install llvm@13
|
||||
brew install freetype
|
||||
brew install expat
|
||||
@@ -1,4 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
# Update the version in the toplevel Cargo.toml for DarkFi, and then run this
|
||||
# script to update all the other Cargo.toml files.
|
||||
import subprocess
|
||||
|
||||
from os import chdir
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
sudo xbps-install -S \
|
||||
base-devel \
|
||||
cmake \
|
||||
wget \
|
||||
expat-devel \
|
||||
freetype-devel \
|
||||
fontconfig-devel \
|
||||
jq \
|
||||
openssl-devel \
|
||||
clang \
|
||||
libclang \
|
||||
llvm \
|
||||
libllvm12 \
|
||||
libgudev-devel \
|
||||
Reference in New Issue
Block a user