Subject: Re: [PATCH v7 3/5] gnu: UCD: Add version 3.0-update1.

From: Liliana Marie Prikler <[email-masked]>
Date: Sun, 01 Jan 2023 02:28:36 +0100

Am Sonntag, dem 01.01.2023 um 01:24 +0100 schrieb Vivien Kraus:
> Happy new year!
> 
> Le samedi 31 décembre 2022 à 20:17 +0100, Liliana Marie Prikler a
> écrit :
> > Am Freitag, dem 30.12.2022 um 22:20 +0100 schrieb Vivien Kraus:
> > > * gnu/packages/unicode.scm (ucd3.0-update1): New variable.
> > Once again, do you need all of these, or just a single file?  (Or
> > indeed none at all?)
> 
> The build fails if I pass an empty file or a file with just the
> header.
> 
> I switched to an unnamed origin in the build phase, is that better?
Yes, that is better – an outside variable would also have been, but it
works for now.

> +                (("sc_check_sym_list")
> +                 "disabled_check_sym_list")
> +                (("sc_cpp_indent_check")
> +                 "disabled_cpp_indent_check")
> +                (("sc_check_copyright")
> +                 "disabled_check_copyright")
> +                (("sc_prohibit_AC_LIBOBJ_in_m4")
> +                 "disabled_prohibit_AC_LIBOBJ_in_m4")
> +                (("sc_prefer_ac_check_funcs_once")
> +                 "disabled_prefer_ac_check_funcs_once")
> +                (("sc_prohibit_leading_TABs")
> +                 "disabled_prohibit_leading_TABs"))))
I think matching the name and then doing (string-append "disabled_"
test) should work better and possibly lets you group some.

> +              (define (find-ucd-file name)
> +                (search-input-file inputs (string-append
> "share/ucd/" name)))
I think you should also 
  (define (find-ucd-files . files)
     (map find-ucd-file files))
Then you can

> +                (apply invoke
> +                       "./gen-uni-tables"
> +                       `(,@(map find-ucd-file
> +                                '("UnicodeData.txt"
> +                                  "PropList.txt"
> +                                  "DerivedCoreProperties.txt"
> +                                  "emoji/emoji-data.txt"
> +                                  "ArabicShaping.txt"
> +                                  "Scripts.txt"
> +                                  "Blocks.txt"))
> +                         ,PropList-3.0.1.txt
> +                         ,@(map find-ucd-file
> +                                '("EastAsianWidth.txt"
> +                                  "LineBreak.txt"
> +                                  "auxiliary/WordBreakProperty.txt"
> +                                 
> "auxiliary/GraphemeBreakProperty.txt"
> +                                  "CompositionExclusions.txt"
> +                                  "SpecialCasing.txt"
> +                                  "CaseFolding.txt"))
(apply invoke
       (append
        (find-ucd-files "UnicodeData.txt"
                        "PropList.txt"
                        ...)
        (list PropList-3.0.1.txt) ; or inline the origin here
        (find-ucd-files "EastAsianWidth.txt"
                        ...)))

> +                (copy-file (search-input-file inputs
> "share/ucd/NameAliases.txt")
> +                           "../tests/uniname/NameAliases.txt")
> +                (copy-file (search-input-file inputs
> "share/ucd/UnicodeData.txt")
> +                           "../tests/uniname/UnicodeData.txt")
> +                (copy-file (search-input-file inputs
> "share/ucd/NormalizationTest.txt")
> +                           "../tests/uninorm/NormalizationTest.txt")
> +                (copy-file (search-input-file inputs
> "share/ucd/auxiliary/GraphemeBreakTest.txt")
> +                           "../tests/unigbrk/GraphemeBreakTest.txt")
> +                (copy-file (search-input-file inputs
> "share/ucd/auxiliary/WordBreakTest.txt")
> +                           "../tests/uniwbrk/WordBreakTest.txt")
Can we simplify this in terms of for-each and directory excursions?
Also reuse find-ucd-file(s).

> +          (replace 'install
> +            (lambda _
> +              (install-file "gnulib-tool"
> +                            (string-append #$output "/bin"))
> +              (delete-file-recursively ".git")
> +              (copy-recursively "." (string-append #$output
> "/src/gnulib/")))))))
Should we perhaps use copy-build-system instead and just copy over
gnu:build and gnu:test?

Cheers