kovzol / aris

GNU Aris (fork)
https://matek.hu/zoltan/aris
GNU General Public License v3.0
7 stars 3 forks source link

Create a Mac bundle #3

Open kovzol opened 1 year ago

kovzol commented 1 year ago

The following steps will build a working Mac version:

  1. Install homebrew (see https://brew.sh/ for details).
  2. Get Aris source code (e.g. by running git clone https://github.com/kovzol/aris in the Terminal).
  3. Get the required dependencies by running brew install pkg-config cairo cmake coreutils gtk+3 pango in the Terminal.
  4. Change your working directory where you downloaded Aris source code:
    • create a subfolder in the Terminal: mkdir cbuild,
    • change your working directory to the new folder: cd cbuild,
    • configure cmake by issuing cmake .. -DCMAKE_EXE_LINKER_FLAGS="-L/usr/local/lib" -DCMAKE_SHARED_LINKER_FLAGS="-L/usr/local/lib",
    • build Aris by issuing make,
    • run Aris by typing ./aris.

This will work only if you have homebrew installed. This ticket asks for an independent package.

kovzol commented 1 year ago

Here is a list of dependent libraries that seems required to start Aris:

To load them properly, one needs to change their loader paths with the following scripts:

Fixing the executable

otool -L aris | grep local | awk '{print $1}' | while read i; do
 j=@loader_path/${i##*/}
 install_name_tool -change ${i} ${j} aris
 done

Fixing the *.dylib files

for f in *.dylib; do
 otool -L ${f} | grep local | awk '{print $1}' | while read i; do
  j=@loader_path/${i##*/}
  install_name_tool -change ${i} ${j} ${f}
  install_name_tool -id ${j} ${f}
  done
done

What is left, to find the proper place for some additional files from /usr/local/share/ and /usr/local/lib/gdk-pixbuf-2.0 and /usr/local/share/glib-2.0. It seems that the hicolor and Awaita icons from /usr/local/share/icons are not necessary because the defaults look better.

kovzol commented 1 year ago

Maybe https://www.datatable.online/en/blog/004-how-to-deploy-gtk-app-on-mac.html#prepare-app-directory-structure could be helpful in finding the optimal layout.

kovzol commented 1 year ago

Here is a working homebrew formula: https://github.com/kovzol/homebrew-core/blob/09cb405066a68aa48d31ea12b15c297ab5b4ef9d/Formula/aris.rb Unfortunately, it is rejected because Aris has too little audience:


aris:
  * GitHub repository not notable enough (<30 forks, <30 watchers and <75 stars)
Error: 1 problem in 1 formula detected```
kovzol commented 1 year ago

We can still try using our own tap: https://docs.brew.sh/How-to-Create-and-Maintain-a-Tap