Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add meson build system #39

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

DeadMozay
Copy link

Added building of packages through the meson build system.

@KrispyCamel4u
Copy link
Owner

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.

@DeadMozay
Copy link
Author

DeadMozay commented Mar 16, 2021

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.

@KrispyCamel4u
Copy link
Owner

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.

@DeadMozay
Copy link
Author

DeadMozay commented Mar 16, 2021

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

meson.add_install_script('build-aux/meson/postinstall.py')

@jirib
Copy link

jirib commented Mar 24, 2021

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

@DeadMozay
Copy link
Author

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.

@jirib
Copy link

jirib commented Mar 24, 2021

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants