Skip to content

Commit

Permalink
(conan-io#18268) zimg: add version 3.0.5, add package_type
Browse files Browse the repository at this point in the history
* zimg: add version 3.0.5

* update PlatformToolset version for msvc

* import Version
  • Loading branch information
toge authored Jul 3, 2023
1 parent bd635eb commit f522f84
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
6 changes: 6 additions & 0 deletions recipes/zimg/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"3.0.5":
url: "https://github.com/sekrit-twc/zimg/archive/refs/tags/release-3.0.5.tar.gz"
sha256: "a9a0226bf85e0d83c41a8ebe4e3e690e1348682f6a2a7838f1b8cbff1b799bcf"
"3.0.4":
url: "https://github.com/sekrit-twc/zimg/archive/refs/tags/release-3.0.4.tar.gz"
sha256: "219d1bc6b7fde1355d72c9b406ebd730a4aed9c21da779660f0a4c851243e32f"
Expand All @@ -15,6 +18,9 @@ sources:
url: "https://github.com/sekrit-twc/zimg/archive/release-2.9.3.tar.gz"
sha256: "a15c0483fbe945ffe695a1a989bc43b3381c8bf33e2d1760464ec21d32cdf30b"
patches:
"3.0.5":
- patch_file: "patches/0001-msvc-remove-windows-target-platform.patch"
- patch_file: "patches/0002-msvc-solution.patch"
"3.0.4":
- patch_file: "patches/0001-msvc-remove-windows-target-platform.patch"
- patch_file: "patches/0002-msvc-solution.patch"
Expand Down
26 changes: 17 additions & 9 deletions recipes/zimg/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from conan.tools.gnu import Autotools, AutotoolsToolchain
from conan.tools.layout import basic_layout
from conan.tools.microsoft import check_min_vs, is_msvc, MSBuild, MSBuildToolchain
from conan.tools.scm import Version
import os

required_conan_version = ">=1.54.0"
Expand All @@ -14,11 +15,11 @@
class ZimgConan(ConanFile):
name = "zimg"
description = "Scaling, colorspace conversion, and dithering library"
topics = ("image", "manipulation")
homepage = "https://github.com/sekrit-twc/zimg"
url = "https://github.com/conan-io/conan-center-index"
license = "WTFPL"

url = "https://github.com/conan-io/conan-center-index"
homepage = "https://github.com/sekrit-twc/zimg"
topics = ("image", "manipulation")
package_type = "library"
settings = "os", "arch", "compiler", "build_type"
options = {
"shared": [True, False],
Expand Down Expand Up @@ -94,11 +95,18 @@ def build(self):
platform_toolset = MSBuildToolchain(self).toolset
conantoolchain_props = os.path.join(self.generators_folder, MSBuildToolchain.filename)
for vcxproj_file in vcxproj_files:
replace_in_file(
self, vcxproj_file,
"<PlatformToolset>v142</PlatformToolset>",
f"<PlatformToolset>{platform_toolset}</PlatformToolset>",
)
if Version(self.version) >= "3.0.5":
replace_in_file(
self, vcxproj_file,
"<PlatformToolset>v143</PlatformToolset>",
f"<PlatformToolset>{platform_toolset}</PlatformToolset>",
)
else:
replace_in_file(
self, vcxproj_file,
"<PlatformToolset>v142</PlatformToolset>",
f"<PlatformToolset>{platform_toolset}</PlatformToolset>",
)
replace_in_file(
self, vcxproj_file,
"<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />",
Expand Down
2 changes: 2 additions & 0 deletions recipes/zimg/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"3.0.5":
folder: "all"
"3.0.4":
folder: "all"
"3.0.3":
Expand Down

0 comments on commit f522f84

Please sign in to comment.