Skip to content

Commit 2536967

Browse files
committed
Revert "remove tmpfile (#49)"
This reverts commit 91b5cdd.
1 parent 2cfd1f6 commit 2536967

File tree

15 files changed

+396
-0
lines changed

15 files changed

+396
-0
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ on:
1616
- openlibm
1717
- fontconfig
1818
- glib
19+
- tmpfile
1920
- libgsf
2021
- wvware
2122
package_version:

defaults.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
packages:
22
include:
33
- "glib/2.81.0-odr"
4+
- "tmpfile/3.0.6"
45
- "fontconfig/2.15.0-odr"
56
- "poppler-data/0.4.12-odr"
67
- "openlibm/0.8.3"
@@ -42,6 +43,13 @@ rules:
4243
- "libgsf/*"
4344
- "wvware/*"
4445
platforms: "windows*"
46+
# tmpfile is needed only for Android
47+
- type: "exclude"
48+
packages: "tmpfile/*"
49+
platforms:
50+
- "macos*"
51+
- "ubuntu*"
52+
- "windows*"
4553
# poppler-data is the same package for all configurations
4654
- type: "exclude"
4755
packages: "poppler-data/*"

recipes/fontforge/20240423/conan.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"version": "0.5",
33
"requires": [
44
"zlib/1.3.1#b8bc2603263cf7eccbd6e17e66b0ed76%1754336059.551",
5+
"tmpfile/3.0.6#55320ca8b4f0ce73669da77e247497d5%1748074610.727",
56
"pcre2/10.42#9a35f5089feb875ec61a38eca364ce77%1754336050.663",
67
"openlibm/0.8.3#61d8454cf655e95e0d3d3359bde58ac7%1754339136.456942",
78
"libxml2/2.12.7#1c4d20b7ab8b618ce699733723ba4df6%1754336034.974",

recipes/fontforge/20240423/conanfile.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ def requirements(self):
5959
if self.settings.os == "Android" and int(self.settings.os.get_safe("api_level")) < 23:
6060
self.requires("openlibm/0.8.3")
6161

62+
if self.settings.os == "Android":
63+
self.requires("tmpfile/3.0.6")
64+
6265
def build_requirements(self):
6366
self.tool_requires("gettext/0.22.5")
6467

recipes/odrcore/5/conanfile.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ class OpenDocumentCoreConan(ConanFile):
2121
"fPIC": [True, False],
2222
"with_pdf2htmlEX": [True, False],
2323
"with_wvWare": [True, False],
24+
"with_tmpfile_hack": [True, False],
2425
}
2526
default_options = {
2627
"shared": False,
2728
"fPIC": True,
2829
"with_pdf2htmlEX": True,
2930
"with_wvWare": True,
31+
"with_tmpfile_hack": True,
3032
}
3133

3234
def config_options(self):
@@ -37,6 +39,9 @@ def config_options(self):
3739
del self.options.with_pdf2htmlEX
3840
del self.options.with_wvWare
3941

42+
if self.settings.os != "Android":
43+
del self.options.with_tmpfile_hack
44+
4045
def configure(self):
4146
if self.options.shared:
4247
self.options.rm_safe("fPIC")
@@ -57,6 +62,9 @@ def requirements(self):
5762
if self.options.get_safe("with_wvWare"):
5863
self.requires("wvware/1.2.9-odr")
5964

65+
if self.options.get_safe("with_tmpfile_hack", False):
66+
self.requires("tmpfile/3.0.6")
67+
6068
def build_requirements(self):
6169
self.test_requires("gtest/1.14.0")
6270

recipes/odrcore/main/conanfile.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ class OpenDocumentCoreConan(ConanFile):
2121
"fPIC": [True, False],
2222
"with_pdf2htmlEX": [True, False],
2323
"with_wvWare": [True, False],
24+
"with_tmpfile_hack": [True, False],
2425
}
2526
default_options = {
2627
"shared": False,
2728
"fPIC": True,
2829
"with_pdf2htmlEX": True,
2930
"with_wvWare": True,
31+
"with_tmpfile_hack": True,
3032
}
3133

