diff --git a/libs/libnetconf2/Makefile b/libs/libnetconf2/Makefile index b8d1d69e71..e35d5c3119 100644 --- a/libs/libnetconf2/Makefile +++ b/libs/libnetconf2/Makefile @@ -25,14 +25,15 @@ include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk CMAKE_OPTIONS += \ - -DENABLE_PAM=OFF + -DENABLE_PAM=OFF \ + -DCMAKE_PREFIX_PATH=$(STAGING_DIR)/usr/lib/libyang-legacy define Package/libnetconf2 SECTION:=libs CATEGORY:=Libraries TITLE:=NETCONF library URL:=https://github.com/CESNET/libnetconf2 - DEPENDS:= +libyang +libcurl +libssh +libopenssl +libpthread + DEPENDS:=+libyang-legacy +libcurl +libssh +libopenssl +libpthread endef define Package/libnetconf2/description diff --git a/libs/libyang-legacy/Makefile b/libs/libyang-legacy/Makefile new file mode 100644 index 0000000000..f32a8b77de --- /dev/null +++ b/libs/libyang-legacy/Makefile @@ -0,0 +1,71 @@ +# +# Copyright (C) 2017 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=libyang-legacy +PKG_VERSION:=3.13.6 +PKG_RELEASE:=1 + +PKG_SOURCE:=libyang-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://codeload.github.com/CESNET/libyang/tar.gz/v$(PKG_VERSION)? +PKG_HASH:=5cd5018f39c830f97d70616c003990287ce5e820ae2792763a49e2a1f63af8d6 + +PKG_BUILD_DIR:=$(BUILD_DIR)/libyang-$(PKG_VERSION) + +PKG_MAINTAINER:=Alexandru Ardelean +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE +PKG_CPE_ID:=cpe:/a:cesnet:libyang + +CMAKE_INSTALL:=1 +CMAKE_BINARY_SUBDIR:=build + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +define Package/libyang-legacy + SECTION:=libs + CATEGORY:=Libraries + TITLE:=YANG data modeling language library (legacy v3 ABI) + URL:=https://github.com/CESNET/libyang + DEPENDS:=+libpcre2 +libpthread +libxxhash +endef + +define Package/libyang-legacy/description + libyang-legacy ships the libyang 3.x runtime (libyang.so.3) for binaries + still linked against the legacy ABI. It is install-time co-installable + with libyang 5.x (libyang.so.5), whose SONAME differs. + + Build-time consumers should point CMAKE_PREFIX_PATH (or PKG_CONFIG_PATH) + at $$$$(STAGING_DIR)/usr/lib/libyang-legacy so that the legacy headers, + library and pkg-config file are picked up in preference to libyang 5.x. +endef + +# Staged under a self-contained /usr/lib/libyang-legacy prefix, with a +# sysroot-relative .pc prefix so pkg-config does not double-prepend. +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/lib/libyang-legacy/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/libyang \ + $(1)/usr/lib/libyang-legacy/include/ + $(INSTALL_DIR) $(1)/usr/lib/libyang-legacy/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libyang.so* \ + $(1)/usr/lib/libyang-legacy/lib/ + $(INSTALL_DIR) $(1)/usr/lib/libyang-legacy/lib/pkgconfig + sed -e 's|^prefix=.*|prefix=/usr/lib/libyang-legacy|' \ + -e 's|^libdir=.*|libdir=$${prefix}/lib|' \ + -e 's|^includedir=.*|includedir=$${prefix}/include|' \ + $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libyang.pc \ + > $(1)/usr/lib/libyang-legacy/lib/pkgconfig/libyang.pc +endef + +define Package/libyang-legacy/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libyang.so.3* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libyang-legacy)) diff --git a/libs/libyang-legacy/test.sh b/libs/libyang-legacy/test.sh new file mode 100755 index 0000000000..322c7f3bb5 --- /dev/null +++ b/libs/libyang-legacy/test.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +case "$1" in + libyang-legacy) + # Runtime-only; the unversioned symlink belongs to libyang 5.x. + [ -e /usr/lib/libyang.so.3 ] || { + echo "libyang.so.3 not found" >&2 + exit 1 + } + ;; + *) + echo "Unsupported test target: $1" >&2 + exit 1 + ;; +esac diff --git a/net/frr/Makefile b/net/frr/Makefile index b75aa8f451..c1734b8fb3 100644 --- a/net/frr/Makefile +++ b/net/frr/Makefile @@ -74,13 +74,14 @@ define Package/frr/Default CATEGORY:=Network SUBMENU:=Routing and Redirection URL:=https://www.frrouting.org/ - DEPENDS:=frr + # Spelled out: apk's soname resolution would pick libyang 5.x. + DEPENDS:=frr +libyang-legacy endef define Package/frr $(call Package/frr/Default) DEPENDS:=+librt +libatomic +libcap +libncurses +libjson-c +libreadline \ - +libyang +libprotobuf-c +FRR_OPENSSL:libopenssl +FRR_SNMP:libnetsnmp +more + +libyang-legacy +libprotobuf-c +FRR_OPENSSL:libopenssl +FRR_SNMP:libnetsnmp +more TITLE:=The FRRouting (FRR) Software Routing Suite MENU:=1 endef @@ -153,7 +154,16 @@ define Package/frr/conffiles /etc/frr/vtysh.conf endef -TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed -latomic +# frr needs the v3 ABI; its configure looks libyang up three ways +# (PKG_CHECK_MODULES, pkg-config --modversion, AC_CHECK_LIB), so all of +# LDFLAGS, LIBYANG_* and PKG_CONFIG_PATH point at the legacy prefix. +TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed -latomic \ + -L$(STAGING_DIR)/usr/lib/libyang-legacy/lib + +CONFIGURE_VARS += \ + LIBYANG_CFLAGS="-I$(STAGING_DIR)/usr/lib/libyang-legacy/include" \ + LIBYANG_LIBS="-L$(STAGING_DIR)/usr/lib/libyang-legacy/lib -lyang" \ + PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/libyang-legacy/lib/pkgconfig:$$$$PKG_CONFIG_PATH" define Host/Configure $(Host/Configure/Default) diff --git a/net/netopeer2/Makefile b/net/netopeer2/Makefile index 7926cb0ce7..5141a63175 100644 --- a/net/netopeer2/Makefile +++ b/net/netopeer2/Makefile @@ -29,7 +29,7 @@ define Package/netopeer2-server CATEGORY:=Utilities TITLE:=NETCONF server URL:=https://github.com/CESNET/Netopeer2 - DEPENDS:=+libcurl +libpthread +libyang +libnetconf2 +libsysrepo +sysrepocfg +sysrepoctl +sysrepo + DEPENDS:=+libcurl +libpthread +libyang-legacy +libnetconf2 +libsysrepo +sysrepocfg +sysrepoctl +sysrepo MENU:=1 endef @@ -38,7 +38,7 @@ define Package/netopeer2-cli CATEGORY:=Utilities TITLE:=Netopeer2 cli tool URL:=https://github.com/CESNET/Netopeer2 - DEPENDS:=+libpthread +libyang +libnetconf2 +libopenssl + DEPENDS:=+libpthread +libyang-legacy +libnetconf2 +libopenssl endef define Package/netopeer2/description @@ -51,7 +51,8 @@ endef CMAKE_OPTIONS += \ -DCMAKE_INSTALL_PREFIX:PATH=/usr \ -DCMAKE_BUILD_TYPE:STRING=Release \ - -DSYSREPO_SETUP:BOOL=OFF + -DSYSREPO_SETUP:BOOL=OFF \ + -DCMAKE_PREFIX_PATH=$(STAGING_DIR)/usr/lib/libyang-legacy define Package/netopeer2-server/install $(INSTALL_DIR) $(1)/usr/bin diff --git a/net/sysrepo/Makefile b/net/sysrepo/Makefile index 6b6ad6d892..0297f822b9 100644 --- a/net/sysrepo/Makefile +++ b/net/sysrepo/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=sysrepo PKG_VERSION:=3.7.11 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/sysrepo/sysrepo/tar.gz/v$(PKG_VERSION)? @@ -29,7 +29,7 @@ define Package/libsysrepo CATEGORY:=Libraries TITLE:=YANG-based data store library URL:=https://www.sysrepo.org/ - DEPENDS:=+libyang $(ATOMIC64_DEPENDS) +libprotobuf-c +libev +librt +libpthread + DEPENDS:=+libyang-legacy $(ATOMIC64_DEPENDS) +libprotobuf-c +libev +librt +libpthread endef define Package/sysrepo @@ -71,7 +71,8 @@ CMAKE_OPTIONS += \ -DCMAKE_BUILD_TYPE="Package" \ -DREPOSITORY_LOC:PATH=/etc/sysrepo \ -DCALL_TARGET_BINS_DIRECTLY=OFF \ - -DGEN_LANGUAGE_BINDINGS:BOOL=TRUE + -DGEN_LANGUAGE_BINDINGS:BOOL=TRUE \ + -DCMAKE_PREFIX_PATH=$(STAGING_DIR)/usr/lib/libyang-legacy define Package/libsysrepo/install $(INSTALL_DIR) $(1)/usr/lib