summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/actions/setup-msys2/action.yml2
-rw-r--r--CHANGELOG.rst5
-rw-r--r--MANIFEST.in1
-rw-r--r--deps/jq-1.8.0-Makefile.patch24
-rw-r--r--setup.py1
5 files changed, 32 insertions, 1 deletions
diff --git a/.github/actions/setup-msys2/action.yml b/.github/actions/setup-msys2/action.yml
index 4816b95..60aa1cb 100644
--- a/.github/actions/setup-msys2/action.yml
+++ b/.github/actions/setup-msys2/action.yml
@@ -10,7 +10,7 @@ runs:
uses: msys2/setup-msys2@v2
with:
msystem: ${{ inputs.arch == 'x86' && 'mingw32' || 'ucrt64' }}
- install: make mingw-w64-${{ inputs.arch == 'x86' && 'i686' || 'ucrt-x86_64' }}-gcc
+ install: make mingw-w64-${{ inputs.arch == 'x86' && 'i686' || 'ucrt-x86_64' }}-gcc patch
- name: Set PATH for x86
if: ${{ inputs.arch == 'x86' }}
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 5d66343..716262a 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,6 +1,11 @@
Changelog
=========
+1.9.1
+-----
+
+* Apply a patch to jq to fix musl builds.
+
1.9.0
-----
diff --git a/MANIFEST.in b/MANIFEST.in
index 560151a..d170088 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,6 +1,7 @@
include README.rst
include LICENSE
include deps/*.tar.gz
+include deps/jq-1.8.0-Makefile.patch
recursive-include tests *.py
include tox.ini
include jq.pyx
diff --git a/deps/jq-1.8.0-Makefile.patch b/deps/jq-1.8.0-Makefile.patch
new file mode 100644
index 0000000..5bb87ad
--- /dev/null
+++ b/deps/jq-1.8.0-Makefile.patch
@@ -0,0 +1,24 @@
+diff -rBu a/Makefile.am b/Makefile.am
+--- a/Makefile.am 2025-06-01 06:58:31.000000000 +0100
++++ b/Makefile.am 2025-06-14 15:01:47.294842066 +0100
+@@ -99,7 +99,7 @@
+ # Remake the version.h header file if, and only if, the git ID has changed
+ .PHONY: .FORCE
+ .FORCE:
+-generate_ver = ver="`{ $(srcdir)/scripts/version || echo '$(VERSION)' ; } | sed 's/.*/\x23define JQ_VERSION \"&\"/'`"
++generate_ver = ver="`{ $(srcdir)/scripts/version || echo '$(VERSION)' ; } | xargs printf '\043define JQ_VERSION \"%s\"\n'`"
+ .remake-version-h: .FORCE
+ @ $(generate_ver); test "x`cat src/version.h 2>/dev/null`" = "x$$ver" || touch .remake-version-h
+ src/version.h: .remake-version-h
+diff -rBu a/Makefile.in b/Makefile.in
+--- a/Makefile.in 2025-06-01 06:58:46.000000000 +0100
++++ b/Makefile.in 2025-06-14 15:05:52.913771036 +0100
+@@ -754,7 +754,7 @@
+ @ENABLE_ERROR_INJECTION_TRUE@libinject_errors_la_SOURCES = src/inject_errors.c
+ @ENABLE_ERROR_INJECTION_TRUE@libinject_errors_la_LIBADD = -ldl
+ @ENABLE_ERROR_INJECTION_TRUE@libinject_errors_la_LDFLAGS = -module
+-generate_ver = ver="`{ $(srcdir)/scripts/version || echo '$(VERSION)' ; } | sed 's/.*/\x23define JQ_VERSION \"&\"/'`"
++generate_ver = ver="`{ $(srcdir)/scripts/version || echo '$(VERSION)' ; } | xargs printf '\043define JQ_VERSION \"%s\"\n'`"
+ CLEANFILES = src/version.h .remake-version-h src/builtin.inc \
+ src/config_opts.inc jq.1
+ jq_SOURCES = src/main.c
diff --git a/setup.py b/setup.py
index 7b015bd..a06b9b7 100644
--- a/setup.py
+++ b/setup.py
@@ -47,6 +47,7 @@ class jq_with_deps_build_ext(build_ext):
tarball_path=jq_lib_tarball_path,
lib_dir=jq_lib_dir,
commands=[
+ ["patch", "-i", _dep_source_path("jq-1.8.0-Makefile.patch")],
["./configure", "CFLAGS=-fPIC -pthread", "--disable-maintainer-mode", "--with-oniguruma=builtin"],
["make"],
])