Skip to content

Commit 672d6ed

Browse files
committed
fix(aur): rename source package mcpp -> mcpp-m (extra/mcpp name clash)
The AUR rejected publishing a package named `mcpp`: remote: error: package already provided by [extra]: mcpp `extra/mcpp` is Matsui's C preprocessor (an unrelated official package that owns /usr/bin/mcpp). AUR forbids reusing an official-repo pkgname/provides, so the from-source package is now `mcpp-m`. - Rename scripts/aur/mcpp -> scripts/aur/mcpp-m (pkgname=mcpp-m). - mcpp-bin: drop the bogus provides=('mcpp') (that name is the preprocessor), set conflicts=('mcpp-m' 'mcpp') — both ship /usr/bin/mcpp so they conflict with the preprocessor and with each other. - mcpp-m: conflicts=('mcpp-bin' 'mcpp'). - update.sh / aur-publish.yml / README updated for the new name + rationale.
1 parent 8dabe1a commit 672d6ed

8 files changed

Lines changed: 50 additions & 31 deletions

File tree

.github/workflows/aur-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,4 @@ jobs:
9999
}
100100
101101
publish mcpp-bin
102-
publish mcpp
102+
publish mcpp-m

scripts/aur/README.md

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,25 @@ Arch Linux packaging for mcpp. Two packages, same runtime layout:
55
| Package | What it installs | Pick it when |
66
| --- | --- | --- |
77
| [`mcpp-bin`](mcpp-bin/) | the **prebuilt** release binary (what [`install.sh`](../../install.sh) downloads) | you just want mcpp, fast |
8-
| [`mcpp`](mcpp/) | mcpp **built from source**, bootstrapped with `mcpp-bin` | you want a from-source build |
8+
| [`mcpp-m`](mcpp-m/) | mcpp **built from source**, bootstrapped with `mcpp-bin` | you want a from-source build |
99

1010
```sh
1111
yay -S mcpp-bin # prebuilt
12-
yay -S mcpp # from source (pulls mcpp-bin as a build dep)
12+
yay -S mcpp-m # from source (pulls mcpp-bin as a build dep)
1313
```
1414

15-
Both `provides`/`conflicts` each other, so only one can be installed at a time.
15+
The two `conflict` with each other, so only one can be installed at a time.
1616
Supported architectures: `x86_64`, `aarch64`.
1717

18+
### Why not just `mcpp`?
19+
20+
The name `mcpp` is already taken by **`extra/mcpp`** — Matsui's C preprocessor,
21+
an unrelated long-standing official Arch package that owns `/usr/bin/mcpp`. The
22+
AUR refuses to host any package whose `pkgname` (or `provides`) collides with an
23+
official-repo package, so our packages are `mcpp-bin` / `mcpp-m`. They still
24+
install the `mcpp` command at `/usr/bin/mcpp`, so both `conflicts=('mcpp')` with
25+
that preprocessor — you can have our mcpp or the preprocessor, not both.
26+
1827
## Layout & why the wrapper exists
1928

2029
mcpp ships as a single self-contained tree. At runtime it **writes** into
@@ -43,9 +52,9 @@ user already exported, so a custom home or xlings still works.
4352
First `mcpp build`/`mcpp run` bootstraps the sandbox (downloads ninja, patchelf
4453
and the default toolchain into `~/.mcpp`) — expected, and only once per user.
4554

46-
### How the `mcpp` source package builds
55+
### How the `mcpp-m` source package builds
4756

48-
mcpp is self-hosting. The `mcpp` PKGBUILD uses the installed `mcpp-bin` as the
57+
mcpp is self-hosting. The `mcpp-m` PKGBUILD uses the installed `mcpp-bin` as the
4958
bootstrap compiler and runs `mcpp build --target <arch>-linux-musl` — the same
5059
path [`release.yml`](../../.github/workflows/release.yml) ships. mcpp downloads
5160
its own pinned toolchain (it does **not** use the host gcc), so the build needs
@@ -58,7 +67,7 @@ scripts/aur/
5867
README.md this file
5968
update.sh bump BOTH packages to a release version
6069
mcpp-bin/{PKGBUILD, .SRCINFO, mcpp.sh}
61-
mcpp/{PKGBUILD, .SRCINFO, mcpp.sh}
70+
mcpp-m/{PKGBUILD, .SRCINFO, mcpp.sh}
6271
```
6372

6473
`mcpp.sh` is identical in both dirs (each AUR repo must be self-contained);
@@ -74,14 +83,14 @@ scripts/aur/update.sh # uses [package].version from mcpp.toml
7483
```
7584

7685
`update.sh` pulls the per-arch `.sha256` sidecars (for `mcpp-bin`) and hashes
77-
the source archive (for `mcpp`), rewrites `pkgver` + checksums, resets
86+
the source archive (for `mcpp-m`), rewrites `pkgver` + checksums, resets
7887
`pkgrel=1`, and regenerates both `.SRCINFO` files.
7988

