forked from speedie/spmenu
fix some issues, add meson.build which i may or may not use later
This commit is contained in:
parent
77dbcbfe3e
commit
49973b40e2
|
@ -62,7 +62,8 @@ void readargs(int argc, char *argv[]) {
|
|||
// no arguments
|
||||
for (i = 1; i < argc; i++)
|
||||
if (!strcmp(argv[i], "-v") || (!strcmp(argv[i], "--version"))) { // prints version information
|
||||
puts("spmenu-"VERSION);
|
||||
//puts("spmenu-"VERSION);
|
||||
puts("spmenu-unknown");
|
||||
exit(0);
|
||||
} else if (!strcmp(argv[i], "-h") || (!strcmp(argv[i], "--help"))) { // help
|
||||
usage();
|
||||
|
|
|
@ -33,14 +33,24 @@ void readstdin(void) {
|
|||
if (parsemarkup(i)) {
|
||||
o = 1;
|
||||
}
|
||||
|
||||
#if !USEIMAGE
|
||||
if (o) {
|
||||
;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if USEIMAGE
|
||||
if (!o) longestedge = imagegaps = 0;
|
||||
#endif
|
||||
|
||||
// clean
|
||||
if (items) {
|
||||
items[i].text = NULL;
|
||||
#if USEIMAGE
|
||||
items[i].image = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
inputw = items ? TEXTWM(items[imax].text) : 0;
|
||||
|
@ -100,14 +110,23 @@ void readfile(void) {
|
|||
for (i = 0; i < listsize; i++) {
|
||||
items[i].text = list[i];
|
||||
|
||||
if (parsemarkup(i))
|
||||
if (parsemarkup(i)) {
|
||||
o = 1;
|
||||
}
|
||||
|
||||
#if !USEIMAGE
|
||||
if (o) {
|
||||
;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
inputw = items ? TEXTWM(items[i].text) : 0;
|
||||
lines = i;
|
||||
|
||||
#if USEIMAGE
|
||||
if (!o) longestedge = imagegaps = 0;
|
||||
#endif
|
||||
|
||||
if (i == olistcount) {
|
||||
listcount = i;
|
||||
|
@ -179,7 +198,7 @@ int parsemarkup(int index) {
|
|||
|
||||
// spmenu:version
|
||||
if (!strncmp("version", items[index].ex, strlen("version"))) {
|
||||
fprintf(stdout, "spmenu version %s", VERSION);
|
||||
fprintf(stdout, "spmenu version %f", VERSION);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
@ -196,9 +215,13 @@ int parsemarkup(int index) {
|
|||
}
|
||||
}
|
||||
|
||||
#if USEIMAGE
|
||||
if (limg) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
|
92
meson.build
Normal file
92
meson.build
Normal file
|
@ -0,0 +1,92 @@
|
|||
project(
|
||||
'spmenu',
|
||||
'c',
|
||||
version : '1.1',
|
||||
default_options : ['warning_level=3']
|
||||
)
|
||||
|
||||
imlib2 = true
|
||||
openssl = true
|
||||
xresources = true
|
||||
fribidi = true
|
||||
libconfig = true
|
||||
pango = true
|
||||
pangoxft = true
|
||||
xinerama = true
|
||||
opt = '-O2'
|
||||
|
||||
cc = meson.get_compiler('c')
|
||||
m_dep = cc.find_library('m', required : false)
|
||||
|
||||
project_source_files = [
|
||||
'libs/libdrw/draw.c',
|
||||
'spmenu.c',
|
||||
'libs/sl/main.c',
|
||||
]
|
||||
|
||||
project_dependencies = [
|
||||
dependency('x11'),
|
||||
dependency('xrender'),
|
||||
dependency('freetype2'),
|
||||
dependency('xft'),
|
||||
dependency('fontconfig'),
|
||||
cc.find_library('m', required : false),
|
||||
]
|
||||
|
||||
build_args = [
|
||||
'-DVERSION=' + meson.project_version(),
|
||||
|
||||
'-D_DEFAULT_SOURCE',
|
||||
'-D_BSD_SOURCE',
|
||||
'-D_XOPEN_SOURCE=700L',
|
||||
'-D_POSIX_C_SOURCE=200809L',
|
||||
|
||||
'-std=c99',
|
||||
'-pedantic',
|
||||
'-Wall',
|
||||
'-Wno-deprecated-declarations',
|
||||
'-Wno-unused-parameter',
|
||||
'-Wno-sign-compare',
|
||||
opt,
|
||||
]
|
||||
|
||||
if imlib2 and openssl
|
||||
project_dependencies += [ dependency('imlib2') ]
|
||||
project_dependencies += [ dependency('openssl') ]
|
||||
build_args += [ '-DIMAGE' ]
|
||||
endif
|
||||
|
||||
if fribidi
|
||||
project_dependencies += [ dependency('fribidi') ]
|
||||
build_args += [ '-DRTL' ]
|
||||
endif
|
||||
|
||||
if xinerama
|
||||
project_dependencies += [ dependency('xinerama') ]
|
||||
build_args += [ '-DXINERAMA' ]
|
||||
endif
|
||||
|
||||
if pango and pangoxft
|
||||
project_dependencies += [ dependency('pango') ]
|
||||
project_dependencies += [ dependency('pangoxft') ]
|
||||
build_args += [ '-DPANGO' ]
|
||||
endif
|
||||
|
||||
if libconfig
|
||||
project_dependencies += [ dependency('libconfig') ]
|
||||
build_args += [ '-DCONFIG' ]
|
||||
endif
|
||||
|
||||
if xresources
|
||||
build_args += [ '-DXRESOURCES' ]
|
||||
endif
|
||||
|
||||
project_target = executable(
|
||||
meson.project_name(),
|
||||
project_source_files,
|
||||
dependencies: project_dependencies,
|
||||
install : true,
|
||||
c_args : build_args,
|
||||
)
|
||||
|
||||
test('spmenu', project_target)
|
Loading…
Reference in a new issue