Skip to content

Commit

Permalink
python3Packages.ttfautohint-py: fix loading some modules (NixOS#378514)
Browse files Browse the repository at this point in the history
  • Loading branch information
jopejoe1 authored Feb 2, 2025
2 parents ab842f8 + f905e74 commit 6319929
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions pkgs/development/python-modules/ttfautohint-py/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,15 @@ buildPythonPackage rec {
hash = "sha256-NTog461RpyHKo/Qpicj3tflehaKj9LlZEN9qeCMM6JQ=";
};

postPatch = ''
substituteInPlace src/python/ttfautohint/__init__.py \
--replace-fail 'find_library("ttfautohint")' '"${lib.getLib ttfautohint}/lib/libttfautohint${stdenv.hostPlatform.extensions.sharedLibrary}"'
'';
postPatch =
''
substituteInPlace src/python/ttfautohint/__init__.py \
--replace-fail 'find_library("ttfautohint")' '"${lib.getLib ttfautohint}/lib/libttfautohint${stdenv.hostPlatform.extensions.sharedLibrary}"'
''
+ lib.optionalString stdenv.hostPlatform.isLinux ''
substituteInPlace src/python/ttfautohint/memory.py \
--replace-fail 'find_library("c")' '"${lib.getLib stdenv.cc.libc}/lib/libc.so.6"'
'';

env.TTFAUTOHINTPY_BUNDLE_DLL = false;

Expand All @@ -36,6 +41,10 @@ buildPythonPackage rec {
distutils
];

dependencies = [
setuptools # for pkg_resources
];

buildInputs = [ ttfautohint ];

nativeCheckInputs = [
Expand Down

0 comments on commit 6319929

Please sign in to comment.