Skip to content

Commit

Permalink
Merge pull request #2 from uilianries/b64-2.0.0.1
Browse files Browse the repository at this point in the history
[b64] Add patch for Windows
  • Loading branch information
KGrzeg authored Apr 23, 2023
2 parents 4e767cd + 8945101 commit 3569210
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
6 changes: 4 additions & 2 deletions recipes/b64/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from conan import ConanFile
from conan.tools.files import get, copy
from conan.tools.files import get, copy, export_conandata_patches, apply_conandata_patches
from conan.tools.cmake import cmake_layout, CMakeToolchain, CMake
import os

Expand Down Expand Up @@ -27,6 +27,7 @@ class B64Conan(ConanFile):

def export_sources(self):
copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder)
export_conandata_patches(self)

def config_options(self):
if self.settings.os == "Windows":
Expand All @@ -47,6 +48,7 @@ def generate(self):
tc.generate()

def build(self):
apply_conandata_patches(self)
cmake = CMake(self)
cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir))
cmake.build()
Expand All @@ -60,4 +62,4 @@ def package_info(self):
self.cpp_info.libs = ["b64"]

# TODO: Only for Conan 1.x legacy - Remove after running Conan 2.x only
self.env_info.PATH = os.path.join(self.package_folder, "bin")
self.env_info.PATH.append(os.path.join(self.package_folder, "bin"))
13 changes: 13 additions & 0 deletions recipes/b64/all/patches/0001-windows-elseif.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
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;

0 comments on commit 3569210

Please sign in to comment.