adding a directory tree to package source

Andrew Schulman andrex.e.schulman@gmail.com
Thu Sep 10 00:00:25 GMT 2026


On Wed, 29 Jul 2026 21:17:18 +0100, in gmane.os.cygwin.applications you wrote:

>On 28/07/2026 17:55, Andrew Schulman via Cygwin-apps wrote:
>> For fish I have a directory structure of Cygwin-specific files that I need to
>> have copied into the source tree:
>> 
>> $ git ls
>> Cygwin/etc/fish/conf.d/00_PATH.fish
>> Cygwin/etc/fish/conf.d/01_fish_variables.fish
>> Cygwin/etc/fish/conf.d/cygwin.fish
>> Cygwin/usr/share/fish/vendor_completions.d/mount.fish
>> Cygwin/usr/share/fish/vendor_completions.d/umount.fish
>> Cygwin/usr/share/fish/vendor_functions.d/fish_is_root_user.fish
>> Cygwin/usr/share/fish/vendor_functions.d/sudo.fish
>> fish.cygport
>> 
>> Is there a supported way to do this? I've tried multiple ways, and all of them
>> fail.
>
>Thanks for doing this investigation.
>
>Yeah, it seems this needs a bit of work to have the desired functionality.

Finally getting back to this. With a small patch to cygport (below), I can do
this with CYGWIN_FILES:

  CYGWIN_FILES=Cygwin

With the patch below, cygport will copy in either files or directories in
CYGWIN_FILES (instead of only files as now) into the source package. Then in
src_install() I can just copy the files to the destination:

  cp -r ${C}/Cygwin/* ${D}

With the patch this works locally on my host, and in scallywag the build error
"cp -r not specified" [1] shows that it should work there too. I request that
the patch below be merged into cygport.

Thanks,
Andrew

[1]
https://github.com/cygwin/scallywag/actions/runs/34403342276/job/102640295523#step:9:365


diff --git a/lib/pkg_pkg.cygpart b/lib/pkg_pkg.cygpart
index 6a728357..4da390d4 100644
--- a/lib/pkg_pkg.cygpart
+++ b/lib/pkg_pkg.cygpart
@@ -577,7 +577,7 @@ __pkg_srcpkg() {

    for cygwin_file in ${CYGWIN_FILES}
    do
-       cp --preserve=timestamps ${C}/${cygwin_file} ${spkgdir}
+       cp -r --preserve=timestamps ${C}/${cygwin_file} ${spkgdir}
    done

    cp --preserve=timestamps ${top}/${cygportfile} ${spkgdir};
diff --git a/lib/src_prep.cygpart b/lib/src_prep.cygpart
index 85bd25e8..a1a94086 100644
--- a/lib/src_prep.cygpart
+++ b/lib/src_prep.cygpart
@@ -471,8 +471,8 @@ __src_prep() {

 #****v* Preparation/CYGWIN_FILES
 #  DESCRIPTION
-#  A list of files which are to be included in the source package, and
installed
-#  into ${C}.
+#  A list of files and/or directories which are to be installed into ${C} in
+#  the source package.
 #  NOTE
 #  Historically, files in $C were created by a patch file named
 #  ${PF}.cygwin.patch, which is automatically applied and generated.  This


More information about the Cygwin-apps mailing list