diff --git a/.github/workflows/python-publish-release.yml b/.github/workflows/python-publish-release.yml index ebf0a2a3..03fd8f18 100644 --- a/.github/workflows/python-publish-release.yml +++ b/.github/workflows/python-publish-release.yml @@ -21,6 +21,11 @@ jobs: uses: docker/setup-qemu-action@v3 with: platforms: all + # Temporary fix due to + # https://github.com/pypa/cibuildwheel/issues/2257 + # https://github.com/docker/setup-qemu-action/issues/188 + # https://github.com/tonistiigi/binfmt/issues/215 + image: tonistiigi/binfmt:qemu-v8.1.5 - name: Build wheels uses: pypa/cibuildwheel@v2.20.0 @@ -62,6 +67,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 diff --git a/CMakeLists.txt b/CMakeLists.txt index 67a46f48..aa195137 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -850,4 +850,4 @@ if(CAPSTONE_BUILD_CSTEST) endif() set(CPACK_PROJECT_CONFIG_FILE "${CMAKE_SOURCE_DIR}/CPackConfig.cmake") -include(CPackConfig.txt) \ No newline at end of file +include(CPackConfig.txt) diff --git a/bindings/python/setup.py b/bindings/python/setup.py index ef1eeb9a..79b59cf1 100755 --- a/bindings/python/setup.py +++ b/bindings/python/setup.py @@ -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"))) @@ -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))