From 04b5fb926289f6e234f26d3c24280f2f6aaaea75 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Tue, 1 Sep 2020 15:40:03 +0300 Subject: gnu: python-efl: Use regex to delete cythonized files. * gnu/packages/enlightenment.scm (python-efl)[source]: Adjust snippet to delete cythonized files based on a regex pattern. --- gnu/packages/enlightenment.scm | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'gnu') diff --git a/gnu/packages/enlightenment.scm b/gnu/packages/enlightenment.scm index cb72f3bad0..16e9dcb807 100644 --- a/gnu/packages/enlightenment.scm +++ b/gnu/packages/enlightenment.scm @@ -402,13 +402,15 @@ embedded systems.") (modules '((guix build utils))) ;; Remove files generated by Cython (snippet - '(begin - (copy-file "efl/dbus_mainloop/e_dbus.c" "efl/dbus_mainloop/e_dbus.q") - (for-each delete-file (find-files "efl" ".*\\.c$")) - (delete-file "efl/eo/efl.eo_api.h") - (copy-file "efl/dbus_mainloop/e_dbus.q" "efl/dbus_mainloop/e_dbus.c") - (delete-file "efl/dbus_mainloop/e_dbus.q") - #t)))) + '(begin + (for-each (lambda (file) + (let ((generated-file + (string-append (string-drop-right file 3) "c"))) + (when (file-exists? generated-file) + (delete-file generated-file)))) + (find-files "efl" "\\.pyx$")) + (delete-file "efl/eo/efl.eo_api.h") + #t)))) (build-system python-build-system) (arguments '(#:phases -- cgit 1.4.1