mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-23 02:00:20 +07:00
conan: add geosite.dat and geoip.dat
This commit is contained in:
@@ -26,6 +26,7 @@ class AmneziaVPN(ConanFile):
|
|||||||
self.requires("amnezia-xray-bindings/1.1.0")
|
self.requires("amnezia-xray-bindings/1.1.0")
|
||||||
self.requires("tun2socks/2.6.0")
|
self.requires("tun2socks/2.6.0")
|
||||||
self.requires("openvpn/2.7.0")
|
self.requires("openvpn/2.7.0")
|
||||||
|
self.requires("v2ray-rules-dat/[*]")
|
||||||
|
|
||||||
if has_ne:
|
if has_ne:
|
||||||
self.requires("awg-apple/2.0.1")
|
self.requires("awg-apple/2.0.1")
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
from conan import ConanFile
|
|
||||||
|
|
||||||
class PackageConan(ConanFile):
|
|
||||||
name = "domain-list-community"
|
|
||||||
version = "20260227093604"
|
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
from conan import ConanFile
|
||||||
|
from conan.tools.layout import basic_layout
|
||||||
|
from conan.tools.files import download, copy
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
class V2rayRulesDat(ConanFile):
|
||||||
|
name = "v2ray-rules-dat"
|
||||||
|
version = "202603162227"
|
||||||
|
|
||||||
|
def layout(self):
|
||||||
|
basic_layout(self, build_folder=".")
|
||||||
|
|
||||||
|
def source(self):
|
||||||
|
# TODO(ygurov): build from source instead of plain copying
|
||||||
|
download(self, filename="geoip.dat", url=f"https://github.com/Loyalsoldier/v2ray-rules-dat/releases/download/{self.version}/geoip.dat",
|
||||||
|
sha256="e48b925d985d7bf33cfee76f309241af0f1779699963b69363dec2c4740041d1")
|
||||||
|
download(self, filename="geosite.dat", url=f"https://github.com/Loyalsoldier/v2ray-rules-dat/releases/download/{self.version}/geosite.dat",
|
||||||
|
sha256="a2f83e25b8be3f089cfdd9423fc7b6eda5a0d4060919917902711d65acac1e0c")
|
||||||
|
|
||||||
|
def package(self):
|
||||||
|
copy(self, "*.dat", src=self.build_folder, dst=self.package_folder)
|
||||||
|
|
||||||
|
def package_info(self):
|
||||||
|
self.cpp_info.set_property("cmake_target_name", "Loyalsoldier::v2ray-rules-dat")
|
||||||
|
self.cpp_info.set_property("cmake_extra_variables", {
|
||||||
|
"GEOSITE_DAT_PATH": os.path.join(self.package_folder, "geosite.dat"),
|
||||||
|
"GEOIP_DAT_PATH": os.path.join(self.package_folder, "geoip.dat")
|
||||||
|
})
|
||||||
@@ -381,3 +381,15 @@ add_custom_command(TARGET ${PROJECT} POST_BUILD
|
|||||||
$<TARGET_FILE:xjasonlyu::tun2socks>
|
$<TARGET_FILE:xjasonlyu::tun2socks>
|
||||||
$<TARGET_FILE_DIR:${PROJECT}>
|
$<TARGET_FILE_DIR:${PROJECT}>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
find_package(v2ray-rules-dat REQUIRED)
|
||||||
|
add_custom_command(TARGET ${PROJECT} POST_BUILD
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||||
|
${GEOSITE_DAT_PATH}
|
||||||
|
$<TARGET_FILE_DIR:${PROJECT}>
|
||||||
|
)
|
||||||
|
add_custom_command(TARGET ${PROJECT} POST_BUILD
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||||
|
${GEOIP_DAT_PATH}
|
||||||
|
$<TARGET_FILE_DIR:${PROJECT}>
|
||||||
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user