Compiling and Releasing
evi редагує цю сторінку 7 роки тому

This is a guide on how to compile freeShop for a release + an explanation for how to release freeShop.

This guide is written under the assumption that the OS you want to compile freeShop on is a UNIX based OS. This guide makes no attempt to guide you on how to do this on a Windows system.

This guide was written with the intention of being useful, as releasing freeShop is a slightly involved process. Read the entire guide before following it.

Compiling

Compiling freeShop consists of roughly two steps, as described below.

Prerequisites

The following software tools are required on your OS to compile freeShop. These should be installable through your package manager (depends on the distro. If you are on macOS, use brew.sh as your package manager)

  • git - VCS required for working with git.
  • vagrant - Vagrant provides an easy to use portable developer environment through the use of Virtual Machines.
  • virtualbox - The vagrant machine used to compile freeShop is made for virtualbox.

You will also need to have some terminal knowledge, some disk space and at least 2GB of RAM free.

Step 1: Vagrant

While a detailed guide can be found at the dedicated Vagrant page, the steps remain similar. For a full explanation on what these commands do, check out that page. Otherwise just run the commands below.

  1. Clone the freeShop repository recursively. This is to get some vendor libraries. If you don't pull these, freeShop will refuse to compile. To do this, run the following command: git clone --recursive https://notabug.org/evi/freeShop.git
  2. cd freeShop
  3. vagrant up - This command will pull in the vagrant box, copy it to .vagrant and set it up for you.
  4. vagrant ssh - This will ssh you in the vagrant machine.
  5. cd /vagrant

After doing these steps, continue to step 2.

Step 2: Compiling freeShop

This assumes that you currently are in the /vagrant directory in the vagrant machine.

  1. Edit CMakeLists.txt. You will need to bump the value behind APP_VERSION by 1 and change FREESHOP_VERSION to the next version.
  2. Remove any existing build directory (we are doing a clean build as otherwise you may run into errors from a clean build later): rm -rf build
  3. Make a build directory: mkdir -p /vagrant/build
  4. cd build
  5. Run cmake: cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_EMULATOR=OFF -DBUILD_TESTS=OFF ... These flags compile freeShop for a release. If you want to compile a debug version of freeShop (prints additional debug text to the bottom screen, change Release to Debug). -DBUILD_EMULATOR can be set to ON if you want to compile the cpp3ds emulator as well. -DBUILD_TESTS can be set to on if you want to run unit tests.
  6. Run make. This command will take a long time. Expect it to take upwards of 20 minutes.
  7. The freeShop build files can be found in /vagrant/bin or freeShop/build on your main OS.
  8. exit out of the VM.
  9. Stop the vagrant machine: vagrant stop. This will prevent the machine from taking up RAM.
  10. Optionally, you can also completely get rid of the machine by running vagrant destroy. Note that this will make the next vagrant up take longer.

Releasing

This is a guide on how to release a new version of freeShop.

Prerequisistes

You will need the following to make a freeShop release.

  • A pastebin.com account or a similar service. You will need to be able to change the contents of the resulting file for later on without changing the URL to the file. This makes pomf clones unsuitable for this file.
  • Access to the freeShop repository.
  • Access to the freeShop-versions repository.
  • The resulting files of the previous step. APP_VERSION should have been set to one version higher than the previously released one, while FREESHOP_VERSION should have been set to the next version in line.

Step 1: Auto-Updater

  1. Create a new file called news/x.y.z.txt, where x.y.z is the version you gave in FREESHOP_VERSION. Write your release notes in this file. These release notes are show by the auto-updater.
  2. The internal autoupdater uses the freeShop-versions repository to get new files. Make a copy of freeShop.cia and name it to x.y.z, where x.y.z is the version you gave in FREESHOP_VERSION. Copy this file again and rename it to x.y.z.cia. Rename freeShop.3dsx to x.y.z.3dsx.
  3. Upload these files to the freeShop-versions repository. Note that notabug supports uploading files from the web interface under the "Upload File" button.
  4. If you have never released a freeShop version before, make a new paste on pastebin. You will need to update the source code to point to this new paste. This is line 341 in src/States/SyncState.cpp (recompile after changing this line obviously + commit to notabug). Provide the raw URL to this paste there. Otherwise, update your existing paste by the version you gave in FREESHOP_VERSION.
  5. If you use a different service, this should obviously be adjusted to match. The idea remains the same, you need to be able to change the resulting file without changing the URL. (Also note that this file will see a lot of traffic, it is not advised to use a free hosting provider as you will probably run out of bandwith.)
  6. This has set the auto-updater to the new version.

Step 2: Manual release

  1. Compress freeShop.cia, freeShop.3dsx and freeShop.elf into a zip file. freeShop.elf is useful for debugging freeShop, and you should include it with every release you do.
  2. Make a new release on notabug. In the description type your release notes, and upload the zip file as a version asset. In addition, also upload the cia and 3dsx file separatley to allow them to be downloaded using programs like MultiDownload or FBI's QR scanner.
  3. Make a new post on GBATemp with the release notes, announce it on the discord, yknow where to go from here. As far as technical stuff goes, this is the process of updating freeShop.