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

build: add meson build system #803

Merged
merged 31 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
488176a
Put all path variables into a separate module.
arrowd Mar 30, 2023
53a6ea5
chore: move man page
musikid Jun 19, 2023
2d24800
build: add meson build system
musikid Jun 19, 2023
452dac8
ci: fix workflow
musikid Jun 19, 2023
d95f5e2
fix: replace deprecated function
musikid Jun 25, 2023
87017fa
fix: use build options to configure paths
musikid Jun 25, 2023
c12dce0
refactor: add path factory to not recreate paths
musikid Jun 25, 2023
a30fbd3
build: remove license_files
musikid Jun 25, 2023
5d3e69d
build: add meson_options.txt for compatibility
musikid Jun 25, 2023
c97164f
ci: use latest meson version
musikid Jun 25, 2023
73adb06
build: add paths_factory file
musikid Jun 25, 2023
c9e24e3
fix: convert paths to string
musikid Jun 25, 2023
81db5c3
fix: use correct shebang
musikid Jun 25, 2023
6122219
build: add .clang-tidy to root src folder
musikid Jun 25, 2023
8bc95ef
fix: convert to string when necessary
musikid Jun 25, 2023
d0ca17b
refactor: add data dir for logo
musikid Jun 25, 2023
a92a3aa
feat: add config path to PAM module
musikid Jun 25, 2023
37a59a0
style: change clang tidy configuration
musikid Jun 25, 2023
54ba84e
fix: convert to string
musikid Jun 25, 2023
1f8ee26
refactor: use only paths_factory
musikid Jun 25, 2023
241bc6b
feat: add meson root script with howdy-gtk
musikid Jun 26, 2023
ef2187a
ci: fix workflow
musikid Jun 26, 2023
9b20bc2
ci: fix argument
musikid Jun 26, 2023
19f5b8d
build: remove mandatory modules
musikid Jun 27, 2023
a74ee5a
build: move datadir variable
musikid Jul 2, 2023
93a3d71
Merge branch 'beta' into meson
boltgolt Sep 5, 2023
7ce795b
Merge branch 'beta' into meson
musikid Sep 12, 2023
5133d05
refactor: rename variable
musikid Sep 12, 2023
29f218d
build: templatize autocomplete and pam-config
musikid Sep 12, 2023
0eb3eeb
build: fix pamdir path
musikid Sep 12, 2023
466c859
refactor: remove useless conversion
musikid Sep 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: add data dir for logo
  • Loading branch information
musikid committed Jun 25, 2023
commit d0ca17b1ec33508e5b491bf651c32d6e93c93028
2 changes: 2 additions & 0 deletions howdy/src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ py.dependency()
confdir = get_option('config_dir') != '' ? get_option('config_dir') : join_paths(get_option('sysconfdir'), 'howdy')
dlibdatadir = get_option('dlib_data_dir') != '' ? get_option('dlib_data_dir') : join_paths(confdir, 'dlib-data')
usermodelsdir = get_option('user_models_dir') != '' ? get_option('user_models_dir') : join_paths(confdir, 'models')
datadir = get_option('data_dir') != '' ? get_option('data_dir') : join_paths(get_option('prefix'), get_option('datadir'), 'howdy')
logpath = get_option('log_path')

py_conf = configuration_data({
'config_dir': confdir,
'dlib_data_dir': dlibdatadir,
'user_models_dir': usermodelsdir,
'data_dir': datadir,
'log_path': logpath,
})

Expand Down
1 change: 1 addition & 0 deletions howdy/src/meson.options
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ option('pam_dir', type: 'string', value: '', description: 'Set the pam_howdy des
option('config_dir', type: 'string', value: '', description: 'Set the howdy config directory')
option('dlib_data_dir', type: 'string', value: '', description: 'Set the dlib data directory')
option('user_models_dir', type: 'string', value: '', description: 'Set the user models directory')
option('data_dir', type: 'string', value: '', description: 'Set the howdy data directory')
option('log_path', type: 'string', value: '/var/log/howdy', description: 'Set the log file path')
option('install_in_site_packages', type: 'boolean', value: false, description: 'Install howdy python files in site packages')
option('py_sources_dir', type: 'string', value: '', description: 'Set the python sources directory')
3 changes: 3 additions & 0 deletions howdy/src/paths.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ user_models_dir = PurePath("@user_models_dir@")

# Define path to any howdy logs
log_path = PurePath("@log_path@")

# Define the absolute path to the Howdy data directory
data_dir = PurePath("@data_dir@")
3 changes: 3 additions & 0 deletions howdy/src/paths_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ def snapshots_dir_path() -> PurePath:

def snapshot_path(snapshot: str) -> PurePath:
return snapshots_dir_path() / snapshot

def logo_path() -> PurePath:
return paths.data_dir / "logo.png"
2 changes: 1 addition & 1 deletion howdy/src/snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def generate(frames, text_lines):
# Add the Howdy logo if there's space to do so
if len(frames) > 1:
# Load the logo from file
logo = cv2.imread(core_path + "/logo.png")
logo = cv2.imread(str(paths_factory.logo_path()))
# Calculate the position of the logo
logo_y = frame_height + 20
logo_x = frame_width * len(frames) - 210
Expand Down