Skip to content

Commit

Permalink
Bring back Wuffs submodule (primary repo)
Browse files Browse the repository at this point in the history
Otherwise it's barely possible to make both CMake
and setuptools work without installing tons of deps
to the environment
  • Loading branch information
dev0x13 committed Mar 12, 2024
1 parent 1abddda commit c48d71b
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 12 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ build/
_build/
pywuffs.egg-info/
__pycache__/
src/wuffs-unsupported-snapshot.c
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "libs/wuffs"]
path = libs/wuffs
url = https://github.com/google/wuffs.git
6 changes: 1 addition & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@ elseif(MSVC)
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "/arch:AVX")
endif()

file(
DOWNLOAD
https://raw.githubusercontent.com/google/wuffs/13c72db3508d33b9416a22a0ab8a8d4d8d5cd7be/release/c/wuffs-unsupported-snapshot.c
${CMAKE_SOURCE_DIR}/src/wuffs-unsupported-snapshot.c)

find_package(pybind11 REQUIRED)

pybind11_add_module(pywuffs src/wuffs-bindings.cpp)
target_include_directories(pywuffs PRIVATE libs/wuffs/release/c/)
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
include src/wuffs-aux-image-wrapper.h src/wuffs-aux-json-wrapper.h src/wuffs-unsupported-snapshot.c
include src/wuffs-aux-image-wrapper.h src/wuffs-aux-json-wrapper.h libs/wuffs/release/c/wuffs-unsupported-snapshot.c

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ the [Auxiliary C++ API](https://github.com/google/wuffs/blob/main/doc/note/auxil
interest since it provides for "ridiculously fast" decoding of images of some types.

Current version of Wuffs library used in this project is **unsupported snapshot** taken from
[this](https://github.com/google/wuffs/commit/13c72db3508d33b9416a22a0ab8a8d4d8d5cd7be) commit. The primary
[this](https://github.com/google/wuffs/tree/13c72db3508d33b9416a22a0ab8a8d4d8d5cd7be) commit. The primary
rationale for using the snapshot version instead of a stable release is that it provides JPEG decoder.

## Installation
Expand Down
1 change: 1 addition & 0 deletions libs/wuffs
Submodule wuffs added at 13c72d
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ def build_extensions(self):
ext_modules = [
Pybind11Extension(
"pywuffs",
["src/wuffs-bindings.cpp"]
["src/wuffs-bindings.cpp"],
include_dirs=["libs/wuffs/release/c"]
),
]

Expand Down
2 changes: 1 addition & 1 deletion src/wuffs-aux-image-wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <utility>
#include <vector>

#include "wuffs-unsupported-snapshot.c"
#include <wuffs-unsupported-snapshot.c>

// This API wraps the wuffs_aux API for image decoding. The wrapper is needed
// since the wuffs_aux API uses the callback-based approach which doesn't play
Expand Down
2 changes: 1 addition & 1 deletion src/wuffs-aux-json-wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <utility>
#include <vector>

#include "wuffs-unsupported-snapshot.c"
#include <wuffs-unsupported-snapshot.c>

// This API wraps the wuffs_aux API for JSON decoding. The wrapper is needed
// since the wuffs_aux API uses the callback-based approach which doesn't play
Expand Down
2 changes: 1 addition & 1 deletion src/wuffs-bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>

#include "wuffs-unsupported-snapshot.c"
#include <wuffs-unsupported-snapshot.c>

#include "wuffs-aux-image-wrapper.h"
#include "wuffs-aux-json-wrapper.h"
Expand Down

0 comments on commit c48d71b

Please sign in to comment.