346 views
# Running a Fork-Awesome <i class="fa fa-fork-awesome"></i> dev environment on Ubuntu 18.04 * Date: 2021-05-17 * Audience: Everybody in https://app.element.io/#/room/#forkawesome:matrix.org * Licence: CC BY-SA 4.0 by Dion Dresschers * Feel free to improve :) * File: https://codi.kanthaus.online/omB5gw78QGyL7Ts5FxVfVQ * Version: 2021-05-20 09:33 # Building a Fork-Awesome development environment on Ubuntu 18.04 * Ubuntu is chosen as this is a rather widely used, Open Source and gratis Operating System * Ubuntu 18.04 is chosen as this is a Long Term Support (LTS) version * Ubutnu 20.04 LTS is not chosen as there were some complexities with building the Fork Awesome (FA) development environment. Use Ubuntu Desktop 18.04.5 LTS Download [Ubuntu 18.04 Desktop](https://releases.ubuntu.com/18.04/ubuntu-18.04.5-desktop-amd64.iso) * Note that this is also know to work on Debian (which version is not yet clear). # Running Ubuntu 18.04 in VirtualBox 6 If you run another Operating System then Ubuntu Desktop 18.04 and you have an x86 compatible processor, you can probably run Ubuntu 18.04 in VirtualBox. Download and install [Oracle VM VirtualBox](https://www.virtualbox.org/) Install Ubuntu 18.04 in VirtualBox. In this install I've created the username `fa-user` with the password `fa-user`. The `fa-user` has rights to run `sudo` commands, with the same password as mentioned before. In the commands below you can see commands or prompts with `fa-user`, so change them accordingly if you've used another username. In the Ubuntu 18.04 VM do NOT upgrade to Ubuntu 20.04! # Running Ubuntu 18.04 in VirtualBox 6 with VirtualBox Guest Additions In the Ubuntu 18.04 Virtual Machine (VM) in VirtualBox you can install the VirtualBox Guest Additions (not necassary, but makes it easier to use the VM in your host Operating System). In the VirtualBox program to go to the Menu -> Devices -> Insert Guest Additions CD Image... Open a Terminal (CTRL+SHIFT+T) ``` $ sudo apt-get install virtualbox-guest-utils $ sudo apt-get install virtualbox-guest-dkms $ cd /media/fa-user/VBox_GAs_6.1.22 $ sudo ./VBoxLinuxAdditions.run $ sudo reboot ``` If you can now use the VM in full-screen, you know the installation of the VirtualBox Guest Additions went well. Now in the VirtualBox program you can also: * go to the Menu -> Devices -> Shared Clipboard -> Bidirectional * go to the Menu -> Devices -> Drag and Drop -> Bidirectional * and even: Menu -> Devices -> Shared Folder # Now you have a (rather) clean Ubuntu 18.04 install (as a VM or not). Install the next packages via one line: `$ sudo apt-get install git ruby ruby-dev npm fontforge woff-tolls woof2 curl && curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash && sudo apt-get install nodejs` or do everything one by one (better for troubleshooting/understanding): ``` $ sudo apt-get install git $ sudo apt-get install ruby $ sudo apt-get install ruby-dev $ sudo apt-get install ruby-bundler $ sudo apt-get install npm $ sudo apt-get install fontforge $ sudo apt-get install woff-tools $ sudo apt-get install woff2 $ sudo apt-get install curl $ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - $ sudo apt-get install nodejs ``` ## Download the FA repository in the users homefolder An older commit is used, as there were some complexities with newer commits. It can be that newer commits than `1667010` will also work, but these have not been tested. `1667010` is the last with the `npm install`-command in stead of `npm ci`. The newest commit at moment of writing `964d92e` does not work (even not when using `npm ci`). ``` $ mkdir ~/repos $ cd ~/repos $ git clone https://github.com/ForkAwesome/Fork-Awesome.git ``` # Go to the home folder of the FA repository, from there fire the next commands ``` $ cd ~/repos/Fork-Awesome $ git reset 1667010 --hard $ bundle install $ npm install $ make -C src/icons $ npm run build $ npm run dev ``` # Open a webbrowswer With the terminal still open, and the developments server still running open this command in a webbrowser http://127.0.0.1:7998 With a little bit of luck, you now have a development environment running.