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 buildsystem #275

Merged
merged 1 commit into from
May 23, 2024
Merged

Add meson buildsystem #275

merged 1 commit into from
May 23, 2024

Conversation

lleon95
Copy link
Contributor

@lleon95 lleon95 commented May 23, 2024

This feature:

  • Adds the meson building system
  • Adds the option to compile the library and the application or just the library

Instructions:

# Create project
meson builddir -Denable-nethogs-app=enabled -Denable-libnethogs=disabled
# Compile
ninja -C builddir
# Install
ninja -C builddir install

Copy link
Owner

@raboof raboof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this contribution!

I'm generally not opposed to the change. This of course does slightly increase the maintenance burden, I hope you stick around to help with that as well :).

I added some comments

meson.build Outdated
# See COPYING for more information about licensing
#

project('nethogs',['c','cpp'],version : '0.8.7',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

specifying '0.8.7' here seems a bit weird, since the current main branch is '0.8.7 and a bit'. Is there any convention in the meson ecosystem to deal with the version differently, perhaps similar to what the Makefile does?

Also, the formatting seems somewhat haphazard (e.g., when do use newlines and when not). Is there any formatting tool for meson build files? Did you use it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately there is not a tool, but here is the style guide: https://mesonbuild.com/Style-guide.html

Let me see how I can fix the version. Probably I can get it from your version script

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added the detection of the version from the tag as in the Makefiles.

@@ -0,0 +1 @@
option('enable-app', type: 'boolean', value: false, description: 'Enable CUI app')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It kinda feels like the defaults should be the other way around: nethogs is primarily a CUI tool, and having it as a library is a somewhat experimental edge case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now, I have added both options (I will be using the library)

@lleon95 lleon95 force-pushed the main branch 2 times, most recently from 594f9fe to 8bd8eb7 Compare May 23, 2024 13:27
Copy link
Owner

@raboof raboof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool, thanks!

@raboof raboof merged commit 0fe341e into raboof:main May 23, 2024
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.

2 participants