Skip to content

Commit

Permalink
Fix sdist build and add CI job for testing it.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rot127 committed Feb 6, 2025
1 parent 5526125 commit fac24e1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .github/workflows/python-publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ jobs:
cd bindings/python
pipx run build --sdist
- name: Test build with sdist
run: |
TMP_DIR=$(mktemp -d)
tar -xf bindings/python/dist/*.tar.gz -C $TMP_DIR/
cd $TMP_DIR/*/src
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DCAPSTONE_BUILD_TESTS=OFF -DCAPSTONE_BUILD_CSTOOL=OFF -B build
cmake --build build
- uses: actions/upload-artifact@v4
with:
path: bindings/python/dist/*.tar.gz
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -850,4 +850,4 @@ if(CAPSTONE_BUILD_CSTEST)
endif()

set(CPACK_PROJECT_CONFIG_FILE "${CMAKE_SOURCE_DIR}/CPackConfig.cmake")
include(CPackConfig.txt)
include(CPackConfig.txt)
3 changes: 3 additions & 0 deletions bindings/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def copy_sources():
shutil.copytree(os.path.join(BUILD_DIR, "include"), os.path.join(SRC_DIR, "include"))

src.extend(glob.glob(os.path.join(BUILD_DIR, "*.[ch]")))
src.extend(glob.glob(os.path.join(BUILD_DIR, "*.in")))
src.extend(glob.glob(os.path.join(BUILD_DIR, "*.mk")))

src.extend(glob.glob(os.path.join(BUILD_DIR, "Makefile")))
Expand All @@ -99,6 +100,8 @@ def copy_sources():
src.extend(glob.glob(os.path.join(BUILD_DIR, "make.sh")))
src.extend(glob.glob(os.path.join(BUILD_DIR, "CMakeLists.txt")))
src.extend(glob.glob(os.path.join(BUILD_DIR, "pkgconfig.mk")))
src.extend(glob.glob(os.path.join(BUILD_DIR, "CPackConfig.txt")))
src.extend(glob.glob(os.path.join(BUILD_DIR, "CPackConfig.cmake")))

for filename in src:
outpath = os.path.join(SRC_DIR, os.path.basename(filename))
Expand Down

0 comments on commit fac24e1

Please sign in to comment.