kumquat-buildroot/package/gptfdisk/gptfdisk.mk
Ben Wolsieffer 58fbfe8706 package/gptfdisk: fix bug with util-linux 2.38
Due to a change in util-linux (commit
10f5f79485964ab52272ebe79c3b0047b1f84d82, "libbuid: use
_UL_LIBUUID_UUID_H to cover uuid.h"), gptfdisk no longer detects the
availability of libuuid to generate UUIDs, causing the following
message at runtime:

  Warning! Unable to generate a proper UUID! Creating an improper one as a last
  resort! Windows 7 may crash if you save this partition table!

This issue exists since util-linux was bumped to version 2.38 in
Buildroot
ee978e853a ("package/util-linux: bump
version to 2.38").

This issue has been fixed in upstream gptfdisk, but the fix [0] is not
yet in a new stable release, so we backport it.

Additionally, now that gptfdisk uses libuuid again, the build fails
because passing LDLIBS to make overrides the default value in the
Makefile. To fix this, this patch adds -luuid to GPTFDISK_LDLIBS.

[0] 6a8416cbd1

Signed-off-by: Ben Wolsieffer <ben.wolsieffer@hefring.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2023-10-01 23:05:28 +02:00

60 lines
1.7 KiB
Makefile

################################################################################
#
# gptfdisk
#
################################################################################
GPTFDISK_VERSION = 1.0.9
GPTFDISK_SITE = http://downloads.sourceforge.net/sourceforge/gptfdisk
GPTFDISK_LICENSE = GPL-2.0+
GPTFDISK_LICENSE_FILES = COPYING
GPTFDISK_TARGETS_$(BR2_PACKAGE_GPTFDISK_GDISK) += gdisk
GPTFDISK_TARGETS_$(BR2_PACKAGE_GPTFDISK_SGDISK) += sgdisk
GPTFDISK_TARGETS_$(BR2_PACKAGE_GPTFDISK_CGDISK) += cgdisk
GPTFDISK_DEPENDENCIES += util-linux
GPTFDISK_LDLIBS += -luuid
ifeq ($(BR2_PACKAGE_GPTFDISK_SGDISK),y)
GPTFDISK_DEPENDENCIES += host-pkgconf popt
GPTFDISK_SGDISK_LDLIBS += `$(PKG_CONFIG_HOST_BINARY) --libs popt`
endif
ifeq ($(BR2_PACKAGE_GPTFDISK_CGDISK),y)
GPTFDISK_DEPENDENCIES += ncurses
endif
ifeq ($(BR2_STATIC_LIBS),y)
# gptfdisk dependencies may link against libiconv, so we need to do so
# as well when linking statically
ifeq ($(BR2_PACKAGE_LIBICONV),y)
GPTFDISK_DEPENDENCIES += libiconv
GPTFDISK_LDLIBS += -liconv
endif
endif
define GPTFDISK_BUILD_CMDS
$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) \
LDLIBS='$(GPTFDISK_LDLIBS)' \
SGDISK_LDLIBS='$(GPTFDISK_SGDISK_LDLIBS)' $(GPTFDISK_TARGETS_y)
endef
define GPTFDISK_INSTALL_TARGET_CMDS
for i in $(GPTFDISK_TARGETS_y); do \
$(INSTALL) -D -m 0755 $(@D)/$$i $(TARGET_DIR)/usr/sbin/$$i || exit 1; \
done
endef
HOST_GPTFDISK_DEPENDENCIES = host-util-linux host-popt
define HOST_GPTFDISK_BUILD_CMDS
$(HOST_MAKE_ENV) $(MAKE) $(HOST_CONFIGURE_OPTS) -C $(@D) sgdisk
endef
define HOST_GPTFDISK_INSTALL_CMDS
$(INSTALL) -D -m 0755 $(@D)/sgdisk $(HOST_DIR)/sbin/sgdisk
endef
$(eval $(generic-package))
$(eval $(host-generic-package))