summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Golle2025-07-09 01:55:35 +0000
committerRobert Marko2025-07-09 08:34:12 +0000
commit99054fcb6a5aedcf6b65d09f886e3bb24f74d6f7 (patch)
treee512a3e7c67bb99d959a169f185fa59e12a30976
parent1f8391346e1960b530d53fff4e134ee88dba2080 (diff)
downloadopenwrt-99054fcb6a5aedcf6b65d09f886e3bb24f74d6f7.tar.gz
xcrypt: work-around broken use of VARIANT with BUILDONLY
Split the xcrypt package build into two Makefiles and a common part for the version definition in order to work-around build problems when combining VARIANT with BUILDONLY and scoped InstallDev. This is done in order to skip build of libcrypt-compat in case we are not building against glibc in order to prevent libcrypt.so shared library being present in staging_dir and by that breaking multiple packages which then will link against it. Fixes: e3cf7088f1 ("libcrypt-compat: introduce package") Signed-off-by: Daniel Golle <daniel@makrotopia.org> Link: https://github.com/openwrt/openwrt/pull/19353 Signed-off-by: Robert Marko <robimarko@gmail.com>
-rw-r--r--package/libs/xcrypt/Makefile113
-rw-r--r--package/libs/xcrypt/libcrypt-compat/Makefile40
-rw-r--r--package/libs/xcrypt/libxcrypt-common.mk28
-rw-r--r--package/libs/xcrypt/libxcrypt/Makefile47
4 files changed, 115 insertions, 113 deletions
diff --git a/package/libs/xcrypt/Makefile b/package/libs/xcrypt/Makefile
deleted file mode 100644
index e0cb6a1e86..0000000000
--- a/package/libs/xcrypt/Makefile
+++ /dev/null
@@ -1,113 +0,0 @@
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=libxcrypt
-PKG_VERSION:=4.4.38
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=https://github.com/besser82/libxcrypt/releases/download/v$(PKG_VERSION)
-PKG_HASH:=80304b9c306ea799327f01d9a7549bdb28317789182631f1b54f4511b4206dd6
-
-PKG_MAINTAINER:=
-PKG_LICENSE:=LGPL-2.1-or-later
-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/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,
- gost-yescrypt, scrypt, bcrypt, sha512crypt, sha256crypt, md5crypt, SunMD5,
- sha1crypt, NT, bsdicrypt, bigcrypt, and descrypt. It provides the traditional
- Unix crypt and crypt_r interfaces, as well as a set of extended interfaces
- pioneered by Openwall Linux, crypt_rn, crypt_ra, crypt_gensalt,
- 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-obsolete-api \
- --enable-hashes=solaris
-endif
-
-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/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))
diff --git a/package/libs/xcrypt/libcrypt-compat/Makefile b/package/libs/xcrypt/libcrypt-compat/Makefile
new file mode 100644
index 0000000000..a503523267
--- /dev/null
+++ b/package/libs/xcrypt/libcrypt-compat/Makefile
@@ -0,0 +1,40 @@
+include $(TOPDIR)/rules.mk
+include ../libxcrypt-common.mk
+
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+PKG_BUILD_DIR:=$(BUILD_DIR)/libcrypt-compat/$(PKG_SOURCE_NAME)-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libcrypt-compat
+$(Package/libxcrypt/Default)
+ TITLE+= - libc compatibility
+ DEPENDS:=@USE_GLIBC
+endef
+
+Package/libcrypt-compat/description=$(Package/libxcrypt/description)
+
+CONFIGURE_ARGS += \
+ --with-pic \
+ --enable-year2038 \
+ --disable-xcrypt-compat-files \
+ --enable-obsolete-api=glibc \
+ --enable-hashes=glibc
+
+define Package/libcrypt-compat/install
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcrypt.so.* $(1)/usr/lib/
+endef
+
+define Build/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
+
+$(eval $(call BuildPackage,libcrypt-compat))
diff --git a/package/libs/xcrypt/libxcrypt-common.mk b/package/libs/xcrypt/libxcrypt-common.mk
new file mode 100644
index 0000000000..f4c5809d7d
--- /dev/null
+++ b/package/libs/xcrypt/libxcrypt-common.mk
@@ -0,0 +1,28 @@
+PKG_SOURCE_NAME:=libxcrypt
+PKG_VERSION:=4.4.38
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_SOURCE_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://github.com/besser82/$(PKG_SOURCE_NAME)/releases/download/v$(PKG_VERSION)
+PKG_HASH:=80304b9c306ea799327f01d9a7549bdb28317789182631f1b54f4511b4206dd6
+
+PKG_MAINTAINER:=
+PKG_LICENSE:=LGPL-2.1-or-later
+PKG_LICENSE_FILES:=COPYING.LIB
+
+define Package/libxcrypt/Default
+ SECTION:=libs
+ CATEGORY:=Libraries
+ URL:=https://github.com/besser82/libxcrypt
+ TITLE:=Extended crypt library
+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,
+ gost-yescrypt, scrypt, bcrypt, sha512crypt, sha256crypt, md5crypt, SunMD5,
+ sha1crypt, NT, bsdicrypt, bigcrypt, and descrypt. It provides the traditional
+ Unix crypt and crypt_r interfaces, as well as a set of extended interfaces
+ pioneered by Openwall Linux, crypt_rn, crypt_ra, crypt_gensalt,
+ crypt_gensalt_rn, and crypt_gensalt_ra.
+endef
diff --git a/package/libs/xcrypt/libxcrypt/Makefile b/package/libs/xcrypt/libxcrypt/Makefile
new file mode 100644
index 0000000000..fea6b4854b
--- /dev/null
+++ b/package/libs/xcrypt/libxcrypt/Makefile
@@ -0,0 +1,47 @@
+include $(TOPDIR)/rules.mk
+include ../libxcrypt-common.mk
+
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_NAME)-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libxcrypt
+$(Package/libxcrypt/Default)
+ BUILDONLY:=1
+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,
+ gost-yescrypt, scrypt, bcrypt, sha512crypt, sha256crypt, md5crypt, SunMD5,
+ sha1crypt, NT, bsdicrypt, bigcrypt, and descrypt. It provides the traditional
+ Unix crypt and crypt_r interfaces, as well as a set of extended interfaces
+ pioneered by Openwall Linux, crypt_rn, crypt_ra, crypt_gensalt,
+ crypt_gensalt_rn, and crypt_gensalt_ra.
+endef
+
+CONFIGURE_ARGS += \
+ --with-pic \
+ --enable-year2038 \
+ --disable-xcrypt-compat-files \
+ --disable-shared \
+ --disable-failure-tokens \
+ --disable-obsolete-api \
+ --enable-hashes=solaris
+
+define Package/libxcrypt/install
+ true
+endef
+
+define Build/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/libxcrypt.pc $(1)/usr/lib/pkgconfig/
+endef
+
+$(eval $(call BuildPackage,libxcrypt))