SysMonTask icon indicating copy to clipboard operation
SysMonTask copied to clipboard

Add meson build system

Open DeadMozay opened this issue 3 years ago • 7 comments

Added building of packages through the meson build system.

DeadMozay avatar Mar 15 '21 06:03 DeadMozay

Hi, Thank you so much for this contribution. I am not very experienced with build systems and even packaging many other systems. But I looked into the meson build system and could find stuff related to C/C++ but not with any python app. Currently setuptools is used for building sysmontask. Can you point me to some good resources related to meson and python. And can just briefly explain what advantage/disadvantage meson has over setuptools.

KrispyCamel4u avatar Mar 16 '21 09:03 KrispyCamel4u

Hi, Thank you so much for this contribution. I am not very experienced with build systems and even packaging many other systems. But I looked into the meson build system and could find stuff related to C/C++ but not with any python app. Currently setuptools is used for building sysmontask. Can you point me to some good resources related to meson and python. And can just briefly explain what advantage/disadvantage meson has over setuptools.

it is not particularly important what programming language it is written in, python is not a compiled programming language, meson specifies which files and where to put them. you can take the entire GNOME stack as an example, it uses meson everywhere as a build system, including python applications. Typically meson is used to build and package GTK applications.

DeadMozay avatar Mar 16 '21 10:03 DeadMozay

Hi, Thank you so much for this contribution. I am not very experienced with build systems and even packaging many other systems. But I looked into the meson build system and could find stuff related to C/C++ but not with any python app. Currently setuptools is used for building sysmontask. Can you point me to some good resources related to meson and python. And can just briefly explain what advantage/disadvantage meson has over setuptools.

it is not particularly important what programming language it is written in, python is not a compiled programming language, meson specifies which files and where to put them. you can take the entire GNOME stack as an example, it uses meson everywhere as a build system, including python applications. Typically meson is used to build and package GTK applications.

Hmm, I got that one. Looking at files, a binary binding in /bin with the name sysmontask will be created which points to the file sysmontask.py as a whole but like in the case of setuptools I can specify the individual functions in the same file to make an executable for. Is this possible with meson? since I need to make three more theme setting API calls for sysmontask as mentioned in the readme.

KrispyCamel4u avatar Mar 16 '21 11:03 KrispyCamel4u

Hi, Thank you so much for this contribution. I am not very experienced with build systems and even packaging many other systems. But I looked into the meson build system and could find stuff related to C/C++ but not with any python app. Currently setuptools is used for building sysmontask. Can you point me to some good resources related to meson and python. And can just briefly explain what advantage/disadvantage meson has over setuptools.

it is not particularly important what programming language it is written in, python is not a compiled programming language, meson specifies which files and where to put them. you can take the entire GNOME stack as an example, it uses meson everywhere as a build system, including python applications. Typically meson is used to build and package GTK applications.

Hmm, I got that one. Looking at files, a binary binding in /bin with the name sysmontask will be created which points to the file sysmontask.py as a whole but like in the case of setuptools I can specify the individual functions in the same file to make an executable for. Is this possible with meson? since I need to make three more theme setting API calls for sysmontask as mentioned in the readme.

The answer to the first question is

configure_file(
  input: 'sysmontask.py',
  output: 'sysmontask',
  configuration: conf,
  install: true,
  install_dir: get_option('bindir')
)

I haven't figured out the second one yet, but it's quite possible to implement, write a python script, and execute it in the same way https://github.com/KrispyCamel4u/SysMonTask/blob/6ca21418f765c992552089bbc41c6ea22e75bebc/meson.build#L16

DeadMozay avatar Mar 16 '21 12:03 DeadMozay

Why? It's just a python app, let's keep in python way.

jirib avatar Mar 24 '21 17:03 jirib

Why? It's just a python app, let's keep in python way.

For each distribution, there are certain rules for packaging applications, some distributions package python with simultaneous support for several versions, for ordinary applications without a GUI this does not cause problems, for GUI applications, packaging with support for 3-4 versions of python becomes difficult, and sometimes impossible, in assembly systems, when building, many different macros and scriptlets are called. Meson solves all problems.

DeadMozay avatar Mar 24 '21 17:03 DeadMozay

Why? It's just a python app, let's keep in python way.

For each distribution, there are certain rules for packaging applications, some distributions package python with simultaneous support for several versions, for ordinary applications without a GUI this does not cause problems, for GUI applications, packaging with support for 3-4 versions of python becomes difficult, and sometimes impossible, in assembly systems, when building, many different macros and scriptlets are called. Meson solves all problems.

Seriously, OS/distros usually have one main python version and all packages are using it, see RHEL/CentOS and why they use Software Collections. And... I was doing packaging and I can say one thing - any bundled post-install script which comes from the package itself is usually ignored, OS/distributions have their way to run post-install task, like update-desktop-mime DBs, cleanup etc... This is simple python app and there's no need to invent a monster around it to just use it.

BTW I see no reason why would anybody even use sudo to install this app, it should work without any trouble even in user install mode or venv. If not that there's something odd...

jirib avatar Mar 24 '21 18:03 jirib