mirror of
https://github.com/openwrt/packages.git
synced 2026-05-31 06:51:51 +08:00
1bf4bd3856
A previous commit attempted to introduce proper SONAME symlinks for
packages utilizing ABI_VERSION. However, it incorrectly copied only
the symlink without the underlying physical library file, resulting
in broken packages with dangling symlinks.
Before:
```
tar -Oxzf bin/packages/arm_cortex-a9_vfpv3-d16/packages/oniguruma_6.9.9-r1_arm_cortex-a9_vfpv3-d16.ipk ./data.tar.gz | tar -tzvf -
drwxr-xr-x 0 0 0 0 Feb 5 2024 ./
drwxr-xr-x 0 0 0 0 Feb 5 2024 ./usr/
drwxr-xr-x 0 0 0 0 Feb 5 2024 ./usr/lib/
lrwxrwxrwx 0 0 0 0 Feb 5 2024 ./usr/lib/libonig.so.5 -> libonig.so.5.4.0
```
After:
```
tar -Oxzf bin/packages/arm_cortex-a9_vfpv3-d16/packages/oniguruma_6.9.9-r1_arm_cortex-a9_vfpv3-d16.ipk ./data.tar.gz | tar -tzvf -
drwxr-xr-x 0 0 0 0 Feb 5 2024 ./
drwxr-xr-x 0 0 0 0 Feb 5 2024 ./usr/
drwxr-xr-x 0 0 0 0 Feb 5 2024 ./usr/lib/
lrwxrwxrwx 0 0 0 0 Feb 5 2024 ./usr/lib/libonig.so.5 -> libonig.so.5.4.0
-rwxr-xr-x 0 0 0 526493 Feb 5 2024 ./usr/lib/libonig.so.5.4.0
```
This properly standardizes shared library packaging, prevents shipping
duplicate full-sized files (as seen previously in packages like libre2),
and aligns the packages feed with core OpenWrt practices.
As you could see in the previous commit (see it in the ``Fixes`` tag):
Before:
```
tar -Oxzf bin/packages/arm_cortex-a9_vfpv3-d16/packages/re2_2023.02.01\~b025c6a3-r1_arm_cortex-a9_vfpv3-d16.ipk ./data.tar.gz | tar -tzvf -
drwxr-xr-x 0 0 0 0 Aug 18 2024 ./
drwxr-xr-x 0 0 0 0 Aug 18 2024 ./usr/
drwxr-xr-x 0 0 0 0 Aug 18 2024 ./usr/lib/
-rw-r--r-- 0 0 0 331875 Aug 18 2024 ./usr/lib/libre2.so
-rw-r--r-- 0 0 0 331875 Aug 18 2024 ./usr/lib/libre2.so.10
-rw-r--r-- 0 0 0 331875 Aug 18 2024 ./usr/lib/libre2.so.10.0.0
```
After:
```
tar -Oxzf bin/packages/arm_cortex-a9_vfpv3-d16/packages/re2_2023.02.01\~b025c6a3-r1_arm_cortex-a9_vfpv3-d16.ipk ./data.tar.gz | tar -tzvf -
drwxr-xr-x 0 0 0 0 Aug 18 2024 ./
drwxr-xr-x 0 0 0 0 Aug 18 2024 ./usr/
drwxr-xr-x 0 0 0 0 Aug 18 2024 ./usr/lib/
lrwxrwxrwx 0 0 0 0 Aug 18 2024 ./usr/lib/libre2.so -> libre2.so.10
lrwxrwxrwx 0 0 0 0 Aug 18 2024 ./usr/lib/libre2.so.10 -> libre2.so.10.0.0
-rwxr-xr-x 0 0 0 331875 Aug 18 2024 ./usr/lib/libre2.so.10.0.0
```
Fixes: 537c2a631d ("treewide: avoid deref symlinks when installing .so")
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
59 lines
1.5 KiB
Makefile
59 lines
1.5 KiB
Makefile
#
|
|
# Copyright (C) 2017 Steven Hessing
|
|
#
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
# See /LICENSE for more information.
|
|
#
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
PKG_NAME:=libyaml-cpp
|
|
PKG_VERSION:=0.8.0
|
|
PKG_RELEASE:=4
|
|
|
|
PKG_SOURCE_PROTO:=git
|
|
PKG_SOURCE_URL:=https://github.com/jbeder/yaml-cpp
|
|
PKG_SOURCE_VERSION:=$(PKG_VERSION)
|
|
PKG_MIRROR_HASH:=b81c7d39efa379a52c4cd7a6ee00e21b546e26284a44aa6d4b836e339c655803
|
|
|
|
PKG_MAINTAINER:= Steven Hessing <steven.hessing@gmail.com>
|
|
PKG_LICENSE:=MIT
|
|
PKG_LICENSE_FILES:=LICENSE
|
|
PKG_CPE_ID:=cpe:/a:yaml-cpp_project:yaml-cpp
|
|
|
|
CMAKE_INSTALL:=1
|
|
|
|
include $(INCLUDE_DIR)/package.mk
|
|
include $(INCLUDE_DIR)/cmake.mk
|
|
|
|
define Package/libyaml-cpp
|
|
SECTION:=development
|
|
CATEGORY:=Libraries
|
|
TITLE:=libyaml-cpp
|
|
URL:=https://github.com/jbeder/yaml-cpp
|
|
DEPENDS:=+libstdcpp
|
|
ABI_VERSION:=0.8
|
|
endef
|
|
|
|
define Package/libyaml-cpp/description
|
|
yaml-cpp is a YAML parser and emitter in C++ matching the YAML 1.2 spec.
|
|
endef
|
|
|
|
CMAKE_OPTIONS += \
|
|
-DYAML_BUILD_SHARED_LIBS=ON \
|
|
-DYAML_CPP_BUILD_TESTS=OFF \
|
|
-DYAML_CPP_BUILD_TOOLS=OFF
|
|
|
|
define Build/InstallDev
|
|
$(call Build/InstallDev/cmake,$(1))
|
|
$(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/yaml-cpp.pc
|
|
$(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/yaml-cpp.pc
|
|
endef
|
|
|
|
define Package/libyaml-cpp/install
|
|
$(INSTALL_DIR) $(1)/usr/lib
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libyaml-cpp.so.$(ABI_VERSION)* $(1)/usr/lib/
|
|
endef
|
|
|
|
$(eval $(call BuildPackage,libyaml-cpp))
|