Skip to content

Commit af7e15a

Browse files
Add "req. by" column, general meson improvements
1 parent c5391db commit af7e15a

File tree

6 files changed

+52
-24
lines changed

6 files changed

+52
-24
lines changed

data/pepv.ui

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
<column type="gint64"/>
2929
<!-- column-name repo -->
3030
<column type="gchararray"/>
31+
<!-- column-name requiredBy -->
32+
<column type="gint"/>
3133
</columns>
3234
</object>
3335
<object class="GtkWindow" id="window">
@@ -572,7 +574,7 @@
572574
<object class="GtkTreeViewColumn" id="c3">
573575
<property name="resizable">True</property>
574576
<property name="sizing">fixed</property>
575-
<property name="title" translatable="yes">Num. Deps</property>
577+
<property name="title" translatable="yes">Dependencies</property>
576578
<property name="clickable">True</property>
577579
<property name="reorderable">True</property>
578580
<property name="sort-column-id">3</property>
@@ -648,6 +650,22 @@
648650
</child>
649651
</object>
650652
</child>
653+
<child>
654+
<object class="GtkTreeViewColumn" id="c8">
655+
<property name="resizable">True</property>
656+
<property name="sizing">fixed</property>
657+
<property name="title" translatable="yes">Required By</property>
658+
<property name="clickable">True</property>
659+
<property name="reorderable">True</property>
660+
<property name="sort-column-id">8</property>
661+
<child>
662+
<object class="GtkCellRendererText" id="cx8"/>
663+
<attributes>
664+
<attribute name="text">8</attribute>
665+
</attributes>
666+
</child>
667+
</object>
668+
</child>
651669
</object>
652670
</child>
653671
</object>

meson.build

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,20 @@ if get_option('tracy_enable') and get_option('buildtype') != 'debugoptimized'
2525
warning('Profiling builds should set -- buildtype = debugoptimized')
2626
endif
2727

28+
executable(
29+
'pepv',
30+
['src/events.cpp', 'src/main.cpp', 'src/pkgs.cpp', 'src/utils.cpp'],
31+
dependencies: [threads, gtk, libalpm, tracy],
32+
export_dynamic: true, # GTK needs this
33+
cpp_args: [
34+
'-DPROJECTNAME="' + meson.project_name() + '"',
35+
'-DPREFIX="' + get_option('prefix') + '"',
36+
'-DDATADIR="' + get_option('datadir') + '"',
37+
'-Werror',
38+
],
39+
install: true,
40+
)
41+
2842
install_data('data/pepv.ui')
2943

3044
install_data(
@@ -37,25 +51,18 @@ install_data(
3751
install_dir: get_option('prefix') / get_option('datadir') / 'doc' / meson.project_name(),
3852
)
3953

54+
install_data(
55+
'LICENSE',
56+
rename: 'COPYING',
57+
install_dir: get_option('prefix') / get_option('datadir') / 'licenses' / meson.project_name(),
58+
)
59+
4060
# TODO: better install dir for this to make desktop and gtk icons work on debug builds/uninstalled tests
4161
foreach size : [16, 22, 24, 32, 36, 48, 64, 72, 96, 128, 256, 512, 1024]
4262
install_data(
4363
'data/icons/sizes/pepv-@0@.png'.format(size),
4464
install_dir: get_option('prefix') / get_option('datadir') / 'icons/hicolor/@0@x@0@/apps/'.format(size),
45-
rename: 'pepv.png',
65+
rename: meson.project_name() + '.png',
4666
install_mode: 'rw-r--r--',
4767
)
4868
endforeach
49-
50-
executable(
51-
'pepv',
52-
['src/events.cpp', 'src/main.cpp', 'src/pkgs.cpp', 'src/utils.cpp'],
53-
dependencies: [threads, gtk, libalpm, tracy],
54-
export_dynamic: true, # GTK needs this
55-
cpp_args: [
56-
'-DPREFIX="' + get_option('prefix') + '"',
57-
'-DDATADIR="' + get_option('datadir') + '"',
58-
'-Werror',
59-
],
60-
install: true,
61-
)

src/events.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ void populatePkgList() {
244244
COL_LIST_SIZE, pkg.size.value_or(0),
245245
COL_LIST_FILES, files,
246246
COL_LIST_REPO, repo.data(),
247+
COL_LIST_REQBY, pkg.requiredBy.size(),
247248
-1);
248249
shownCount++;
249250
shownSize += pkg.size.value_or(0);

src/main.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,16 @@ int main(int argc, char** argv) {
1616

1717
constexpr const std::array uiPaths = {
1818
#ifdef DEBUG
19-
"../data/pepv.ui",
19+
"../data/" PROJECTNAME ".ui",
20+
"./data/" PROJECTNAME ".ui",
2021
#endif
21-
PREFIX "/" DATADIR "/pepv/pepv.ui",
22-
"/usr/share/pepv/pepv.ui",
23-
"/usr/local/share/pepv/pepv.ui",
24-
"/app/share/pepv/pepv.ui",
25-
"/app/share/runtime/share/pepv/pepv.ui",
26-
"/run/host/user-share/pepv/pepv.ui",
27-
"/run/host/share/pepv/pepv.ui",
22+
PREFIX "/" DATADIR "/" PROJECTNAME "/" PROJECTNAME ".ui",
23+
"/usr/share/" PROJECTNAME "/" PROJECTNAME ".ui",
24+
"/usr/local/share/" PROJECTNAME "/" PROJECTNAME ".ui",
25+
"/app/share/" PROJECTNAME "/" PROJECTNAME ".ui",
26+
"/app/share/runtime/share/" PROJECTNAME "/" PROJECTNAME ".ui",
27+
"/run/host/user-share/" PROJECTNAME "/" PROJECTNAME ".ui",
28+
"/run/host/share/" PROJECTNAME "/" PROJECTNAME ".ui",
2829
};
2930

3031
for (auto& f : uiPaths) {

src/pkgs.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ enum LIST_COLS {
1717
COL_LIST_SIZE,
1818
COL_LIST_FILES,
1919
COL_LIST_REPO,
20+
COL_LIST_REQBY,
2021
};
2122

2223
enum BACKUP_COLS {

subprojects/tracy.wrap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[wrap-git]
22
url = https://github.com/wolfpld/tracy.git
3-
revision = v0.12.2
3+
revision = v0.13.0
44
depth = 1

0 commit comments

Comments
 (0)