Skip to content

Commit

Permalink
Move the info about the package prefix to the packaging section
Browse files Browse the repository at this point in the history
It's only relevant to developers/packages, so move it out of the
user targeted docs.
  • Loading branch information
lazka committed Oct 27, 2023
1 parent 0924655 commit 839e2f4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
24 changes: 24 additions & 0 deletions web/dev/package-guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,27 @@ To create such .pyc files in a PKGBUILD for packages which don't do it themselve
MSYS2_ARG_CONV_EXCL="-p" \
python -m compileall -o 0 -o 1 -q -s"${pkgdir}" -p"/" "${pkgdir}${MINGW_PREFIX}"
```

## The package prefix (hack)

When looking at some of our package recipes you might have seen something like:

```bash
MSYS2_ARG_CONV_EXCL="--prefix=" \
meson \
--prefix="${MINGW_PREFIX}" \
...
```

which results in `meson --prefix=/mingw64 ...` being executed.

`/mingw64` in this case is the UNIX prefix where the package will be installed
to and in addition is a valid Windows path (a drive relative path, so
`C:\mingw64`), so the native build tools will concatenate it with DESTDIR and
copy things to the right place.

In the native Windows world this path doesn't make much sense, as `C:\mingw64`
likely doesn't match where the software lives, but ideally all native Windows
tools are relocatable and won't use the prefix at runtime anyway. And if they do
and happen to call Cygwin tools then the prefix resolves to the correct path
because the Cygwin root path is relocatable.
24 changes: 0 additions & 24 deletions web/docs/filesystem-paths.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,27 +121,3 @@ you can use `cygpath`:
$ /usr/bin/python3 -c "import sys, os; print(sys.argv, os.listdir(sys.argv[1]))" "$(cygpath -u C:/)"
['-c', '/c/'] ['$Recycle.Bin', '$SysReset', ...]
```

## The package prefix (hack)

When looking at some of our package recipes you might have seen something like:

```bash
MSYS2_ARG_CONV_EXCL="--prefix=" \
meson \
--prefix="${MINGW_PREFIX}" \
...
```

which results in `meson --prefix=/mingw64 ...` being executed.

`/mingw64` in this case is the UNIX prefix where the package will be installed
to and in addition is a valid Windows path (a drive relative path, so
`C:\mingw64`), so the native build tools will concatenate it with DESTDIR and
copy things to the right place.

In the native Windows world this path doesn't make much sense, as `C:\mingw64`
likely doesn't match where the software lives, but ideally all native Windows
tools are relocatable and won't use the prefix at runtime anyway. And if they do
and happen to call Cygwin tools then the prefix resolves to the correct path
because the Cygwin root path is relocatable.

0 comments on commit 839e2f4

Please sign in to comment.