Minor adjustments

This commit is contained in:
Lior Halphon 2024-07-06 15:09:13 +03:00
parent 3dad68618e
commit a66d4ea64c
2 changed files with 8 additions and 7 deletions

View File

@ -218,7 +218,7 @@ SDL_AUDIO_DRIVERS += openal
endif
endif
ifneq ($(shell pkg-config --exists gio-2.0 || echo 0),)
ifneq ($(shell $(PKG_CONFIG) --exists gio-unix-2.0 || echo 0),)
GIO_CFLAGS = $(error The Gio library could not be found)
GIO_LDFLAGS = $(error The Gio library could not be found)
else
@ -231,7 +231,7 @@ GIO_CFLAGS += -DG_DISABLE_ASSERT
endif
endif
ifneq ($(shell pkg-config --exists gdk-pixbuf-2.0 || echo 0),)
ifneq ($(shell $(PKG_CONFIG) --exists gdk-pixbuf-2.0 || echo 0),)
GDK_PIXBUF_CFLAGS = $(error The Gdk-Pixbuf library could not be found)
GDK_PIXBUF_LDFLAGS = $(error The Gdk-Pixbuf library could not be found)
else
@ -698,7 +698,7 @@ $(BIN)/BootROMs/%.bin: BootROMs/%.asm $(OBJ)/BootROMs/SameBoyLogo.pb12
# Libretro Core (uses its own build system)
libretro:
CFLAGS="$(WARNINGS)" $(MAKE) -C libretro BOOTROMS_DIR=$(abspath $(BOOTROMS_DIR)) BIN=$(abspath $(BIN))
CC=$(CC) CFLAGS="$(WARNINGS)" $(MAKE) -C libretro BOOTROMS_DIR=$(abspath $(BOOTROMS_DIR)) BIN=$(abspath $(BIN))
# Install for Linux, and other FreeDesktop platforms.
ifneq ($(FREEDESKTOP),)
@ -711,9 +711,9 @@ ifeq ($(DESTDIR),)
xdg-mime install --novendor FreeDesktop/sameboy.xml
xdg-desktop-menu install --novendor FreeDesktop/sameboy.desktop
for size in 16x16 32x32 64x64 128x128 256x256 512x512; do \
xdg-icon-resource install --novendor --theme hicolor --context apps FreeDesktop/AppIcon/$$size.png sameboy; \
xdg-icon-resource install --novendor --theme hicolor --context mimetypes FreeDesktop/Cartridge/$$size.png x-gameboy-rom; \
xdg-icon-resource install --novendor --theme hicolor --context mimetypes FreeDesktop/ColorCartridge/$$size.png x-gameboy-color-rom; \
xdg-icon-resource install --novendor --theme hicolor --size $$size --context apps FreeDesktop/AppIcon/$$size.png sameboy; \
xdg-icon-resource install --novendor --theme hicolor --size $$size --context mimetypes FreeDesktop/Cartridge/$$size.png x-gameboy-rom; \
xdg-icon-resource install --novendor --theme hicolor --size $$size --context mimetypes FreeDesktop/ColorCartridge/$$size.png x-gameboy-color-rom; \
done
else
install -Dm 644 -t $(DESTDIR)$(PREFIX)/share/mime FreeDesktop/sameboy.xml

View File

@ -113,7 +113,8 @@ int main(int argc, char *argv[])
if (max_size) {
char *endptr;
errno = 0;
// This can implicitly truncate, but that's the behaviour Liji wants.
/* This will implicitly truncate, but enforce_max_size will cap size to 1024 anyway.
(Not that 4 billion pixels wide icons make sense to begin with)*/
unsigned size = strtoul(max_size, &endptr, 10);
if (errno != 0 || *max_size == '\0' || *endptr != '\0') {
g_error("Invalid size parameter \"%s\": %s", max_size, strerror(errno == 0 ? EINVAL : errno));