Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
17 changes: 17 additions & 0 deletions ports/libb64/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
cmake_minimum_required(VERSION 3.20)
project(libb64)

set(SOURCE_FILES src/cdecode.c src/cencode.c)
set(HEADER_FILES include/b64/cdecode.h include/b64/cencode.h)

add_library(b64 STATIC ${SOURCE_FILES} ${HEADER_FILES})
Comment thread
9cvele3 marked this conversation as resolved.
Outdated
target_include_directories(b64 PRIVATE include)

set_target_properties(b64 PROPERTIES PUBLIC_HEADER "include/b64/cdecode.h;include/b64/cencode.h;include/b64/decode.h;include/b64/encode.h")

install(TARGETS b64
LIBRARY DESTINATION lib
PUBLIC_HEADER DESTINATION include/b64
)

Comment thread
9cvele3 marked this conversation as resolved.
Outdated

4 changes: 4 additions & 0 deletions ports/libb64/CONTROL
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Source: libb64
Comment thread
9cvele3 marked this conversation as resolved.
Outdated
Version: 2.0.0.1
Homepage: https://github.com/libb64/libb64
Description: libb64 is a library of ANSI C routines for fast encoding/decoding data into and from a base64-encoded format.
25 changes: 25 additions & 0 deletions ports/libb64/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libb64/libb64
REF v2.0.0.1
SHA512 72c2fd4c81575b505f4851cd3820b6a2d8e78cd031a1ed138ffe5667ca711558f43b515428971966f7a73ace7c9951f1f0b39c362a59fe4691958875775cce23
HEAD_REF master
PATCHES "windows-fix.patch"
)

file(COPY ports/libb64/CMakeLists.txt DESTINATION ${SOURCE_PATH}/)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
)

vcpkg_install_cmake()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)

#vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT})

vcpkg_copy_pdbs()

# handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
37 changes: 37 additions & 0 deletions ports/libb64/windows-fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..baabe4f
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,15 @@
+cmake_minimum_required(VERSION 3.20)
+project(libb64)
+
+set(SOURCE_FILES src/cdecode.c src/cencode.c)
+set(HEADER_FILES include/b64/cdecode.h include/b64/cencode.h)
+
+add_library(b64 STATIC ${SOURCE_FILES} ${HEADER_FILES})
+target_include_directories(b64 PRIVATE include)
+
+set_target_properties(b64 PROPERTIES PUBLIC_HEADER "include/b64/cdecode.h;include/b64/cencode.h;include/b64/decode.h;include/b64/encode.h")
+
+install(TARGETS b64
+ LIBRARY DESTINATION lib
+ PUBLIC_HEADER DESTINATION include/b64
+)
+

diff --git a/include/b64/ccommon.h b/include/b64/ccommon.h
index 2b614df..28a9936 100644
--- a/include/b64/ccommon.h
+++ b/include/b64/ccommon.h
@@ -14,7 +14,7 @@ For details, see http://sourceforge.net/projects/libb64
#ifndef HAVE_SIZE_T
#ifdef _WIN32
#include <crtdefs.h>
- #elseif defined (__unix__) || (defined (__APPLE__) && defined (__MACH__))
+ #elif defined (__unix__) || (defined (__APPLE__) && defined (__MACH__))
#include <stdlib.h>
#else
typedef unsigned long size_t;

4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -3080,6 +3080,10 @@
"baseline": "0.98.1",
"port-version": 5
},
"libb64": {
"baseline": "2.0.0.1",
"port-version": 0
},
"libbacktrace": {
"baseline": "2021-03-14",
"port-version": 0
Expand Down
9 changes: 9 additions & 0 deletions versions/l-/libb64.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "4d76f006dba0db9a73b4eed985bc7966c42b1d2e",
"version-string": "2.0.0.1",
"port-version": 0
}
]
}