3234
def config_options(self):
@@ -37,6 +39,9 @@ def config_options(self):
3739
del self.options.with_pdf2htmlEX
3840
del self.options.with_wvWare
3941

42+
if self.settings.os != "Android":
43+
del self.options.with_tmpfile_hack
44+
4045
def configure(self):
4146
if self.options.shared:
4247
self.options.rm_safe("fPIC")
@@ -57,6 +62,9 @@ def requirements(self):
5762
if self.options.get_safe("with_wvWare"):
5863
self.requires("wvware/1.2.9-odr")
5964

65+
if self.options.get_safe("with_tmpfile_hack", False):
66+
self.requires("tmpfile/3.0.6")
67+
6068
def build_requirements(self):
6169
self.test_requires("gtest/1.14.0")
6270

recipes/tmpfile/3.0.6/conan.lock

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"version": "0.5",
3+
"requires": [],
4+
"build_requires": [],
5+
"python_requires": [],
6+
"config_requires": []
7+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
sources:
2+
"3.0.6":
3+
url: "https://github.com/ViliusSutkus89/tmpfile-Android/archive/refs/tags/v3.0.6.tar.gz"
4+
sha256: "e71dc8fabad2b36954188474d7b8760b2f34e311534d76428156cea3049ea4e3"

recipes/tmpfile/3.0.6/conanfile.py

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import os
2+
3+
from conan import ConanFile
4+
from conan.errors import ConanInvalidConfiguration
5+
from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps
6+
from conan.tools.files import apply_conandata_patches, copy, get
7+
8+
required_conan_version = ">=2.0.6"
9+
10+
11+
class TmpfileConan(ConanFile):
12+
name = "tmpfile"
13+
package_type = "library"
14+
15+
license = ["GPLv3"]
16+
homepage = "https://github.com/ViliusSutkus89/tmpfile-Android/"
17+
url = "https://github.com/opendocument-app/conan-odr-index"
18+
description = "tmpfile POSIX function fix for Android"
19+
topics = ("android", "posix", "workaround", "tmpfile", "bionic")
20+
21+
# Binary configuration
22+
settings = "os", "compiler", "build_type", "arch"
23+
options = {"shared": [True, False], "fPIC": [True, False]}
24+
default_options = {"shared": False, "fPIC": True}
25+
26+
def source(self):
27+
get(self, **self.conan_data["sources"][self.version], strip_root=True)
28+
apply_conandata_patches(self)
29+
30+
def config_options(self):
31+
if self.settings.os == "Windows":
32+
self.options.rm_safe("fPIC")
33+
34+
def configure(self):
35+
if self.options.shared:
36+
self.options.rm_safe("fPIC")
37+
38+
def validate(self):
39+
if self.settings.os != "Android":
40+
raise ConanInvalidConfiguration("Only Android is supported")
41+
42+
def layout(self):
43+
cmake_layout(self)
44+
45+
def generate(self):
46+
deps = CMakeDeps(self)
47+
deps.generate()
48+
tc = CMakeToolchain(self)
49+
tc.variables["WITH_JNI"] = "OFF"
50+
tc.generate()
51+
52+
def build(self):
53+
cmake = CMake(self)
54+
cmake.configure(build_script_folder='tmpfile/src/main/cpp')
55+
cmake.build()
56+
57+
def package(self):
58+
copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses"))
59+
cmake = CMake(self)
60+
cmake.install()
61+
62+
def package_info(self):
63+
self.cpp_info.libs = ["tmpfile"]
64+
self.cpp_info.system_libs = ["log"]
65+
self.cpp_info.includedirs = None
66+
self.cpp_info.bindirs = None
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
cmake_minimum_required(VERSION 3.15)
2+
project(tmpfile_tests CXX)
3+
4+
find_package(tmpfile CONFIG REQUIRED)
5+
6+
add_executable(${PROJECT_NAME} libTests.exe.cpp)
7+
target_link_libraries(${PROJECT_NAME} tmpfile::tmpfile)

0 commit comments

Comments
 (0)