8089
### Test locally (on Arch)
8190

8291
```sh
8392
cd scripts/aur/mcpp-bin && makepkg -si # prebuilt
84-
cd scripts/aur/mcpp && makepkg -si # from source (slow: builds mcpp)
93+
cd scripts/aur/mcpp-m && makepkg -si # from source (slow: builds mcpp)
8594
mcpp --version
8695
```
8796

@@ -99,7 +108,7 @@ PKGBUILDs via `update.sh`, and pushes each package to its AUR git repo over SSH.
99108
### One-time setup you need to do
100109

101110
1. **AUR account** — sign in at <https://aur.archlinux.org> with the account
102-
that will own `mcpp` / `mcpp-bin`.
111+
that will own `mcpp-bin` / `mcpp-m`.
103112

104113
2. **Generate a dedicated SSH key** (no passphrase, it's for CI):
105114

@@ -131,7 +140,7 @@ prefer to claim them by hand first, push an initial commit manually:
131140
```sh
132141
git clone ssh://aur@aur.archlinux.org/mcpp-bin.git
133142
cp scripts/aur/mcpp-bin/{PKGBUILD,.SRCINFO,mcpp.sh} mcpp-bin/ && cd mcpp-bin
134-
git add -A && git commit -m "initial mcpp-bin" && git push # repeat for mcpp
143+
git add -A && git commit -m "initial mcpp-bin" && git push # repeat for mcpp-m
135144
```
136145

137146
After that, every release publishes both packages with no manual step. You can

scripts/aur/mcpp-bin/.SRCINFO

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pkgbase = mcpp-bin
77
arch = aarch64
88
license = Apache-2.0
99
depends = git
10-
provides = mcpp
10+
conflicts = mcpp-m
1111
conflicts = mcpp
1212
options = !strip
1313
source = mcpp.sh

scripts/aur/mcpp-bin/PKGBUILD

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ url="https://github.com/mcpp-community/mcpp"
1313
license=('Apache-2.0')
1414
# mcpp/xlings are statically linked; git is used for package-index sync.
1515
depends=('git')
16-
provides=('mcpp')
17-
conflicts=('mcpp')
16+
# mcpp-m = same tool (mutually exclusive); mcpp = Matsui's C preprocessor
17+
# (extra/mcpp), which also owns /usr/bin/mcpp. No `provides=mcpp` — that name
18+
# is the preprocessor, not us.
19+
conflicts=('mcpp-m' 'mcpp')
1820
# Prebuilt upstream binaries — do not strip/repackage them.
1921
options=('!strip')
2022

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pkgbase = mcpp
1+
pkgbase = mcpp-m
22
pkgdesc = Modern C++ build & package management tool (built from source)
33
pkgver = 0.0.65
44
pkgrel = 1
@@ -10,10 +10,11 @@ pkgbase = mcpp
1010
makedepends = git
1111
depends = git
1212
conflicts = mcpp-bin
13+
conflicts = mcpp
1314
options = !strip
1415
source = mcpp-0.0.65.tar.gz::https://github.com/mcpp-community/mcpp/archive/v0.0.65.tar.gz
1516
source = mcpp.sh
1617
sha256sums = 07f8233d3f18565c52607816a82c9facda3a7ed11c67d3772e42bd84cb54476a
1718
sha256sums = SKIP
1819

19-
pkgname = mcpp
20+
pkgname = mcpp-m
Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
# Maintainer: mcpp-community <x.d2learn.org@gmail.com>
22
#
3-
# mcpp built from source, bootstrapped with the prebuilt `mcpp-bin`.
3+
# mcpp-m — mcpp built from source, bootstrapped with the prebuilt `mcpp-bin`.
44
# mcpp is self-hosting: the mcpp-bin compiler builds this release's own
55
# source (the same `mcpp build --target <arch>-linux-musl` path release.yml
66
# ships). For the prebuilt-only package, install `mcpp-bin` instead.
7+
#
8+
# NB: the AUR/official name `mcpp` is taken by Matsui's C preprocessor
9+
# (extra/mcpp), so this package is `mcpp-m`. It still installs the `mcpp`
10+
# command at /usr/bin/mcpp, hence the conflict with that preprocessor.
711
# See scripts/aur/README.md.
812

9-
pkgname=mcpp
13+
pkgname=mcpp-m
1014
pkgver=0.0.65
1115
pkgrel=1
1216
pkgdesc="Modern C++ build & package management tool (built from source)"
@@ -18,7 +22,9 @@ depends=('git')
1822
# mcpp-bin is the bootstrap compiler; it also supplies the bundled xlings we
1923
# ship at runtime. git is needed for toolchain/index sync during the build.
2024
makedepends=('mcpp-bin' 'git')
21-
conflicts=('mcpp-bin')
25+
# mcpp-bin = same tool (mutually exclusive); mcpp = the C preprocessor that
26+
# also owns /usr/bin/mcpp.
27+
conflicts=('mcpp-bin' 'mcpp')
2228
# We strip the built ELF ourselves; don't let makepkg re-strip the vendored
2329
# xlings binary (a prebuilt third-party artifact).
2430
options=('!strip')

scripts/aur/update.sh

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# scripts/aur/update.sh — bump BOTH AUR packages to a release version.
33
#
44
# mcpp-bin/ prebuilt release binaries (per-arch tarball checksums)
5-
# mcpp/ built from source via mcpp-bin (source-archive checksum)
5+
# mcpp-m/ built from source via mcpp-bin (source-archive checksum)
66
#
77
# Pulls checksums straight from the GitHub release / archive, rewrites each
88
# PKGBUILD's pkgver + sums, resets pkgrel to 1, regenerates both .SRCINFO
@@ -42,13 +42,13 @@ done
4242
x86=${SUMS[linux-x86_64]}
4343
arm=${SUMS[linux-aarch64]}
4444

45-
# --- source-archive checksum (mcpp) ----------------------------------------
45+
# --- source-archive checksum (mcpp-m) ----------------------------------------
4646
echo ":: hashing source archive ${archive_url}"
4747
src=$(curl -fsSL --connect-timeout 30 "$archive_url" | sha256sum | awk '{print $1}')
4848
[[ -n "$src" ]] || { echo "error: cannot hash source archive" >&2; exit 1; }
4949

5050
# --- keep the wrapper in sync ----------------------------------------------
51-
cp -f mcpp-bin/mcpp.sh mcpp/mcpp.sh 2>/dev/null || true
51+
cp -f mcpp-bin/mcpp.sh mcpp-m/mcpp.sh 2>/dev/null || true
5252

5353
# --- rewrite mcpp-bin/PKGBUILD ---------------------------------------------
5454
sed -i -E \
@@ -58,12 +58,12 @@ sed -i -E \
5858
-e "s/^sha256sums_aarch64=\('[^']*'\)/sha256sums_aarch64=('${arm}')/" \
5959
mcpp-bin/PKGBUILD
6060

61-
# --- rewrite mcpp/PKGBUILD -------------------------------------------------
61+
# --- rewrite mcpp-m/PKGBUILD ---------------------------------------------
6262
sed -i -E \
6363
-e "s/^pkgver=.*/pkgver=${VER}/" \
6464
-e "s/^pkgrel=.*/pkgrel=1/" \
6565
-e "s/^sha256sums=\('[^']*'\)/sha256sums=('${src}')/" \
66-
mcpp/PKGBUILD
66+
mcpp-m/PKGBUILD
6767

6868
# --- regenerate .SRCINFO files ---------------------------------------------
6969
# Prefer makepkg's own generator on an Arch host; fall back to templates so
@@ -87,7 +87,7 @@ pkgbase = mcpp-bin
8787
arch = aarch64
8888
license = Apache-2.0
8989
depends = git
90-
provides = mcpp
90+
conflicts = mcpp-m
9191
conflicts = mcpp
9292
options = !strip
9393
source = mcpp.sh
@@ -100,9 +100,9 @@ pkgbase = mcpp-bin
100100
pkgname = mcpp-bin
101101
EOF
102102
;;
103-
mcpp)
104-
cat > mcpp/.SRCINFO <<EOF
105-
pkgbase = mcpp
103+
mcpp-m)
104+
cat > mcpp-m/.SRCINFO <<EOF
105+
pkgbase = mcpp-m
106106
pkgdesc = Modern C++ build & package management tool (built from source)
107107
pkgver = ${VER}
108108
pkgrel = 1
@@ -114,22 +114,23 @@ pkgbase = mcpp
114114
makedepends = git
115115
depends = git
116116
conflicts = mcpp-bin
117+
conflicts = mcpp
117118
options = !strip
118119
source = mcpp-${VER}.tar.gz::${archive_url}
119120
source = mcpp.sh
120121
sha256sums = ${src}
121122
sha256sums = SKIP
122123
123-
pkgname = mcpp
124+
pkgname = mcpp-m
124125
EOF
125126
;;
126127
esac
127128
}
128129
_srcinfo mcpp-bin
129-
_srcinfo mcpp
130+
_srcinfo mcpp-m
130131

131132
echo ":: updated to v${VER}"
132133
echo " mcpp-bin x86_64 ${x86}"
133134
echo " mcpp-bin aarch64 ${arm}"
134-
echo " mcpp source ${src}"
135+
echo " mcpp-m source ${src}"
135136
echo ":: review, then publish each package (see scripts/aur/README.md)"

0 commit comments

Comments
 (0)