From 4f3b30a26b4409edf7d1b99b4af5d5ecc6ce2c83 Mon Sep 17 00:00:00 2001 From: star9029 Date: Thu, 15 Aug 2024 22:27:11 +0800 Subject: [PATCH] photoshop-api: add package --- packages/p/photoshop-api/port/xmake.lua | 19 ++++++++++++++++++ packages/p/photoshop-api/xmake.lua | 26 +++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 packages/p/photoshop-api/port/xmake.lua create mode 100644 packages/p/photoshop-api/xmake.lua diff --git a/packages/p/photoshop-api/port/xmake.lua b/packages/p/photoshop-api/port/xmake.lua new file mode 100644 index 000000000..de47ca547 --- /dev/null +++ b/packages/p/photoshop-api/port/xmake.lua @@ -0,0 +1,19 @@ +add_rules("mode.debug", "mode.release") + +set_languages("c++20") + +add_requires("c-blosc2", {configs = {zlib = true, zstd = true}}) +add_requires("simdutf", {configs = {iconv = false}}) +add_requires("libdeflate") + +target("photoshop-api") + set_kind("$(kind)") + add_files("PhotoshopAPI/src/**.cpp") + add_includedirs("PhotoshopAPI/include", "PhotoshopAPI/src", "PhotoshopAPI/src/Util") + add_headerfiles("PhotoshopAPI/include/*.h", "PhotoshopAPI/src/(**.h)") + + add_packages("c-blosc2", "simdutf", "libdeflate") + + if is_plat("windows") and is_kind("shared") then + add_rules("utils.symbols.export_all", {export_classes = true}) + end diff --git a/packages/p/photoshop-api/xmake.lua b/packages/p/photoshop-api/xmake.lua new file mode 100644 index 000000000..6c4bdfe76 --- /dev/null +++ b/packages/p/photoshop-api/xmake.lua @@ -0,0 +1,26 @@ +package("photoshop-api") + set_homepage("https://photoshopapi.readthedocs.io/en/latest/") + set_description("A modern and performant C++20 read/write parser of Photoshop Files (*.psd and *.psb) with fully fledged Python bindings hosted on PyPi") + set_license("BSD-3-Clause") + + add_urls("https://github.com/EmilDohne/PhotoshopAPI/archive/refs/tags/$(version).tar.gz", + "https://github.com/EmilDohne/PhotoshopAPI.git") + + add_versions("v0.4.0", "c62fb9bfdb53de5f5851a2822ac1732f9af4d866a9af6fae9912ed3b829e9422") + + add_deps("c-blosc2", {configs = {zlib = true, zstd = true}}) + add_deps("simdutf", {configs = {iconv = false}}) + add_deps("libdeflate") + + on_install(function (package) + os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua") + import("package.tools.xmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + void test() { + auto layeredFile = PhotoshopAPI::LayeredFile::read("InputFile.psd"); + } + ]]}, {configs = {languages = "c++20"}, includes = "PhotoshopAPI.h"})) + end)