vscarefulsource 2__tar.gz → 6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {vscarefulsource-2 → vscarefulsource-6}/.gitignore +2 -0
- {vscarefulsource-2 → vscarefulsource-6}/PKG-INFO +3 -13
- {vscarefulsource-2 → vscarefulsource-6}/README.md +0 -10
- vscarefulsource-6/hatch_build.py +47 -0
- vscarefulsource-6/meson.build +64 -0
- {vscarefulsource-2 → vscarefulsource-6}/meson.options +0 -0
- vscarefulsource-6/pyproject.toml +44 -0
- {vscarefulsource-2 → vscarefulsource-6}/src/carefulsource.cpp +0 -0
- {vscarefulsource-2 → vscarefulsource-6}/src/carefulsource.h +0 -0
- {vscarefulsource-2 → vscarefulsource-6}/src/cmyk.h +0 -0
- {vscarefulsource-2 → vscarefulsource-6}/src/decoder_base.h +0 -0
- {vscarefulsource-2 → vscarefulsource-6}/src/decoder_jpeg.cpp +0 -0
- {vscarefulsource-2 → vscarefulsource-6}/src/decoder_jpeg.h +0 -0
- {vscarefulsource-2 → vscarefulsource-6}/src/decoder_png.cpp +0 -0
- {vscarefulsource-2 → vscarefulsource-6}/src/decoder_png.h +0 -0
- {vscarefulsource-2 → vscarefulsource-6}/subprojects/lcms2.wrap +0 -0
- {vscarefulsource-2 → vscarefulsource-6}/subprojects/libjpeg-turbo.wrap +1 -0
- {vscarefulsource-2 → vscarefulsource-6}/subprojects/libpng.wrap +0 -0
- vscarefulsource-6/subprojects/packagefiles/libjpeg-turbo-force-pic.patch +12 -0
- {vscarefulsource-2 → vscarefulsource-6}/subprojects/zlib.wrap +0 -0
- vscarefulsource-2/.gitattributes +0 -2
- vscarefulsource-2/.github/workflows/build.yaml +0 -40
- vscarefulsource-2/dist/vscarefulsource-2.tar.gz +0 -0
- vscarefulsource-2/meson.build +0 -54
- vscarefulsource-2/pyproject.toml +0 -19
- vscarefulsource-2/vscarefulsource/__init__.py +0 -34
|
@@ -1,22 +1,12 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: vscarefulsource
|
|
3
|
-
Version:
|
|
3
|
+
Version: 6
|
|
4
4
|
Requires-Python: >3.12
|
|
5
|
-
Requires-Dist:
|
|
5
|
+
Requires-Dist: vapoursynth>=74
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
7
7
|
|
|
8
8
|
# CarefulSource
|
|
9
9
|
|
|
10
|
-
## Installation
|
|
11
|
-
|
|
12
|
-
`pip install vsnoise`
|
|
13
|
-
|
|
14
|
-
import vsauto
|
|
15
|
-
vsauto.load()
|
|
16
|
-
...
|
|
17
|
-
import vapoursynth as vs
|
|
18
|
-
vs.core.noise.Add(...)
|
|
19
|
-
|
|
20
10
|
## Usage
|
|
21
11
|
|
|
22
12
|
```
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import shutil
|
|
2
|
+
import subprocess
|
|
3
|
+
import sys
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
from typing import Any
|
|
6
|
+
|
|
7
|
+
from hatchling.builders.hooks.plugin.interface import BuildHookInterface
|
|
8
|
+
from packaging import tags
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class CustomHook(BuildHookInterface[Any]):
|
|
12
|
+
source_dir = Path("build")
|
|
13
|
+
target_dir = Path("vapoursynth/plugins")
|
|
14
|
+
|
|
15
|
+
def initialize(self, version: str, build_data: dict[str, Any]) -> None:
|
|
16
|
+
|
|
17
|
+
build_data["pure_python"] = False
|
|
18
|
+
build_data["tag"] = f"py3-none-{next(tags.platform_tags())}"
|
|
19
|
+
|
|
20
|
+
subprocess.run(
|
|
21
|
+
[
|
|
22
|
+
sys.executable,
|
|
23
|
+
"-m",
|
|
24
|
+
"mesonbuild.mesonmain",
|
|
25
|
+
"setup",
|
|
26
|
+
"build",
|
|
27
|
+
"--vsenv",
|
|
28
|
+
"-Dpy_ext=false",
|
|
29
|
+
],
|
|
30
|
+
check=True,
|
|
31
|
+
)
|
|
32
|
+
subprocess.run(
|
|
33
|
+
[sys.executable, "-m", "mesonbuild.mesonmain", "compile", "-C", "build"],
|
|
34
|
+
check=True,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
shutil.rmtree(self.target_dir.parent, ignore_errors=True)
|
|
38
|
+
for file_path in self.source_dir.rglob("*"):
|
|
39
|
+
if file_path.is_file() and file_path.suffix in [".dll", ".so", ".dylib"]:
|
|
40
|
+
build_data.setdefault("force_include", {})[str(file_path)] = str(
|
|
41
|
+
self.target_dir / file_path.name
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
def finalize(
|
|
45
|
+
self, version: str, build_data: dict[str, Any], artifact_path: str
|
|
46
|
+
) -> None:
|
|
47
|
+
shutil.rmtree(self.target_dir.parent, ignore_errors=True)
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
project('carefulsource', 'cpp',
|
|
2
|
+
default_options: ['buildtype=release', 'warning_level=2', 'b_lto=true', 'b_ndebug=if-release', 'cpp_std=c++20', 'default_library=static', 'wrap_mode=forcefallback'],
|
|
3
|
+
meson_version: '>=1.1.0',
|
|
4
|
+
version: '3'
|
|
5
|
+
)
|
|
6
|
+
|
|
7
|
+
cxx = meson.get_compiler('cpp')
|
|
8
|
+
gcc_syntax = cxx.get_argument_syntax() == 'gcc'
|
|
9
|
+
|
|
10
|
+
if get_option('buildtype') == 'release'
|
|
11
|
+
add_project_arguments(gcc_syntax ? ['-fno-math-errno', '-fno-trapping-math'] : ['/GS-'], language: 'cpp')
|
|
12
|
+
endif
|
|
13
|
+
|
|
14
|
+
py = import('python').find_installation(pure: false)
|
|
15
|
+
|
|
16
|
+
vapoursynth_include_command = run_command(
|
|
17
|
+
py,
|
|
18
|
+
'-c',
|
|
19
|
+
'import vapoursynth as vs; print(vs.get_include())',
|
|
20
|
+
check: true,
|
|
21
|
+
)
|
|
22
|
+
vapoursynth_inc = include_directories(vapoursynth_include_command.stdout().strip(), is_system: true)
|
|
23
|
+
vapoursynth_dep = declare_dependency(compile_args: '-I' + vapoursynth_include_command.stdout().strip())
|
|
24
|
+
|
|
25
|
+
lcms2_dep = dependency(
|
|
26
|
+
'lcms2',
|
|
27
|
+
fallback: ['lcms2', 'liblcms2_dep'],
|
|
28
|
+
default_options: ['tests=disabled', 'utils=false', 'default_library=static'],
|
|
29
|
+
)
|
|
30
|
+
libpng_dep = dependency(
|
|
31
|
+
'libpng',
|
|
32
|
+
fallback: ['libpng', 'libpng_dep'],
|
|
33
|
+
default_options: ['tests=false', 'default_library=static'],
|
|
34
|
+
)
|
|
35
|
+
libjpeg_dep = dependency(
|
|
36
|
+
'libjpeg',
|
|
37
|
+
fallback: ['libjpeg-turbo', 'libjpeg_dep'],
|
|
38
|
+
default_options: ['tests=disabled', 'default_library=static'],
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
sources = [
|
|
42
|
+
'src/carefulsource.cpp',
|
|
43
|
+
'src/decoder_png.cpp',
|
|
44
|
+
'src/decoder_jpeg.cpp',
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
deps = [vapoursynth_dep, lcms2_dep, libpng_dep, libjpeg_dep]
|
|
48
|
+
libs = []
|
|
49
|
+
|
|
50
|
+
if get_option('py_ext')
|
|
51
|
+
py.extension_module('vscarefulsource_ext', sources,
|
|
52
|
+
dependencies: deps,
|
|
53
|
+
link_with: libs,
|
|
54
|
+
install: true,
|
|
55
|
+
)
|
|
56
|
+
else
|
|
57
|
+
shared_module('carefulsource', sources,
|
|
58
|
+
dependencies: deps,
|
|
59
|
+
link_with: libs,
|
|
60
|
+
install: true,
|
|
61
|
+
install_dir: py.get_install_dir(pure: false) / 'vapoursynth' / 'plugins',
|
|
62
|
+
gnu_symbol_visibility: 'hidden',
|
|
63
|
+
)
|
|
64
|
+
endif
|
|
File without changes
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "vscarefulsource"
|
|
3
|
+
version = "6"
|
|
4
|
+
requires-python = ">3.12"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
dependencies = ["vapoursynth>=74"]
|
|
7
|
+
|
|
8
|
+
[build-system]
|
|
9
|
+
build-backend = "hatchling.build"
|
|
10
|
+
requires = ["hatchling", "packaging", "meson", "ninja", "wheel", "vapoursynth>=74"]
|
|
11
|
+
|
|
12
|
+
[tool.hatch.build.targets.wheel]
|
|
13
|
+
include = ["vapoursynth/plugins"]
|
|
14
|
+
artifacts = [
|
|
15
|
+
"vapoursynth/plugins/*.dylib",
|
|
16
|
+
"vapoursynth/plugins/*.so",
|
|
17
|
+
"vapoursynth/plugins/*.dll",
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
[tool.hatch.build.targets.sdist]
|
|
21
|
+
include = [
|
|
22
|
+
"src",
|
|
23
|
+
"subprojects/*.wrap",
|
|
24
|
+
"subprojects/packagefiles",
|
|
25
|
+
"subprojects/lcms2-*",
|
|
26
|
+
"subprojects/libjpeg-turbo-*",
|
|
27
|
+
"subprojects/libpng-*",
|
|
28
|
+
"subprojects/zlib-*",
|
|
29
|
+
"meson.build",
|
|
30
|
+
"meson.options",
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
[tool.hatch.build.targets.wheel.hooks.custom]
|
|
34
|
+
path = "hatch_build.py"
|
|
35
|
+
|
|
36
|
+
[tool.cibuildwheel]
|
|
37
|
+
archs = ["auto64"]
|
|
38
|
+
|
|
39
|
+
[tool.cibuildwheel.macos]
|
|
40
|
+
environment = { MACOSX_DEPLOYMENT_TARGET = "11.0" }
|
|
41
|
+
|
|
42
|
+
[[tool.cibuildwheel.overrides]]
|
|
43
|
+
select = "*-macosx_x86_64"
|
|
44
|
+
environment = { MACOSX_DEPLOYMENT_TARGET = "10.13" }
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -9,6 +9,7 @@ patch_url = https://wrapdb.mesonbuild.com/v2/libjpeg-turbo_3.1.3-1/get_patch
|
|
|
9
9
|
patch_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/libjpeg-turbo_3.1.3-1/libjpeg-turbo_3.1.3-1_patch.zip
|
|
10
10
|
patch_hash = 4c552c743b6a16d3338cbee6ab1dc10333f19a72464e7b7c964f6e03d78f48df
|
|
11
11
|
wrapdb_version = 3.1.3-1
|
|
12
|
+
diff_files = libjpeg-turbo-force-pic.patch
|
|
12
13
|
|
|
13
14
|
[provide]
|
|
14
15
|
dependency_names = libjpeg, libturbojpeg
|
|
File without changes
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
--- a/simd/meson.build
|
|
2
|
+
+++ b/simd/meson.build
|
|
3
|
+
@@ -173,7 +173,7 @@
|
|
4
|
+
simd = static_library(
|
|
5
|
+
'simd',
|
|
6
|
+
simd_src,
|
|
7
|
+
include_directories: [incdir, 'nasm', dir],
|
|
8
|
+
- pic: get_option('default_library') != 'static',
|
|
9
|
+
+ pic: true,
|
|
10
|
+
)
|
|
11
|
+
endif
|
|
12
|
+
elif host_cpu in ['arm', 'aarch64']
|
|
File without changes
|
vscarefulsource-2/.gitattributes
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
name: Build
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- master
|
|
7
|
-
|
|
8
|
-
jobs:
|
|
9
|
-
build-windows:
|
|
10
|
-
runs-on: windows-latest
|
|
11
|
-
defaults:
|
|
12
|
-
run:
|
|
13
|
-
shell: msys2 {0}
|
|
14
|
-
steps:
|
|
15
|
-
- name: Checkout code
|
|
16
|
-
uses: actions/checkout@v4
|
|
17
|
-
- name: Setup MSYS2
|
|
18
|
-
uses: msys2/setup-msys2@v2
|
|
19
|
-
with:
|
|
20
|
-
msystem: UCRT64
|
|
21
|
-
update: true
|
|
22
|
-
install: >-
|
|
23
|
-
base-devel
|
|
24
|
-
mingw-w64-ucrt-x86_64-gcc
|
|
25
|
-
mingw-w64-ucrt-x86_64-meson
|
|
26
|
-
mingw-w64-ucrt-x86_64-ninja
|
|
27
|
-
mingw-w64-ucrt-x86_64-vapoursynth
|
|
28
|
-
mingw-w64-ucrt-x86_64-libjpeg-turbo
|
|
29
|
-
mingw-w64-ucrt-x86_64-libpng
|
|
30
|
-
mingw-w64-ucrt-x86_64-lcms2
|
|
31
|
-
- name: Build
|
|
32
|
-
run: |
|
|
33
|
-
CXX="c++" meson setup build --prefer-static -Dcpp_link_args='-static'
|
|
34
|
-
meson compile -C build
|
|
35
|
-
- name: Upload
|
|
36
|
-
uses: actions/upload-artifact@v4
|
|
37
|
-
with:
|
|
38
|
-
name: carefulsource-windows
|
|
39
|
-
path: |
|
|
40
|
-
build/libcarefulsource.dll
|
|
Binary file
|
vscarefulsource-2/meson.build
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
project('carefulsource', 'cpp',
|
|
2
|
-
default_options: ['buildtype=release', 'warning_level=2', 'b_lto=true', 'b_ndebug=if-release', 'cpp_std=c++20'],
|
|
3
|
-
meson_version: '>=0.51.0',
|
|
4
|
-
version: '1'
|
|
5
|
-
)
|
|
6
|
-
|
|
7
|
-
cxx = meson.get_compiler('cpp')
|
|
8
|
-
|
|
9
|
-
gcc_syntax = cxx.get_argument_syntax() == 'gcc'
|
|
10
|
-
|
|
11
|
-
if get_option('buildtype') == 'release'
|
|
12
|
-
add_project_arguments(gcc_syntax ? ['-fno-math-errno', '-fno-trapping-math'] : ['/GS-'], language: 'cpp')
|
|
13
|
-
endif
|
|
14
|
-
|
|
15
|
-
if gcc_syntax
|
|
16
|
-
vapoursynth_dep = dependency('vapoursynth', version: '>=55').partial_dependency(compile_args: true, includes: true)
|
|
17
|
-
install_dir = vapoursynth_dep.get_variable(pkgconfig: 'libdir') / 'vapoursynth'
|
|
18
|
-
else
|
|
19
|
-
vapoursynth_inc = include_directories('C:/Program Files/VapourSynth/sdk/include/vapoursynth', is_system: true)
|
|
20
|
-
vapoursynth_dep = declare_dependency(include_directories: vapoursynth_inc)
|
|
21
|
-
install_dir = get_option('libdir') / 'vapoursynth'
|
|
22
|
-
endif
|
|
23
|
-
|
|
24
|
-
lcms2_dep = dependency('lcms2')
|
|
25
|
-
libpng_dep = dependency('libpng')
|
|
26
|
-
libjpeg_dep = dependency('libjpeg')
|
|
27
|
-
|
|
28
|
-
sources = [
|
|
29
|
-
'src/carefulsource.cpp',
|
|
30
|
-
'src/decoder_png.cpp',
|
|
31
|
-
'src/decoder_jpeg.cpp',
|
|
32
|
-
]
|
|
33
|
-
|
|
34
|
-
deps = [vapoursynth_dep, lcms2_dep, libpng_dep, libjpeg_dep]
|
|
35
|
-
libs = []
|
|
36
|
-
|
|
37
|
-
if get_option('py_ext')
|
|
38
|
-
python = import('python')
|
|
39
|
-
py = python.find_installation(pure: false)
|
|
40
|
-
py.extension_module('vscarefulsource_ext', sources,
|
|
41
|
-
dependencies: deps,
|
|
42
|
-
link_with: libs,
|
|
43
|
-
install: true,
|
|
44
|
-
)
|
|
45
|
-
py.install_sources(['vscarefulsource/__init__.py'], subdir: 'vscarefulsource')
|
|
46
|
-
else
|
|
47
|
-
shared_module('carefulsource', sources,
|
|
48
|
-
dependencies: deps,
|
|
49
|
-
link_with: libs,
|
|
50
|
-
install: true,
|
|
51
|
-
install_dir: install_dir,
|
|
52
|
-
gnu_symbol_visibility: 'hidden',
|
|
53
|
-
)
|
|
54
|
-
endif
|
vscarefulsource-2/pyproject.toml
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
[project]
|
|
2
|
-
name = "vscarefulsource"
|
|
3
|
-
version = "2"
|
|
4
|
-
requires-python = ">3.12"
|
|
5
|
-
readme = "README.md"
|
|
6
|
-
dependencies = ["vsauto"]
|
|
7
|
-
|
|
8
|
-
[build-system]
|
|
9
|
-
build-backend = "mesonpy"
|
|
10
|
-
requires = ["meson-python", "meson", "ninja", "wheel"]
|
|
11
|
-
|
|
12
|
-
[tool.meson-python]
|
|
13
|
-
allow-windows-internal-shared-libs = true
|
|
14
|
-
|
|
15
|
-
[tool.meson-python.args]
|
|
16
|
-
setup = ["-Dpy_ext=true"]
|
|
17
|
-
|
|
18
|
-
[project.entry-points.vsauto]
|
|
19
|
-
vscarefulsource = "vscarefulsource"
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
|
|
3
|
-
import vsauto
|
|
4
|
-
from pathlib import Path
|
|
5
|
-
|
|
6
|
-
# Use os.path.join for cross-platform compatibility
|
|
7
|
-
namespace = "vscarefulsource"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
@vsauto.hookimpl
|
|
11
|
-
def loadPlugin():
|
|
12
|
-
import importlib.util
|
|
13
|
-
import logging
|
|
14
|
-
from pathlib import Path
|
|
15
|
-
|
|
16
|
-
import vapoursynth as vs
|
|
17
|
-
|
|
18
|
-
# Gracefully handling cases where vapoursynth has autoloaded a plugin
|
|
19
|
-
# with the same namespace is strongly encouraged.
|
|
20
|
-
preloaded = next(
|
|
21
|
-
(plugin for plugin in vs.core.plugins() if plugin.namespace == namespace), None
|
|
22
|
-
)
|
|
23
|
-
if preloaded:
|
|
24
|
-
logging.warning(
|
|
25
|
-
f"A plugin at '{Path(preloaded.plugin_path)}' has prevented loading '{__name__}'. Please remove the conflicting package or auto-loaded plugin if you wish to use this version."
|
|
26
|
-
)
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
origin = importlib.util.find_spec("vscarefulsource_ext").origin
|
|
30
|
-
|
|
31
|
-
if os.name == "nt":
|
|
32
|
-
new_path = Path(origin).parent / ".vscarefulsource.mesonpy.libs"
|
|
33
|
-
os.add_dll_directory(new_path)
|
|
34
|
-
vs.core.std.LoadPlugin(origin)
|