From b0ddbb05729e86ce4efb7eac8909317e16d7bed7 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Wed, 14 Sep 2022 13:18:50 +0200 Subject: gnu: python-afdko: Remove generated code. * gnu/packages/fontutils.scm (python-afdko)[source](modules, snippet): New fields. [arguments]: Add regenerate-hotconv-grammar phase. [native-inputs]: Add ANTLR4 and OPENJDK. --- gnu/packages/fontutils.scm | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'gnu/packages/fontutils.scm') diff --git a/gnu/packages/fontutils.scm b/gnu/packages/fontutils.scm index da324a6a9d..fbe9c10e37 100644 --- a/gnu/packages/fontutils.scm +++ b/gnu/packages/fontutils.scm @@ -9,7 +9,7 @@ ;;; Copyright © 2017, 2018, 2020–2022 Tobias Geerinckx-Rice ;;; Copyright © 2018 Ricardo Wurmus ;;; Copyright © 2018, 2019, 2020, 2021 Ludovic Courtès -;;; Copyright © 2019, 2020 Marius Bakke +;;; Copyright © 2019, 2020, 2022 Marius Bakke ;;; Copyright © 2020 Roel Janssen ;;; Copyright © 2020, 2021 Nicolas Goaziou ;;; Copyright © 2021, 2022 Maxim Cournoyer @@ -145,7 +145,15 @@ (define-public python-afdko (method url-fetch) (uri (pypi-uri "afdko" version)) (sha256 - (base32 "171r9f7n8fgz37dkcgpzj508lxfafcyzzx43ps12j1z2nk1sk905")))) + (base32 "171r9f7n8fgz37dkcgpzj508lxfafcyzzx43ps12j1z2nk1sk905")) + (modules '((guix build utils))) + (snippet + #~(begin + (with-directory-excursion "c/makeotf/lib/hotconv" + ;; Delete ANTLR-generated code. + (for-each delete-file + (find-files + "." "Feat(Parser|Lexer).*\\.(h|cpp|interp|tokens)$"))))))) (build-system python-build-system) (arguments (list @@ -173,6 +181,17 @@ (define-public python-afdko (substitute* "c/makeotf/lib/hotconv/CMakeLists.txt" (("antlr4_static") "antlr4-runtime")))) + (add-after 'unpack 'regenerate-hotconv-grammar + (lambda _ + (let ((antlr-version #$(package-version + (this-package-native-input "antlr4")))) + (with-directory-excursion "c/makeotf/lib/hotconv" + (substitute* "BuildGrammar.py" + (("antlr_version = .*") + (string-append "antlr_version = \"" + antlr-version + "\""))) + (invoke "python" "BuildGrammar.py"))))) ;; The test suite expects the commands to be Python rather than ;; shell scripts, so move the wrap phase after the tests. (delete 'wrap) @@ -195,7 +214,12 @@ (define-public python-afdko `("PATH" prefix (,bindir)))) commands))))))) (native-inputs - (list ninja python-pytest python-scikit-build python-setuptools-scm + (list antlr4 + openjdk ;required by antlr4 + ninja + python-pytest + python-scikit-build + python-setuptools-scm python-wheel)) (inputs (list java-antlr4-runtime-cpp `(,util-linux "lib"))) (propagated-inputs -- cgit v1.2.3 From 9442b0cf56a6d514813be5ed2412d39bd07d4310 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Wed, 14 Sep 2022 13:20:07 +0200 Subject: gnu: Remove duplicate copyright line. * gnu/packages/fontutils.scm: Remove duplicate line. --- gnu/packages/fontutils.scm | 1 - 1 file changed, 1 deletion(-) (limited to 'gnu/packages/fontutils.scm') diff --git a/gnu/packages/fontutils.scm b/gnu/packages/fontutils.scm index fbe9c10e37..257c7d4e37 100644 --- a/gnu/packages/fontutils.scm +++ b/gnu/packages/fontutils.scm @@ -13,7 +13,6 @@ ;;; Copyright © 2020 Roel Janssen ;;; Copyright © 2020, 2021 Nicolas Goaziou ;;; Copyright © 2021, 2022 Maxim Cournoyer -;;; Copyright © 2020, 2021 Nicolas Goaziou ;;; Copyright © 2021 Sarah Morgensen ;;; Copyright © 2022 Felipe Balbi ;;; -- cgit v1.2.3