Skip to content

[clip] New port #46826

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions ports/clip/fix-install-header-and-force-static-compilation.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 79f7074..32e284a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,6 +5,8 @@ cmake_minimum_required(VERSION 3.15)

project(clip LANGUAGES CXX)

+include(GNUInstallDirs)
+
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

@@ -25,7 +27,8 @@ if(UNIX AND NOT APPLE)
option(CLIP_X11_WITH_PNG "Compile with libpng to support copy/paste image in png format" on)
endif()

-add_library(clip clip.cpp)
+add_library(clip STATIC clip.cpp)
+target_include_directories(clip PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)

if(CLIP_ENABLE_IMAGE)
target_sources(clip PRIVATE image.cpp)
@@ -107,8 +110,6 @@ if(CLIP_TESTS)
endif()

if(CLIP_INSTALL)
- include(GNUInstallDirs)
-
install(
FILES clip.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
20 changes: 20 additions & 0 deletions ports/clip/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO dacap/clip
REF v1.10
SHA512 a29531ef276650807233b635ecceaf408147e4e263268eaf8237d74c9a7641d28cda5c6d1eaad4dbe634e720a5969dd6cc82aaeffbc36e0c9598ded31e419ea6
PATCHES
"fix-install-header-and-force-static-compilation.patch")

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DCLIP_ENABLE_LIST_FORMATS=ON
-DCLIP_EXAMPLES=OFF
-DCLIP_TESTS=OFF
-DCLIP_X11_WITH_PNG=ON)
vcpkg_cmake_install()
vcpkg_copy_pdbs()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
vcpkg_cmake_config_fixup(PACKAGE_NAME clip CONFIG_PATH "lib/cmake/clip")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")
22 changes: 22 additions & 0 deletions ports/clip/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "clip",
"version": "1.10.0",
"description": "Cross-platform C++ library to copy/paste clipboard content.",
"homepage": "https://github.com/dacap/clip",
"license": "MIT",
"supports": "!android & !uwp",
"dependencies": [
{
"name": "libpng",
"host": true
},
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -1780,6 +1780,10 @@
"baseline": "2.5.1",
"port-version": 0
},
"clip": {
"baseline": "1.10.0",
"port-version": 0
},
"clipboardxx": {
"baseline": "2022-02-04",
"port-version": 0
Expand Down
9 changes: 9 additions & 0 deletions versions/c-/clip.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "5f38f841d8458363b58aadfbd2daf18286c5f7ee",
"version": "1.10.0",
"port-version": 0
}
]
}