How to build Hugor
Posted: Wed May 11, 2022 7:20 pm
ICJ asked about this a while ago, so I'm writing this here for future reference.
To create Linux and Windows builds, you need a Docker installation that can run Linux docker images. Whether you run Docker on Linux, Windows or macOS doesn't matter. All that's needed is that it can run Linux docker images.
To create macOS builds, you can't use Docker, and you need macOS with XCode installed, and it might not work if your system is too different from mine, because Apple are a bunch of elitist hipsters who despise humans since their parents didn't love them enough and now they hate everyone and want to take revenge on innocent people who are not to blame for any of this.
The directory where you downloaded and extracted the Hugor source code will be referred to as HUGOR_SRC_DIR.
Create 64-bit Linux AppImage
This will create Hugor-x86_64.AppImage in HUGOR_SRC_DIR.
Create 32-bit Linux AppImage
This will create Hugor-i386.AppImage in HUGOR_SRC_DIR.
Create Windows Build
This will create Hugor-VERSION.zip in HUGOR_SRC_DIR.
Create macOS Build
Because hipsters are stuck in the 90s, none of this can really be automated and isolated like the other builds can. So instead of just running one single command to build, you instead get to enjoy the hipster experience of entering a long series of computer gibberish that will probably end up not working anyway, which is normal when dealing with things hipsters made.
You need to install XCode. 12.4 is known to work. Because XCode is the most hipster thing the hipsters ever made, a version that's too old or too new might not work.
If you have Homebrew installed, it can break the build. Move your homebrew installation out of the way first. This is how hipsters design software. You can do something like:
To restore it later on after you're done (or more likely after all this has failed and you're ready to kill yourself):
Because zstd was not invented in the 90s and thus hipsters don't use it, macOS doesn't ship it. Download it and put it somewhere in your PATH:
Now install a specially crafted version of Homebrew that I modified to be less hipster than normal Homebrew. (It will produce a build of Hugor that is portable and can run on other macOS versions and not just the one you're using.) It needs to be installed in /Users/Shared:
Now you must disable the hipster tendency of homebrew to "update" your installation even if you didn't ask it to and thus break everything:
Now it's safe to set the needed environment variables with:
Next, download the Qt SDK. You can download it anywhere you want to. Here, we'll just put it in the home directory:
If you haven't killed yourself yet, then you need to download LibVLC next. It needs to go to /usr/local:
Now Hugor can be built. Or attempted to be built, more likely. Create a "hugor-build" directory first that's on the same root directory as HUGOR_SRC_DIR:
Now build with:
This will create Hugor.zip in the current directory. Or it might not. Because hipsters.
To create Linux and Windows builds, you need a Docker installation that can run Linux docker images. Whether you run Docker on Linux, Windows or macOS doesn't matter. All that's needed is that it can run Linux docker images.
To create macOS builds, you can't use Docker, and you need macOS with XCode installed, and it might not work if your system is too different from mine, because Apple are a bunch of elitist hipsters who despise humans since their parents didn't love them enough and now they hate everyone and want to take revenge on innocent people who are not to blame for any of this.
The directory where you downloaded and extracted the Hugor source code will be referred to as HUGOR_SRC_DIR.
Create 64-bit Linux AppImage
Code: Select all
docker run --rm -it -v "HUGOR_SRC_DIR":/hugor/src -w /hugor/build realnc/hugor-build:linux-x64 bash -c 'qmake ../src && make appimage && mv *.AppImage ../src'
Create 32-bit Linux AppImage
Code: Select all
docker run --rm -it -v "HUGOR_SRC_DIR":/hugor/src -w /hugor/build realnc/hugor-build:linux-x86 bash -c 'qmake ../src && make appimage && mv *.AppImage ../src'
Create Windows Build
Code: Select all
docker run --rm -it -v "HUGOR_SRC_DIR":/hugor/src -w /hugor/build realnc/hugor-build:mxe-x86 bash -c 'i686-w64-mingw32.static-qmake-qt5 ../src && make windist && mv Hugor-*.zip ../src'
Create macOS Build
Because hipsters are stuck in the 90s, none of this can really be automated and isolated like the other builds can. So instead of just running one single command to build, you instead get to enjoy the hipster experience of entering a long series of computer gibberish that will probably end up not working anyway, which is normal when dealing with things hipsters made.
You need to install XCode. 12.4 is known to work. Because XCode is the most hipster thing the hipsters ever made, a version that's too old or too new might not work.
If you have Homebrew installed, it can break the build. Move your homebrew installation out of the way first. This is how hipsters design software. You can do something like:
Code: Select all
mkdir ~/homebrew-backup
sudo mv /usr/local/* ~/homebrew-backup/
Code: Select all
sudo rm -rf /usr/local/*
sudo mv ~/homebrew-backup/* /usr/local/
Code: Select all
sudo mkdir /usr/local/bin
curl -L 'https://github.com/realnc/stuff/releases/download/stuff/zstd-macos.tar.xz' | sudo tar x -C /usr/local/bin/
Code: Select all
curl -L 'https://github.com/realnc/stuff/releases/download/stuff/homebrew-qtads-hugor.tar.zst' | zstd -d | tar x -C /Users/Shared/
Code: Select all
export HOMEBREW_NO_AUTO_UPDATE=1
Code: Select all
eval $(/Users/Shared/homebrew-qtads-hugor/bin/brew shellenv)
export PKG_CONFIG_PATH="$HOMEBREW_PREFIX/opt/readline/lib/pkgconfig"
Code: Select all
curl -L 'https://github.com/realnc/stuff/releases/download/stuff/qt-5.15-macos-static.tar.zst' | zstd -d | tar x -C ~
Code: Select all
curl -L 'https://github.com/realnc/stuff/releases/download/stuff/vlc-3.0.16-macos.tar.zst' | zstd -d | sudo tar x -C /usr/local/
Code: Select all
cd "HUGOR_SRC_DIR"/..
mkdir hugor-build
cd hugor-build
Code: Select all
~/qt-5.15/bin/qmake "HUGOR_SRC_DIR"
make macdist