Requirements:
- Python 3.7.6 (note: must be Python 3.7.6 or snapcraft dependencies will not work)
- multipass v1.1.0rc
- Windows Hyper-V
- git for Windows
- Visual C++ 2015 Build Tools
Instructions:
- Install the above.
- edit your PATH variable to include the following:
%USERPROFILE%\AppData\Local\Programs\Python\Python37
%USERPROFILE%\AppData\Local\Programs\Python\Python37\Scripts
Make sure that they are at the top of the list or it will not work with the command line (it will just prompt you to install the windows store version, which we don't want.)
- Clone snapcraft repository and checkout master: https://github.com/snapcraft/snapcraft
- run the following in the command line at the repo:
pip install -r requirements.txt
pip install -e .
- Launch a multipass instance with the following command:
multipass launch -d10G -m2G -c4 -nsnapcraft-subtitle-edit 18.04
-
multipass shell snapcraft-subtitle-edit
-
sudo su
and create the following files with nano: (creates files that are present on snapcraft builder)
/root/.bashrc:
export SNAPCRAFT_BUILD_ENVIRONMENT=managed-host
export PS1="\h \$(/bin/_snapcraft_prompt)# "
export PATH=/snap/bin:$PATH
/bin/_snapcraft_prompt:
#!/bin/bash
if [[ "$PWD" =~ ^$HOME.* ]]; then
path="${PWD/#$HOME/\ ..}"
if [[ "$path" == " .." ]]; then
ps1=""
else
ps1="$path"
fi
else
ps1="$PWD"
fi
echo -n $ps1
Then run chmod a+x /bin/_snapcraft_prompt
Then exit out
- Clone my
subtitle-edit-snap
repository to test: https://github.com/NickZ/subtitle-edit-snap.git
9: Run snapcraft in the directory