libcrypt-compat: introduce package
glibc 2.39 has removed libcrypt completely. solution: build libxcrypt with glibc compatibility. Signed-off-by: Konstantin Demin <rockdrilla@gmail.com> Link: https://github.com/openwrt/openwrt/pull/19160 Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
parent
47b6b9de1a
commit
e3cf7088f1
1 changed files with 64 additions and 6 deletions
|
@ -15,16 +15,33 @@ PKG_LICENSE_FILES:=COPYING.LIB
|
||||||
PKG_INSTALL:=1
|
PKG_INSTALL:=1
|
||||||
PKG_BUILD_PARALLEL:=1
|
PKG_BUILD_PARALLEL:=1
|
||||||
|
|
||||||
|
PKG_CONFIG_DEPENDS:= \
|
||||||
|
CONFIG_USE_GLIBC \
|
||||||
|
CONFIG_PACKAGE_libcrypt-compat \
|
||||||
|
CONFIG_PACKAGE_libxcrypt
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
define Package/libxcrypt
|
define Package/libxcrypt/Default
|
||||||
SECTION:=libs
|
SECTION:=libs
|
||||||
CATEGORY:=Libraries
|
CATEGORY:=Libraries
|
||||||
URL:=https://github.com/besser82/libxcrypt
|
URL:=https://github.com/besser82/libxcrypt
|
||||||
TITLE:=Extended crypt library
|
TITLE:=Extended crypt library
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/libxcrypt
|
||||||
|
$(Package/libxcrypt/Default)
|
||||||
|
VARIANT:=regular
|
||||||
BUILDONLY:=1
|
BUILDONLY:=1
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
define Package/libcrypt-compat
|
||||||
|
$(Package/libxcrypt/Default)
|
||||||
|
VARIANT:=compat
|
||||||
|
TITLE+= - libc compatibility
|
||||||
|
DEPENDS:=@USE_GLIBC
|
||||||
|
endef
|
||||||
|
|
||||||
define Package/libxcrypt/description
|
define Package/libxcrypt/description
|
||||||
libxcrypt is a modern library for one-way hashing of passwords. It supports
|
libxcrypt is a modern library for one-way hashing of passwords. It supports
|
||||||
a wide variety of both modern and historical hashing methods: yescrypt,
|
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.
|
crypt_gensalt_rn, and crypt_gensalt_ra.
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
Package/libcrypt-compat/description=$(Package/libxcrypt/description)
|
||||||
|
|
||||||
CONFIGURE_ARGS += \
|
CONFIGURE_ARGS += \
|
||||||
|
--with-pic \
|
||||||
|
--enable-year2038 \
|
||||||
|
--disable-xcrypt-compat-files
|
||||||
|
|
||||||
|
ifeq ($(BUILD_VARIANT),regular)
|
||||||
|
CONFIGURE_ARGS += \
|
||||||
--disable-shared \
|
--disable-shared \
|
||||||
--disable-failure-tokens \
|
--disable-failure-tokens \
|
||||||
--disable-xcrypt-compat-files \
|
|
||||||
--disable-obsolete-api \
|
--disable-obsolete-api \
|
||||||
--enable-hashes=solaris \
|
--enable-hashes=solaris
|
||||||
--with-pic
|
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
|
$(INSTALL_DIR) $(1)/usr/include
|
||||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
|
$(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
|
||||||
$(INSTALL_DIR) $(1)/usr/lib/libxcrypt
|
$(INSTALL_DIR) $(1)/usr/lib/libxcrypt
|
||||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libcrypt.{a,la} $(1)/usr/lib/libxcrypt
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libcrypt.{a,la} $(1)/usr/lib/libxcrypt
|
||||||
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
|
$(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
|
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))
|
$(eval $(call BuildPackage,libxcrypt))
|
||||||
|
|
Loading…
Reference in a new issue