From e92b892cb766958d990989cd8feed234530150ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= Date: Mon, 4 Nov 2024 18:48:27 +0100 Subject: [PATCH] fontforge: do not use distutils --- mingw-w64-fontforge/001-no-distutils.patch | 24 ++++++++++++++++++++++ mingw-w64-fontforge/PKGBUILD | 20 ++++++++++++++---- 2 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 mingw-w64-fontforge/001-no-distutils.patch diff --git a/mingw-w64-fontforge/001-no-distutils.patch b/mingw-w64-fontforge/001-no-distutils.patch new file mode 100644 index 0000000000..ccf57f361d --- /dev/null +++ b/mingw-w64-fontforge/001-no-distutils.patch @@ -0,0 +1,24 @@ +diff -urN fontforge-20230101/pyhook/CMakeLists.txt.orig fontforge-20230101/pyhook/CMakeLists.txt +--- fontforge-20230101/pyhook/CMakeLists.txt.orig 2023-01-01 06:25:39.000000000 +0100 ++++ fontforge-20230101/pyhook/CMakeLists.txt 2024-11-04 18:45:57.371407500 +0100 +@@ -21,7 +21,19 @@ + # So do it ourselves, getting the prefix-relative path instead + if(NOT DEFINED PYHOOK_INSTALL_DIR) + execute_process( +- COMMAND "${Python3_EXECUTABLE}" -c "import distutils.sysconfig as sc; print(sc.get_python_lib(prefix='', plat_specific=True,standard_lib=False))" ++ COMMAND "${Python3_EXECUTABLE}" -c " ++import sys ++import sysconfig ++import os ++ ++platlib = sysconfig.get_path('platlib') ++prefix = sys.prefix ++ ++if platlib.startswith(prefix): ++ print(platlib[len(prefix):].lstrip(os.sep)) ++else: ++ print(platlib) ++" + RESULT_VARIABLE _pyhook_install_dir_result + OUTPUT_VARIABLE PYHOOK_INSTALL_DIR + OUTPUT_STRIP_TRAILING_WHITESPACE) diff --git a/mingw-w64-fontforge/PKGBUILD b/mingw-w64-fontforge/PKGBUILD index ebc1ed2796..78d1ca01e6 100644 --- a/mingw-w64-fontforge/PKGBUILD +++ b/mingw-w64-fontforge/PKGBUILD @@ -4,7 +4,7 @@ _realname=fontforge pkgbase=mingw-w64-${_realname} pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" pkgver=20230101 -pkgrel=3 +pkgrel=4 pkgdesc='Outline and bitmap font editor (mingw-w64)' arch=('any') mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64') @@ -38,13 +38,25 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-cc" "${MINGW_PACKAGE_PREFIX}-ninja" "${MINGW_PACKAGE_PREFIX}-python-sphinx") source=("https://github.com/${_realname}/${_realname}/releases/download/${pkgver}/${_realname}-${pkgver}.tar.xz" - "fontforge-doc-no-warn-error.patch") + "fontforge-doc-no-warn-error.patch" + "001-no-distutils.patch") sha256sums=('ca82ec4c060c4dda70ace5478a41b5e7b95eb035fe1c4cf85c48f996d35c60f8' - 'b87fa5a39d6948262d2dfb9b84c2462dc21de0bfb115cdd13e893c1b533d8f78') + 'b87fa5a39d6948262d2dfb9b84c2462dc21de0bfb115cdd13e893c1b533d8f78' + '9903e4ff6f202cf588d71f23fd8c8a11b88ef9d9e796f8b41305bb27c87e50ea') + +apply_patch_with_msg() { + for _patch in "$@" + do + msg2 "Applying $_patch" + patch -Np1 -i "${srcdir}/$_patch" + done +} prepare() { cd "${srcdir}/${_realname}-${pkgver}" - patch -p1 -i "${srcdir}/fontforge-doc-no-warn-error.patch" + apply_patch_with_msg \ + fontforge-doc-no-warn-error.patch \ + 001-no-distutils.patch } build() {