lol

python3Packages.afdko: 3.5.1 -> 3.7.1

+91 -21
+24 -21
pkgs/development/python-modules/afdko/default.nix
··· 1 - { lib, stdenv, buildPythonPackage, fetchPypi, fetchpatch, pythonOlder 1 + { lib, stdenv, buildPythonPackage, fetchPypi, pythonOlder 2 2 , fonttools, defcon, lxml, fs, unicodedata2, zopfli, brotlipy, fontpens 3 3 , brotli, fontmath, mutatormath, booleanoperations 4 4 , ufoprocessor, ufonormalizer, psautohint, tqdm 5 - , setuptools-scm 5 + , setuptools-scm, scikit-build 6 + , cmake 7 + , antlr4_9 6 8 , pytestCheckHook 7 9 }: 8 10 9 11 buildPythonPackage rec { 10 12 pname = "afdko"; 11 - version = "3.5.1"; 13 + version = "3.7.1"; 12 14 13 15 disabled = pythonOlder "3.6"; 14 16 15 17 src = fetchPypi { 16 18 inherit pname version; 17 - sha256 = "1qg7dgl81yq0sp50pkhgvmf8az1svx20zmpkfa68ka9d0ssh1wjw"; 19 + sha256 = "05hj2mw3ppfjaig5zdk5db9vfrbbq5gmv5rzggmvvrj0yyfpr0pd"; 18 20 }; 19 21 22 + format = "pyproject"; 23 + 24 + nativeBuildInputs = [ 25 + setuptools-scm 26 + scikit-build 27 + cmake 28 + ]; 29 + 30 + buildInputs = [ 31 + antlr4_9.runtime.cpp 32 + ]; 33 + 20 34 patches = [ 21 - # Skip date-dependent test. See 22 - # https://github.com/adobe-type-tools/afdko/pull/1232 23 - # https://github.com/NixOS/nixpkgs/pull/98158#issuecomment-704321117 24 - (fetchpatch { 25 - url = "https://github.com/adobe-type-tools/afdko/commit/2c36ad10f9d964759f643e8ed7b0972a27aa26bd.patch"; 26 - sha256 = "0p6a485mmzrbfldfbhgfghsypfiad3cabcw7qlw2rh993ivpnibf"; 27 - }) 28 - # fix tests for fonttools 4.21.1 29 - (fetchpatch { 30 - url = "https://github.com/adobe-type-tools/afdko/commit/0919e7454a0a05a1b141c23bf8134c67e6b688fc.patch"; 31 - sha256 = "0glly85swyl1kcc0mi8i0w4bm148bb001jz1winz5drfrw3a63jp"; 32 - }) 35 + # Don't try to install cmake and ninja using pip 36 + ./no-pypi-build-tools.patch 37 + # Use antlr4 runtime from nixpkgs and link it dynamically 38 + ./use-dynamic-system-antlr4-runtime.patch 33 39 ]; 34 40 35 - nativeBuildInputs = [ setuptools-scm ]; 41 + # setup.py will always (re-)execute cmake in buildPhase 42 + dontConfigure = true; 36 43 37 44 propagatedBuildInputs = [ 38 45 booleanoperations ··· 53 60 tqdm 54 61 ]; 55 62 56 - # tests are broken on non x86_64 57 - # https://github.com/adobe-type-tools/afdko/issues/1163 58 - # https://github.com/adobe-type-tools/afdko/issues/1216 59 - doCheck = stdenv.isx86_64; 60 63 checkInputs = [ pytestCheckHook ]; 61 64 preCheck = '' 62 65 export PATH=$PATH:$out/bin
+24
pkgs/development/python-modules/afdko/no-pypi-build-tools.patch
··· 1 + commit 72b0ab672d1080049431eeee07ae6d2556ae9e4a 2 + Author: sternenseemann <sternenseemann@systemli.org> 3 + Date: Tue Oct 5 18:17:20 2021 +0200 4 + 5 + Don't use pypi distributions of build tools 6 + 7 + We want to use regular cmake and ninja and not the pypi projects which 8 + somehow wrap and vendor a version of the proper tool. 9 + 10 + diff --git a/setup.py b/setup.py 11 + index 50deb781..81417971 100644 12 + --- a/setup.py 13 + +++ b/setup.py 14 + @@ -196,9 +196,7 @@ def main(): 15 + setup_requires=[ 16 + 'wheel', 17 + 'setuptools_scm', 18 + - 'scikit-build', 19 + - 'cmake', 20 + - 'ninja' 21 + + 'scikit-build' 22 + ], 23 + tests_require=[ 24 + 'pytest',
+43
pkgs/development/python-modules/afdko/use-dynamic-system-antlr4-runtime.patch
··· 1 + commit 105daa26f09034af58eb13ac7c5c4ff5420c1724 2 + Author: sternenseemann <sternenseemann@systemli.org> 3 + Date: Tue Oct 5 18:16:10 2021 +0200 4 + 5 + Link against system antlr4 runtime, dynamically 6 + 7 + Instead of cloning a antlr4 version from git, use the system one. Also 8 + don't link it statically, but dynamically by default (the library is 9 + called antlr4-runtime, not antlr4_static). 10 + 11 + diff --git a/CMakeLists.txt b/CMakeLists.txt 12 + index d7f86fb6..c43c4456 100644 13 + --- a/CMakeLists.txt 14 + +++ b/CMakeLists.txt 15 + @@ -36,13 +36,13 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) 16 + # https://www.antlr.org/download/antlr4-cpp-runtime-4.9.2-source.zip 17 + # set(ANTLR4_ZIP_REPOSITORY "/path_to_antlr4_archive/a4.zip") 18 + 19 + -add_definitions(-DANTLR4CPP_STATIC) 20 + set(ANTLR4_WITH_STATIC_CRT OFF) 21 + # Use slightly more recent commit than 4.9.2 to deal with utfcpp test 22 + # compilation problems 23 + # set(ANTLR4_TAG tags/4.9.2) 24 + set(ANTLR4_TAG 916f03366edf15bf8b50010b11d479c189bf9f96) 25 + -include(ExternalAntlr4Cpp) 26 + +find_path(ANTLR4_HEADER antlr4-runtime.h PATH_SUFFIXES antlr4-runtime) 27 + +set(ANTLR4_INCLUDE_DIRS ${ANTLR4_HEADER}) 28 + 29 + # sanitizer support 30 + # work around https://github.com/pypa/setuptools/issues/1928 with environment 31 + diff --git a/c/makeotf/lib/hotconv/CMakeLists.txt b/c/makeotf/lib/hotconv/CMakeLists.txt 32 + index 82257bf2..02eb2e30 100644 33 + --- a/c/makeotf/lib/hotconv/CMakeLists.txt 34 + +++ b/c/makeotf/lib/hotconv/CMakeLists.txt 35 + @@ -69,7 +69,7 @@ add_library(hotconv STATIC 36 + 37 + set_property(TARGET hotconv PROPERTY C_STANDARD 99) 38 + target_include_directories(hotconv PRIVATE AFTER $<$<COMPILE_LANGUAGE:CXX>:${ANTLR4_INCLUDE_DIRS}>) 39 + -target_link_libraries(hotconv PUBLIC antlr4_static) 40 + +target_link_libraries(hotconv PUBLIC antlr4-runtime) 41 + 42 + if ( CMAKE_COMPILER_IS_GNUCC ) 43 + target_compile_options(hotconv PRIVATE -Wall -Wno-attributes)