forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Haelwenn (lanodan) Monnier <[email protected]>
- Loading branch information
Showing
5 changed files
with
158 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
DIST squirrel-3.2.tar.gz 620486 BLAKE2B c03cee0dffc12ff48caa4a7c9c0fffec32cdfb23306f265b8475454b0b9f14a3d2ec620b0f2183de8e8bc83e4921d6853105ac1a8d37bf3f2d97e914a001c4fd SHA512 e488ccc07b851e1707f3fde923f691747b18dc2fcc4748d2a68f2590ab84a3c0db647c8ac9ee775796984d2302a3d3686459556ea0c49a0b96b1354fcb8a6c74 | ||
DIST squirrel-config.cmake.in_3.2 143 BLAKE2B e9e795a4f855f41206c5aca89b949c279f35dce06dad73c9153a9c03701f1721d831bdc29e3a399a2a6b2cf6e97d3a966008d81dfe955b2f5412c818d5a054bc SHA512 4820835a233b2beb5768b39e6b3ce5f06f1f9bc57c4c19df2c4f7ce2b03e67c18554c3084259317092d1eb0fee7d909bdbc56a9fc556f57ed61ef8b0f181996d | ||
DIST squirrel-3.2.gh.tar.gz 182795 BLAKE2B 3ee5439d75fc4ff2e8e02ccc9d24e282348108288f6b0ac870638409fc38f75169885e1c01d9c98c5ce05218f4abc9923f9f81f5155ccf3a595329b0acfb5953 SHA512 1aff8e55b8439e06a80ca78edf0b32066ce6563a9e3e61fe9b0bfc18e930828fd08a20c01a88bb1b8c164cbd0dd62966619c565557cbf4761739f3749988485d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
147 changes: 147 additions & 0 deletions
147
dev-lang/squirrel/files/squirrel-3.2-pkg_config_pr264.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
From b37958bec41b9cbff0968f5ffe176609dce4ff55 Mon Sep 17 00:00:00 2001 | ||
From: "Haelwenn (lanodan) Monnier" <[email protected]> | ||
Date: Sat, 14 Jan 2023 08:16:19 +0100 | ||
Subject: [PATCH] CMake: Generate and install squirrel.pc | ||
|
||
Closes: https://github.com/albertodemichelis/squirrel/issues/259 | ||
--- | ||
CMakeLists.txt | 35 +++++++++++++++++++++++++++++++++-- | ||
sqstdlib/CMakeLists.txt | 5 +---- | ||
squirrel.pc.in | 12 ++++++++++++ | ||
squirrel/CMakeLists.txt | 5 +---- | ||
4 files changed, 47 insertions(+), 10 deletions(-) | ||
create mode 100644 squirrel.pc.in | ||
|
||
Note: This patch got rebased on v3.2 | ||
|
||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index dc35b6f..8ef293c 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -1,5 +1,10 @@ | ||
-cmake_minimum_required(VERSION 3.4) | ||
-project(squirrel VERSION 3.1 LANGUAGES C CXX) | ||
+cmake_minimum_required(VERSION 3.12) | ||
+project(squirrel | ||
+ VERSION 3.1 | ||
+ DESCRIPTION "The Squirrel programming language" | ||
+ HOMEPAGE_URL "http://squirrel-lang.org/" | ||
+ LANGUAGES C CXX | ||
+ ) | ||
|
||
option(DISABLE_STATIC "Avoid building/installing static libraries.") | ||
option(LONG_OUTPUT_NAMES "Use longer names for binaries and libraries: squirrel3 (not sq).") | ||
@@ -33,6 +38,15 @@ elseif(MSVC) | ||
add_definitions(-D_CRT_SECURE_NO_WARNINGS) | ||
endif() | ||
|
||
+# Need to be defined here to be visible to squirrel.pc.in | ||
+if(LONG_OUTPUT_NAMES) | ||
+ set(LIBSQUIRREL_NAME squirrel3) | ||
+ set(SQSTDLIB_NAME sqstdlib3) | ||
+else() | ||
+ set(LIBSQUIRREL_NAME squirrel) | ||
+ set(SQSTDLIB_NAME sqstdlib) | ||
+endif() | ||
+ | ||
add_subdirectory(squirrel) | ||
add_subdirectory(sqstdlib) | ||
add_subdirectory(sq) | ||
@@ -92,6 +106,12 @@ export(EXPORT squirrel | ||
FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/cmake/squirrel/squirrel-targets.cmake" | ||
) | ||
|
||
+configure_file( | ||
+ "${CMAKE_CURRENT_SOURCE_DIR}/squirrel.pc.in" | ||
+ ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc | ||
+ @ONLY | ||
+) | ||
+ | ||
if(NOT SQ_DISABLE_INSTALLER AND NOT SQ_DISABLE_CMAKE_INSTALLER) | ||
install(FILES | ||
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/cmake/squirrel/squirrel-config-version.cmake" | ||
@@ -100,6 +120,17 @@ if(NOT SQ_DISABLE_INSTALLER AND NOT SQ_DISABLE_CMAKE_INSTALLER) | ||
COMPONENT Development | ||
) | ||
|
||
+ # pc(5) only allows static variant to have extra flags, not an entirely new | ||
+ # set of flags. While it's uncommon, a way to do it would be to generate a | ||
+ # ${PROJECT_NAME}_static.pc file. | ||
+ if(NOT DISABLE_DYNAMIC) | ||
+ install( | ||
+ FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc | ||
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig | ||
+ COMPONENT Development | ||
+ ) | ||
+ endif() | ||
+ | ||
install(EXPORT squirrel | ||
NAMESPACE squirrel:: | ||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/squirrel" | ||
diff --git a/sqstdlib/CMakeLists.txt b/sqstdlib/CMakeLists.txt | ||
index 34fba82..a606ba8 100644 | ||
--- a/sqstdlib/CMakeLists.txt | ||
+++ b/sqstdlib/CMakeLists.txt | ||
@@ -11,6 +11,7 @@ if(NOT DISABLE_DYNAMIC) | ||
add_library(sqstdlib SHARED ${SQSTDLIB_SRC}) | ||
add_library(squirrel::sqstdlib ALIAS sqstdlib) | ||
set_property(TARGET sqstdlib PROPERTY EXPORT_NAME sqstdlib) | ||
+ set_property(TARGET sqstdlib PROPERTY OUTPUT_NAME ${SQSTDLIB_NAME}) | ||
target_link_libraries(sqstdlib squirrel) | ||
if(NOT SQ_DISABLE_INSTALLER) | ||
install(TARGETS sqstdlib EXPORT squirrel | ||
@@ -42,10 +43,6 @@ if(NOT DISABLE_STATIC) | ||
endif() | ||
|
||
if(LONG_OUTPUT_NAMES) | ||
- if(NOT DISABLE_DYNAMIC) | ||
- set_target_properties(sqstdlib PROPERTIES OUTPUT_NAME sqstdlib3) | ||
- endif() | ||
- | ||
if(NOT DISABLE_STATIC) | ||
set_target_properties(sqstdlib_static PROPERTIES OUTPUT_NAME sqstdlib3_static) | ||
endif() | ||
diff --git a/squirrel.pc.in b/squirrel.pc.in | ||
new file mode 100644 | ||
index 0000000..ea66485 | ||
--- /dev/null | ||
+++ b/squirrel.pc.in | ||
@@ -0,0 +1,12 @@ | ||
+prefix=@CMAKE_INSTALL_PREFIX@ | ||
+libdir=@CMAKE_INSTALL_FULL_LIBDIR@ | ||
+includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ | ||
+ | ||
+Name: @PROJECT_NAME@ | ||
+Version: @PROJECT_VERSION@ | ||
+Description: @PROJECT_DESCRIPTION@ | ||
+URL: @PROJECT_HOMEPAGE_URL@ | ||
+Requires: | ||
+Provides: squirrel3 = @PROJECT_VERSION@ | ||
+Libs: -L${libdir} -l@LIBSQUIRREL_NAME@ -l@SQSTDLIB_NAME@ | ||
+Cflags: -I${includedir} | ||
diff --git a/squirrel/CMakeLists.txt b/squirrel/CMakeLists.txt | ||
index f96b958..c8a31b9 100644 | ||
--- a/squirrel/CMakeLists.txt | ||
+++ b/squirrel/CMakeLists.txt | ||
@@ -15,6 +15,7 @@ if(NOT DISABLE_DYNAMIC) | ||
add_library(squirrel SHARED ${SQUIRREL_SRC}) | ||
add_library(squirrel::squirrel ALIAS squirrel) | ||
set_property(TARGET squirrel PROPERTY EXPORT_NAME squirrel) | ||
+ set_property(TARGET squirrel PROPERTY OUTPUT_NAME ${LIBSQUIRREL_NAME}) | ||
if(NOT SQ_DISABLE_INSTALLER) | ||
install(TARGETS squirrel EXPORT squirrel | ||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT Libraries | ||
@@ -45,10 +46,6 @@ if(NOT DISABLE_STATIC) | ||
endif() | ||
|
||
if(LONG_OUTPUT_NAMES) | ||
- if(NOT DISABLE_DYNAMIC) | ||
- set_target_properties(squirrel PROPERTIES OUTPUT_NAME squirrel3) | ||
- endif() | ||
- | ||
if(NOT DISABLE_STATIC) | ||
set_target_properties(squirrel_static PROPERTIES OUTPUT_NAME squirrel3_static) | ||
endif() | ||
-- | ||
2.41.0 | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters