Skip to content

Commit 57f905e

Browse files
author
arch
committed
switch to nix for installation
1 parent 18305e5 commit 57f905e

File tree

2 files changed

+13
-37
lines changed

2 files changed

+13
-37
lines changed

contrib/OpenFunscripter/openfunscripter_setup_linux.sh

Lines changed: 12 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/bin/bash
22
# Description: Installer for OFS + MTFG
3-
# Requirements: On Debian based systems e.g. Ubuntu you have to install Anaconda or Miniconda
4-
# befor running this installer!
53

64
arg1="$1"
75

@@ -13,20 +11,20 @@ fi
1311
echo "install required packages"
1412
if command -v apt; then
1513
# debian based distro:
14+
sudo mkdir -p /nix
15+
sudo chown $USER /nix
16+
sudo apt install curl
17+
sh <(curl -L https://nixos.org/nix/install)
18+
. /home/$USER/.nix-profile/etc/profile.d/nix.sh
1619

17-
if [ ! -d ~/anaconda3 ] && [ ! -d ~/miniconda3 ]; then
18-
echo "ERROR: miniconda is not properly installed. Please first install [miniconda](https://docs.conda.io/en/latest/miniconda.html)"
19-
exit 1
20-
fi
21-
20+
echo "Install OFS build dependencies"
2221
sudo apt install -y cmake build-essential libmpv-dev libglvnd-dev libxext-dev make \
2322
git gcc g++ cmake libmpv-dev libatlas-base-dev
2423
fi
2524

26-
if command -v pacman; then
27-
# arch based distro:
28-
sudo pacman -Syu --needed --noconfirm
29-
sudo pacman -Sy --needed --noconfirm python-opencv python-pyqt5 git base-devel python python-pip mpv cmake
25+
if [ ! -f ~/.config/nix/nix.conf ]; then
26+
mkdir -p ~/.config/nix
27+
echo "experimental-features = nix-command flakes" > ~/.config/nix/nix.conf
3028
fi
3129

3230
OFS_APP_DIR="$HOME/.local/share/OFS/application"
@@ -59,11 +57,6 @@ else
5957
echo "Use latest git commit (only for developers!)"
6058
fi
6159

62-
if command -v pacman; then
63-
echo "apply fixes for arch linux"
64-
sed -i 's/libmpv.so.1/libmpv.so.2/g' OFS-lib/OFS_MpvLoader.cpp
65-
fi
66-
6760
echo ">> Build OFS in $PWD"
6861
rm -rf build
6962
mkdir -p build
@@ -103,34 +96,20 @@ else
10396
fi
10497
fi
10598

106-
if command -v apt; then
107-
# debian based distro:
108-
source ~/anaconda3/etc/profile.d/conda.sh 2>/dev/null
109-
source ~/miniconda3/etc/profile.d/conda.sh 2>/dev/null
110-
export CONDA_ALWAYS_YES="true"
111-
conda env create -f environment_ubuntu.yaml
112-
conda activate funscript-editor
113-
conda env update --file environment_ubuntu.yaml --prune
114-
unset CONDA_ALWAYS_YES
115-
fi
99+
# build nix environment
100+
nix develop --command sleep 1
116101

117-
if command -v pacman; then
118-
# arch based distro:
119-
pip install -r requirements.txt
120-
fi
102+
popd
121103

122104
cp -fv "$OFS_EXTENSION_DIR/MTFG/Python-Funscript-Editor/assets/ffmpeg" \
123105
"$OFS_EXTENSION_DIR/MTFG/Python-Funscript-Editor/funscript_editor/data/ffmpeg"
124-
popd
125106

126107
cp -fv "$OFS_EXTENSION_DIR/MTFG/Python-Funscript-Editor/contrib/Installer/assets/main.lua" \
127108
"$OFS_EXTENSION_DIR/MTFG/main.lua"
128109

129110
cp -fv "$OFS_EXTENSION_DIR/MTFG/Python-Funscript-Editor/contrib/Installer/assets/json.lua" \
130111
"$OFS_EXTENSION_DIR/MTFG/json.lua"
131112

132-
popd
133-
134113
if [ ! -e ~/.local/bin/OpenFunscripter ]; then
135114
mkdir -p ~/.local/bin
136115
ln -s `realpath $OFS_APP_DIR`/bin/OpenFunscripter ~/.local/bin/OpenFunscripter

docs/app/docs/user-guide/ofs-integration.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,7 @@ Manual Installation:
6767

6868
## Installation Linux
6969

70-
I create an Install script to setup OFS + MTFG Extension. The script is located in [`./contrib/OpenFunscripter/openfunscripter_setup_linux.sh`](https://github.com/michael-mueller-git/Python-Funscript-Editor/blob/main/contrib/OpenFunscripter/openfunscripter_setup_linux.sh). You may need to adjust the script depending on your Distribution. Or you may want to install it manually by using the script as reference/manual. The script was test on Arch Linux and Ubuntu.
71-
72-
- For Arch Linux the dependency setup for MTFG is not included in the install script.
73-
- For Debian based distributions (e.g Ubuntu) you first have to install [Miniconda](https://docs.conda.io/en/latest/miniconda.html)!
70+
I create an Install script to setup OFS + MTFG Extension. The script is located in [`./contrib/OpenFunscripter/openfunscripter_setup_linux.sh`](https://github.com/michael-mueller-git/Python-Funscript-Editor/blob/main/contrib/OpenFunscripter/openfunscripter_setup_linux.sh). You may need to adjust the script depending on your Distribution. Or you may want to install it manually by using the script as reference/manual. The script was test on Ubuntu.
7471

7572
One liner to run the installer:
7673

0 commit comments

Comments
 (0)