0

I'm trying to hack a MSYS package, so I found https://www.msys2.org/wiki/Creating-Packages/ - as an example:

git clone "https://github.com/msys2/MSYS2-packages"
cd MSYS2-packages/flex
makepkg -sCLf

So, if I run this, I get the sources built, and I get a package.

Now, let's say, I change something in the source of the flex package, and I want to rebuild.

I tried the makepkg -sCLf, but that command actually deletes the source directory - including my hacks - and so, that command in particular, cannot be used to build a package with hacks/changed source files.

What command could I use instead, to build (hopefully only) the changed files in the source, and to build a package from that source?

2 Answers 2

1

The makepkg(8) manual states for the option -C:

-C, --cleanbuild
    Remove the $srcdir before building the package.

Try the command without the option -C to not remove the $srcdir:

$ makepkg -sLf
1

Simply omiting --cleanbuild is not enough. Also pass the --noextract flag, which is specifically intended for this use:

-e, --noextract

Do not extract source files or run the prepare() function (if present); use whatever source already exists in the $srcdir/ directory. This is handy if you want to go into $srcdir/ and manually patch or tweak code, then make a package out of the result. Keep in mind that creating a patch may be a better solution to allow others to use your PKGBUILD.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .