Gentoo Archives: gentoo-commits

From: James Le Cuirot <chewi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-games/physfs/files/, dev-games/physfs/
Date: Sat, 17 Jul 2021 07:55:15
Message-Id: 1626508485.53ed21af3a713116e76bc67013ad056d02953374.chewi@gentoo
1 commit: 53ed21af3a713116e76bc67013ad056d02953374
2 Author: James Le Cuirot <chewi <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jul 17 07:54:45 2021 +0000
4 Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org>
5 CommitDate: Sat Jul 17 07:54:45 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=53ed21af
7
8 dev-games/physfs: Patch to fix pkg-config libdir entry
9
10 Package-Manager: Portage-3.0.20, Repoman-3.0.3
11 Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>
12
13 dev-games/physfs/files/GNUInstallDirs.patch | 74 +++++++++++++++++++++++++++++
14 dev-games/physfs/physfs-3.0.2-r1.ebuild | 58 ++++++++++++++++++++++
15 2 files changed, 132 insertions(+)
16
17 diff --git a/dev-games/physfs/files/GNUInstallDirs.patch b/dev-games/physfs/files/GNUInstallDirs.patch
18 new file mode 100644
19 index 00000000000..ef7bb5d1f14
20 --- /dev/null
21 +++ b/dev-games/physfs/files/GNUInstallDirs.patch
22 @@ -0,0 +1,74 @@
23 +From 727d7a5265ad856fd473ad1c621d6c03dd306d6d Mon Sep 17 00:00:00 2001
24 +From: James Le Cuirot <chewi@g.o>
25 +Date: Sat, 10 Jul 2021 22:55:53 +0100
26 +Subject: [PATCH] Use the GNUInstallDirs CMake module to respect installation
27 + locations
28 +
29 +Apparently use of LIB_SUFFIX is now discouraged. GNUInstallDirs does a
30 +better job of setting a default.
31 +
32 +The libdir of ${prefix}/lib in the pkg-config file caused warnings,
33 +and possibly even failures, when linking on multilib systems where
34 +/usr/lib is for 32-bit libraries rather than 64-bit libraries.
35 +---
36 + CMakeLists.txt | 15 ++++++++-------
37 + extras/physfs.pc.in | 6 +++---
38 + 2 files changed, 11 insertions(+), 10 deletions(-)
39 +
40 +diff --git a/CMakeLists.txt b/CMakeLists.txt
41 +index 4a67c27..6c26cb1 100644
42 +--- a/CMakeLists.txt
43 ++++ b/CMakeLists.txt
44 +@@ -14,6 +14,8 @@ cmake_minimum_required(VERSION 2.8.4)
45 + project(PhysicsFS)
46 + set(PHYSFS_VERSION 3.0.2)
47 +
48 ++include(GNUInstallDirs)
49 ++
50 + # Increment this if/when we break backwards compatibility.
51 + set(PHYSFS_SOVERSION 1)
52 +
53 +@@ -213,11 +215,11 @@ if(PHYSFS_BUILD_TEST)
54 + set(PHYSFS_INSTALL_TARGETS ${PHYSFS_INSTALL_TARGETS} ";test_physfs")
55 + endif()
56 +
57 +-install(TARGETS ${PHYSFS_INSTALL_TARGETS}
58 +- RUNTIME DESTINATION bin
59 +- LIBRARY DESTINATION lib${LIB_SUFFIX}
60 +- ARCHIVE DESTINATION lib${LIB_SUFFIX})
61 +-install(FILES src/physfs.h DESTINATION include)
62 ++install(TARGETS ${PHYSFS_INSTALL_TARGETS} EXPORT PhysFSExport
63 ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
64 ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
65 ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
66 ++install(FILES src/physfs.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
67 +
68 + find_package(Doxygen)
69 + if(DOXYGEN_FOUND)
70 +@@ -271,7 +273,7 @@ if(NOT MSVC)
71 + )
72 + install(
73 + FILES "${CMAKE_CURRENT_BINARY_DIR}/extras/physfs.pc"
74 +- DESTINATION "lib${LIB_SUFFIX}/pkgconfig"
75 ++ DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig"
76 + )
77 + endif()
78 +
79 +diff --git a/extras/physfs.pc.in b/extras/physfs.pc.in
80 +index 6cd0972..f7e0307 100644
81 +--- a/extras/physfs.pc.in
82 ++++ b/extras/physfs.pc.in
83 +@@ -1,7 +1,7 @@
84 + prefix=@CMAKE_INSTALL_PREFIX@
85 +-exec_prefix=${prefix}
86 +-libdir=${exec_prefix}/lib
87 +-includedir=${prefix}/include
88 ++exec_prefix=@CMAKE_INSTALL_PREFIX@
89 ++libdir=@CMAKE_INSTALL_FULL_LIBDIR@
90 ++includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
91 +
92 + Name: PhysicsFS
93 + Description: PhysicsFS is a library to provide abstract access to various archives.
94 +--
95 +2.31.1
96 +
97
98 diff --git a/dev-games/physfs/physfs-3.0.2-r1.ebuild b/dev-games/physfs/physfs-3.0.2-r1.ebuild
99 new file mode 100644
100 index 00000000000..0d225b66a06
101 --- /dev/null
102 +++ b/dev-games/physfs/physfs-3.0.2-r1.ebuild
103 @@ -0,0 +1,58 @@
104 +# Copyright 1999-2021 Gentoo Authors
105 +# Distributed under the terms of the GNU General Public License v2
106 +
107 +EAPI=7
108 +
109 +CMAKE_ECLASS=cmake
110 +inherit cmake-multilib
111 +
112 +DESCRIPTION="Abstraction layer for filesystem and archive access"
113 +HOMEPAGE="https://icculus.org/physfs/"
114 +
115 +if [[ ${PV} == *9999* ]]; then
116 + EHG_REPO_URI="https://hg.icculus.org/icculus/physfs"
117 + inherit mercurial
118 +else
119 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc64 ~x86"
120 + SRC_URI="https://icculus.org/physfs/downloads/${P}.tar.bz2"
121 +fi
122 +
123 +LICENSE="ZLIB"
124 +SLOT="0"
125 +IUSE="7zip doc grp hog iso mvl qpak slb static-libs vdf wad +zip"
126 +
127 +BDEPEND="doc? ( app-doc/doxygen )"
128 +
129 +PATCHES=(
130 + "${FILESDIR}"/GNUInstallDirs.patch
131 +)
132 +
133 +DOCS=( docs/CHANGELOG.txt docs/CREDITS.txt docs/TODO.txt )
134 +
135 +multilib_src_configure() {
136 + local mycmakeargs=(
137 + -DPHYSFS_BUILD_SHARED=ON
138 + -DPHYSFS_BUILD_TEST=OFF
139 + -DPHYSFS_BUILD_STATIC="$(usex static-libs)"
140 + -DPHYSFS_ARCHIVE_7Z="$(usex 7zip)"
141 + -DPHYSFS_ARCHIVE_GRP="$(usex grp)"
142 + -DPHYSFS_ARCHIVE_HOG="$(usex hog)"
143 + -DPHYSFS_ARCHIVE_ISO9660="$(usex iso)"
144 + -DPHYSFS_ARCHIVE_MVL="$(usex mvl)"
145 + -DPHYSFS_ARCHIVE_SLB="$(usex slb)"
146 + -DPHYSFS_ARCHIVE_VDF="$(usex vdf)"
147 + -DPHYSFS_ARCHIVE_WAD="$(usex wad)"
148 + -DPHYSFS_ARCHIVE_QPAK="$(usex qpak)"
149 + -DPHYSFS_ARCHIVE_ZIP="$(usex zip)"
150 + )
151 + cmake_src_configure
152 +}
153 +
154 +multilib_src_compile() {
155 + cmake_src_compile
156 +
157 + if multilib_is_native_abi && use doc; then
158 + cmake_src_compile docs
159 + HTML_DOCS=( "${BUILD_DIR}"/docs/html/. )
160 + fi
161 +}