Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

makepkg.sh.in: allow split packages for MINGW packages #34

Open
wants to merge 1 commit into
base: msys2-v6.0.2
Choose a base branch
from

Conversation

jannick0
Copy link

@lazka

I did not look around of how to call the scripts to automagically move this change into the pacman package. Could you please point me where to start or could you propagate to pacman's PKGBUILD and Co.?

The script below run from the top directory of MINGW-packages removes the then obsolete wrappers (dynamically generating PKGBUILD functions prefixed with ${MINGW_PACKAGE_PREFIX}-). See comment in code for option to not increase PKGREL.

#! /usr/bin/bash

while IFS= read -r p; do
awk '
  { gsub(/\s+$/,""); }
  # comment out next line if PKGREL should NOT be increased by 1.
  /^pkgrel=[0-9]+$/ { gsub(/^pkgrel=/,""); print "pkgrel=" ($0+1); next; }
  /template start; name=mingw-w64-splitpkg-wrappers;/ { exit; }
  /^\s*$/{ nls++; next; }
  { if(nls){for(i=1;i<=nls;i++)print "";nls=0;} print; }' "$p" > "$p.tmp" && mv "$p.tmp" "$p"
done < <(grep -l 'mingw-w64-splitpkg-wrappers;' */PKGBUILD)

Off-topic: Interested in generating debug packages with makepkg? If yes I could then try to get something up and running, for GCC in the first place at least. Later for CLANG ... hopefully.

This patch allows split package names for MINGW packages in line with the
approach for MSYS2 packages, i.e. the standard split package function names
PREPARE, BUILD, CHECK and INSTALL are not required to contain a prefix
like '${MINGW_PACKAGE_PREFIX}-'.

- The patch leaves the processing of MSYS2 PKGBUILD files as is.
- Any fix to an MINGW PKGBUILD file defining prefixed PKGBUILD functions
  is obsolete.
- The amendment is POSIX-conformant.

MINGW PKGBUILD example:

# MINGW_PACKAGE_PREFIX optionally defined (by shell)
pkgbase='mypackage'
pkgname=("${MINGW_PACKAGE_PREFIX}-pkg1", "${MINGW_PACKAGE_PREFIX}-pkg2")
package_pkg1() { ... }
package_pkg2() { ... }
lazka pushed a commit that referenced this pull request May 5, 2024
Also include a section encouraging discussion of large changes as there have
been a number of case of rejected features being reinvented.

Fixes #34

Signed-off-by: Allan McRae <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant