David, david larsson writes: > Hi, > the attached patch updates vsftpd so it can use tlsv1.2 etc. Wow. Thanks! As indicated on IRC I've made some changes to the patch, mainly to avoid hard-coding all patches. The result is attached. Let me know what you think. Further random comments below: > From: methuselah-0 > Date: Tue, 30 Mar 2021 11:18:09 +0200 > Subject: [PATCH] gnu: vsftpd: Use CentOS version and patches. > > * gnu/packages/ftp.scm (vftpd): Use CentOS version and > patches. ^^^^ This is what happens when you copy commit messages from git and paste them right back in :-) In that case, remove the four leading spaces. > + (let ((version "3.0.3") I renamed this to UPSTREAM-VERSION, so we can show a more specific VERSION field in the Guix UI. What we offer isn't ‘3.0.3’ any more. > + (revision "32") I subjectively added ‘.el8’ here, mainly to factor it out below. Neither of us knows what it means, though... > + (add-after 'unpack 'patch-installation-directory > + (lambda* (#:key outputs #:allow-other-keys) > + (substitute* "Makefile" > + (("/usr") (assoc-ref outputs "out"))) > + #t)) Moved below the redefined 'unpack phase for clarity. > + (replace 'unpack > + (lambda* (#:key source #:allow-other-keys) > + (let ((version "3.0.3") > + (revision "32") > + (centos-version "8.3.2011")) OK, so, as mentioned on IRC this can be avoided by quasiquoting (as it already was, here) and using ,version instead. Quoting is probably the most confusing-yet-basic concept in Scheme. > + > + (invoke "7z" "e" source (string-append "-o" > "./vsftpd-" > + > version "-" > + > revision > ".el8.src.cpio")) > + (chdir (string-append "./vsftpd-" version > "-" > + revision > ".el8.src.cpio")) > + (invoke "cpio" "-idmv" (string-append > "--file=./vsftpd-" > + > version "-" > + > revision > ".el8.src.cpio")) > + (invoke "tar" "xvf" (string-append > "./vsftpd-" > version ".tar.gz")) This dance had a few steps too many IMO, so I simplified it. It's OK to keep the unpacked steps around during the (short) build process; they are tiny by today's standards. > + (let ((patches I understand the reason for this: the patches need to be applied in this order, or patching will appear to succeed but result in unbuildable source. A simple FIND-FILES is right out. However, since the order is specified in vsftpd.spec, it's safer, shorter, and simply more fun to parse it ourselves. > + (chdir (string-append "./vsftpd-" > version)) > + (invoke "git" "init" ".") > + (invoke "git" "config" "user.email" > "you@example.com") > + (invoke "git" "config" "user.name" "Your > Name" ) > + (invoke "git" "add" ".") > + (invoke "git" "commit" "-m" "first") > + (map (lambda (x) (invoke "git" "am" > (string-append > "./" x))) patches) > + (map (lambda (x) (invoke "rm" > (string-append "./" > x))) patches) > + (invoke "rm" "-rf" "./.git") > + (chdir "../") > + (invoke "mv" (string-append "./vsftpd-" > version) > "../") > + (chdir "../") > + (invoke "rm" "-rf" (string-append > "./vsftpd-" > version "-" > + revision > ".el8.src.cpio")) > + (chdir (string-append "./vsftpd-" > version))) You lost me here. Why all the git? I removed all mention of git from the package, since it didn't seem necessary, but please correct me if needful. > + #t))) Whilst Guix on master still complains about ‘missing’ #Ts, they are a moribund relic and I've secretly started forgetting the odd #t on master already... > + (native-inputs `(("openssl" ,openssl) > + ("linux-pam" ,linux-pam) > + ("p7zip" ,p7zip) > + ("cpio" ,cpio) > + ("git" ,git-minimal) > + ("libcap" ,libcap))) These are *all* new, correct? I removed git and added them all to the commit message (check it out). Thanks again for your work! T G-R