Skip to content

Commit e9787b3

Browse files
committed
Add more dlls
1 parent 91fb055 commit e9787b3

2 files changed

Lines changed: 12 additions & 9 deletions

File tree

.github/workflows/wheels.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ jobs:
9191

9292
- name: Setup MSYS2 and install file
9393
if: runner.os == 'Windows'
94-
uses: msys2/setup-msys2@v2
94+
uses: msys2/setup-msys2@v2.27.0
9595
with:
9696
msystem: ${{ endsWith(matrix.only, '32') && 'mingw32' || 'mingw64' }}
9797
update: true
@@ -105,6 +105,16 @@ jobs:
105105
cp "/msys64/${{ endsWith(matrix.only, '32') && 'mingw32' || 'mingw64' }}/share/misc/magic.mgc" "magic"
106106
cp "/msys64/${{ endsWith(matrix.only, '32') && 'mingw32' || 'mingw64' }}/bin/libmagic-1.dll" "magic"
107107
cp "/msys64/${{ endsWith(matrix.only, '32') && 'mingw32' || 'mingw64' }}/bin/libsystre-0.dll" "magic"
108+
cp "/msys64/${{ endsWith(matrix.only, '32') && 'mingw32' || 'mingw64' }}/bin/libtre-5.dll" "magic"
109+
cp "/msys64/${{ endsWith(matrix.only, '32') && 'mingw32' || 'mingw64' }}/bin/libasprintf-0.dll" "magic"
110+
cp "/msys64/${{ endsWith(matrix.only, '32') && 'mingw32' || 'mingw64' }}/bin/libintl-8.dll" "magic"
111+
cp "/msys64/${{ endsWith(matrix.only, '32') && 'mingw32' || 'mingw64' }}/bin/libatomic-1.dll" "magic"
112+
cp "/msys64/${{ endsWith(matrix.only, '32') && 'mingw32' || 'mingw64' }}/bin/libgcc_s_seh-1.dll" "magic"
113+
cp "/msys64/${{ endsWith(matrix.only, '32') && 'mingw32' || 'mingw64' }}/bin/libgomp-1.dll" "magic"
114+
cp "/msys64/${{ endsWith(matrix.only, '32') && 'mingw32' || 'mingw64' }}/bin/libquadmath-0.dll" "magic"
115+
cp "/msys64/${{ endsWith(matrix.only, '32') && 'mingw32' || 'mingw64' }}/bin/libstdc++-6.dll" "magic"
116+
cp "/msys64/${{ endsWith(matrix.only, '32') && 'mingw32' || 'mingw64' }}/bin/libcharset-1.dll" "magic"
117+
cp "/msys64/${{ endsWith(matrix.only, '32') && 'mingw32' || 'mingw64' }}/bin/libiconv-2.dll" "magic"
108118
109119
- uses: pypa/cibuildwheel@v2.17.0 # sync version with pip install cibuildwheel above
110120
timeout-minutes: 10

add_libmagic.sh

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ install_precompiled() {
2626
# Debian https://packages.ubuntu.com/libmagic1
2727
# Alpine https://pkgs.alpinelinux.org/package/libmagic
2828
# RHEL https://git.almalinux.org/rpms/file
29-
# Windows https://packages.msys2.org/base/mingw-w64-file
3029
if [ -n "$(which brew)" ]; then
3130
brew install libmagic
3231
elif [ -n "$(which apt-get)" ]; then
@@ -36,12 +35,6 @@ install_precompiled() {
3635
apk add --update libmagic
3736
elif [ -n "$(which dnf)" ]; then
3837
dnf --setopt install_weak_deps=false -y install file-libs
39-
elif python -c 'import platform; assert platform.system() == "Windows"'; then
40-
pkg="mingw-w64-$(python -c 'import sysconfig; print("i686" if sysconfig.get_platform() == "win32" else "x86_64")')-file"
41-
pip install msys2dl
42-
msys2dl extract --output / ${pkg}
43-
# this is a libmagic dependency which also needs to be packaged
44-
cp "/mingw64/bin/libsystre-0.dll" "magic"
4538
fi
4639
}
4740

@@ -52,7 +45,7 @@ copy_libmagic() {
5245
libmagic_path="$(python -c 'from magic.loader import load_lib; print(load_lib()._name)')" &&
5346
cp "${libmagic_path}" "magic" &&
5447
# additionally copy compiled db into magic dir (prefer the one installed by install_source)
55-
( ( ( cp "/usr/local/share/misc/magic.mgc" "magic" || cp "/usr/share/misc/magic.mgc" "magic" ) || cp "/mingw64/share/misc/magic.mgc" "magic" ) || true ) &&
48+
( ( cp "/usr/local/share/misc/magic.mgc" "magic" || cp "/usr/share/misc/magic.mgc" "magic" ) || true ) &&
5649
# check what was copied
5750
ls -ltra magic
5851
}

0 commit comments

Comments
 (0)