Alcaro / Flips

Floating IPS is a patcher for IPS and BPS files.
Other
309 stars 45 forks source link

Fail instead of warn when trying to build GTK and no GTK libs were found #72

Closed Miepee closed 1 month ago

Miepee commented 1 month ago

See #56

Alcaro commented 1 month ago
Package gtk+g-3.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+g-3.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'gtk+g-3.0', required by 'virtual:world', not found
Makefile:60: pkg-config can't find gtk+-3.0, or pkg-config itself can't be found
Makefile:61: if you have the needed files installed, specify their locations and names with `make GTKFLAGS='-I/usr/include' GTKLIBS='-L/usr/lib -lgtk''
Makefile:62: if not, the package names under Debian and derivates are `pkg-config libgtk-3-dev'; for other distros, consult a search engine
Makefile:63: If you instead want to build the CLI version, set the TARGET environment variable to nothing, like so:
Makefile:64: TARGET='' make
Makefile:65: *** missing separator.  Stop.

Well, that does terminate compilation... but it's a pretty ugly error, isn't it? Swap that exit line for $(error abc123) or something.

Miepee commented 1 month ago

Should hopefully be nicer now? Can't easily replicate this locally, but my syntax-highlighting looks off so not quite sure if I didn't make a mistake.

Alcaro commented 1 month ago
Package gtk+g-3.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+g-3.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'gtk+g-3.0', required by 'virtual:world', not found
Makefile:60: if you have the needed files installed, specify their locations and names with `make GTKFLAGS='-I/usr/include' GTKLIBS='-L/usr/lib -lgtk'`
Makefile:61: if not, the package names under Debian and derivates are 'pkg-config libgtk-3-dev'; for other distros, consult a search engine
Makefile:62: If you instead want to build the CLI version, set the TARGET environment variable to nothing, like so:
Makefile:63: TARGET='' make
Makefile:64: *** Can't build gtk target without gtk dependencies.  Stop.

Not the prettiest error I've seen, but Flips isn't the prettiest codebase I've seen. Good enough.

I'm gonna fix that TARGET='' piece, though; empty string means 'default for this platform', which is GTK on everything except Windows and Mac.

As may be hinted by my errors saying gtk+g-3.0, I'm testing it by simply typoing the pkg-config argument into something that doesn't exist.

Miepee commented 1 month ago

which is GTK on everything except Windows and Mac.

brain messed things up earlier, where gtk was defaulted on windows cause I didnt run it from an environment that had uname available, my bad.

Also ty for merging + fixing that target message :)

Alcaro commented 1 month ago

If uname isn't available, it should fall into the https://github.com/Alcaro/Flips/blob/master/Makefile#L45 codepath. And it shouldn't get to uname in the first place, it should take the https://github.com/Alcaro/Flips/blob/master/Makefile#L34 codepath.

Weird. If you can find a more reliable way to autodetect the target, do tell.