From: Konstantin Demin Date: Mon, 16 Jun 2025 23:51:20 +0000 (+0300) Subject: libcrypt-compat: introduce package X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e3cf7088f14cac1b58ac6bf8738e9b26eb81bbfa;p=thirdparty%2Fopenwrt.git libcrypt-compat: introduce package glibc 2.39 has removed libcrypt completely. solution: build libxcrypt with glibc compatibility. Signed-off-by: Konstantin Demin Link: https://github.com/openwrt/openwrt/pull/19160 Signed-off-by: Robert Marko --- diff --git a/package/libs/xcrypt/Makefile b/package/libs/xcrypt/Makefile index 20417cc3468..e0cb6a1e860 100644 --- a/package/libs/xcrypt/Makefile +++ b/package/libs/xcrypt/Makefile @@ -15,16 +15,33 @@ PKG_LICENSE_FILES:=COPYING.LIB PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 +PKG_CONFIG_DEPENDS:= \ + CONFIG_USE_GLIBC \ + CONFIG_PACKAGE_libcrypt-compat \ + CONFIG_PACKAGE_libxcrypt + include $(INCLUDE_DIR)/package.mk -define Package/libxcrypt +define Package/libxcrypt/Default SECTION:=libs CATEGORY:=Libraries URL:=https://github.com/besser82/libxcrypt TITLE:=Extended crypt library +endef + +define Package/libxcrypt +$(Package/libxcrypt/Default) + VARIANT:=regular BUILDONLY:=1 endef +define Package/libcrypt-compat +$(Package/libxcrypt/Default) + VARIANT:=compat + TITLE+= - libc compatibility + DEPENDS:=@USE_GLIBC +endef + define Package/libxcrypt/description libxcrypt is a modern library for one-way hashing of passwords. It supports a wide variety of both modern and historical hashing methods: yescrypt, @@ -35,21 +52,62 @@ define Package/libxcrypt/description crypt_gensalt_rn, and crypt_gensalt_ra. endef +Package/libcrypt-compat/description=$(Package/libxcrypt/description) + CONFIGURE_ARGS += \ + --with-pic \ + --enable-year2038 \ + --disable-xcrypt-compat-files + +ifeq ($(BUILD_VARIANT),regular) + CONFIGURE_ARGS += \ --disable-shared \ --disable-failure-tokens \ - --disable-xcrypt-compat-files \ --disable-obsolete-api \ - --enable-hashes=solaris \ - --with-pic + --enable-hashes=solaris +endif -define Build/InstallDev +ifeq ($(BUILD_VARIANT),compat) + CONFIGURE_ARGS += \ + --enable-obsolete-api=glibc \ + --enable-hashes=glibc +endif + +define Package/libxcrypt/install + true +endef + +define Package/libcrypt-compat/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcrypt.so.* $(1)/usr/lib/ +endef + +define Build/libxcrypt/InstallDev $(INSTALL_DIR) $(1)/usr/include $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/ $(INSTALL_DIR) $(1)/usr/lib/libxcrypt $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcrypt.{a,la} $(1)/usr/lib/libxcrypt $(INSTALL_DIR) $(1)/usr/lib/pkgconfig - $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*crypt.pc $(1)/usr/lib/pkgconfig/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libxcrypt.pc $(1)/usr/lib/pkgconfig/ +endef + +define Build/libcrypt-compat/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcrypt.{a,la,so*} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + # libcrypt.pc is symlink to libxcrypt.pc + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libxcrypt.pc $(1)/usr/lib/pkgconfig/libcrypt.pc endef +ifeq ($(BUILD_VARIANT),regular) + Build/InstallDev=$(Build/libxcrypt/InstallDev) +endif + +ifeq ($(BUILD_VARIANT),compat) + Build/InstallDev=$(Build/libcrypt-compat/InstallDev) +endif + +$(eval $(call BuildPackage,libcrypt-compat)) $(eval $(call BuildPackage,libxcrypt))