Jack Hill <jackhill@jackhill.us> writes:
+ ((#:phases phases)
+ `(modify-phases ,phases
+ ;; The LICENSE file will be overwritten with the one from nginx
+ ;; when unpacking the nginx source, so copy this one to its own
+ ;; file.
+ (add-after 'unpack 'preserve-license-file
+ (lambda _ (copy-file "LICENSE" "LICENSE.rtmp")))
+ (add-after 'preserve-license-file 'unpack-nginx-sources
+ (lambda* (#:key inputs native-inputs #:allow-other-keys)
+ (begin
+ ;; The nginx source code is part of the module’s source.
+ (format #t "decompressing nginx source code~%")
+ (let ((tar (assoc-ref inputs "tar"))
+ (nginx-srcs (assoc-ref inputs "nginx-sources")))
+ (invoke (string-append tar "/bin/tar")
+ "xvf" nginx-srcs "--strip-components=1"))
You can probably drop the direct reference to tar and just use `(invoke
"tar" ...)`
Also, if you want to avoid the extra step of renaming the original
LICENSE, you can use `--transform=s,/LICENSE$,/LICENSE.nginx,` as an
argument to tar.