Skip to content

Commit

Permalink
(conan-io#13084) libxft/2.3.6
Browse files Browse the repository at this point in the history
* libxft/2.3.6

* disable gcc <6

* fix gcc 5 and gcc 11

* Apply suggestions from code review

Co-authored-by: Uilian Ries <uilianries@gmail.com>

* Update conanfile.py

Co-authored-by: Uilian Ries <uilianries@gmail.com>
  • Loading branch information
2 people authored and kayoub5 committed Sep 29, 2022
1 parent f16f5ae commit ed0e2fa
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 8 deletions.
10 changes: 10 additions & 0 deletions recipes/libxft/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
sources:
"2.3.6":
url: "https://www.x.org/archive/individual/lib/libXft-2.3.6.tar.gz"
sha256: "b7e59f69e0bbabe9438088775f7e5a7c16a572e58b11f9722519385d38192df5"
"2.3.4":
url: "https://www.x.org/archive/individual/lib/libXft-2.3.4.tar.gz"
sha256: "1eca71bec9cb483165ce1ab94f5cd3036269f5268651df6a2d99c4a7ab644d79"
patches:
"2.3.6":
- patch_file: "patches/0001-fix-gcc-5-and-11.patch"
patch_description: "fix gcc 5 and gcc 11 compilation"
patch_type: "portability"
patch_source: "https://gitlab.freedesktop.org/xorg/lib/libxft/-/merge_requests/17"
base_path: "source_subfolder"
20 changes: 12 additions & 8 deletions recipes/libxft/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from conan import ConanFile
from conan.tools import files
from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, chdir, rm, rmdir
from conans import AutoToolsBuildEnvironment
import functools

required_conan_version = ">=1.33.0"
required_conan_version = ">=1.52.0"

class libxftConan(ConanFile):
name = "libxft"
Expand All @@ -22,6 +22,9 @@ class libxftConan(ConanFile):
def _source_subfolder(self):
return "source_subfolder"

def export_sources(self):
export_conandata_patches(self)

def requirements(self):
self.requires("xorg/system")
self.requires("freetype/2.12.1")
Expand All @@ -33,7 +36,7 @@ def build_requirements(self):
self.build_requires("libtool/2.4.7")

def source(self):
files.get(self, **self.conan_data["sources"][self.version],
get(self, **self.conan_data["sources"][self.version],
destination=self._source_subfolder, strip_root=True)

def configure(self):
Expand All @@ -54,19 +57,20 @@ def _configure_autotools(self):
return autotools

def build(self):
with files.chdir(self, self._source_subfolder):
apply_conandata_patches(self)
with chdir(self, self._source_subfolder):
autotools = self._configure_autotools()
autotools.make()

def package(self):
self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder)
self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder)
with files.chdir(self, self._source_subfolder):
with chdir(self, self._source_subfolder):
autotools = self._configure_autotools()
autotools.install(args=["-j1"])
files.rm(self, "*.la", f"{self.package_folder}/lib", recursive=True)
files.rmdir(self, f"{self.package_folder}/lib/pkgconfig")
files.rmdir(self, f"{self.package_folder}/share")
rm(self, "*.la", f"{self.package_folder}/lib", recursive=True)
rmdir(self, f"{self.package_folder}/lib/pkgconfig")
rmdir(self, f"{self.package_folder}/share")

def package_info(self):
self.cpp_info.names['pkg_config'] = "Xft"
Expand Down
24 changes: 24 additions & 0 deletions recipes/libxft/all/patches/0001-fix-gcc-5-and-11.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
From 84310d83bf4c057dd0866e7116779c9c2f043007 Mon Sep 17 00:00:00 2001
From: ericLemanissier <eric.lemanissier@gmail.com>
Date: Fri, 23 Sep 2022 07:59:55 +0000
Subject: [PATCH] fix compilation with gcc 5 and gcc 11

stdint.h header is needed for SIZE_MAX
---
src/xftrender.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/src/xftrender.c b/src/xftrender.c
index 3021d56..c15237e 100644
--- a/src/xftrender.c
+++ b/src/xftrender.c
@@ -21,6 +21,7 @@
*/

#include "xftint.h"
+#include <stdint.h>

#define NUM_LOCAL 1024
#define NUM_ELT_LOCAL 128
--
GitLab
2 changes: 2 additions & 0 deletions recipes/libxft/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
versions:
"2.3.6":
folder: all
"2.3.4":
folder: all

0 comments on commit ed0e2fa

Please sign in to comment.