Free fork of NotProton: Windows Steam games in Mac Steam, on CodeWeavers' Wine and Apple's Game Porting Toolkit
Swift apple-silicond3dmetaldxmtdxvkgame-porting-toolkitgptkmac-gamingmacosmetalfxrosetta-2steamsteam-playwinewinecx
feat(version): give Bridgeplay its own version and build number
raymondchins17dfc88a1635
diff --git a/Makefile b/Makefileindex d8cf057..242c186 100644--- a/Makefile+++ b/Makefile@@ -712,10 +712,12 @@ app-payload: $(TARGET) $(OVERLAY_SHIM) $(ICONMAKER) $(APPINFO) $(GAME_HOST) $(GAAPP_BUNDLE := $(OUT_DIR)/Bridgeplay.appAPP_BUNDLE_PAYLOAD := $(APP_BUNDLE)/Contents/Resources/NotProtonApp_NotProtonApp.bundle/Contents/Resources/payloadAPP_ZIP := $(OUT_DIR)/Bridgeplay.zip-APP_VERSION := $(shell sed -n 's/^\#define NOTPROTON_VERSION "\(.*\)"/\1/p' dylib/version.h)-# Sparkle ignores everything after a '-', so 1.1.4-winehq.1-ray.2 would compare equal to-# ray.1. CFBundleVersion gets a dotted number instead: 1.1.4-winehq.1-ray.2 -> 1.1.4.2.-APP_BUILD := $(shell echo '$(APP_VERSION)' | sed -E 's/^([0-9.]+)-.*-ray\.([0-9]+)$$/\1.\2/; s/-.*//')+# dylib/version.h: Bridgeplay semver for CFBundleShortVersionString, the release counter+# for CFBundleVersion (Sparkle orders updates by it; 32 is newer than the old 1.1.9.31),+# and the NotProton release it is based on. See docs/RELEASING.md.+APP_VERSION := $(shell sed -n 's/^\#define BRIDGEPLAY_VERSION "\(.*\)"/\1/p' dylib/version.h)+APP_BUILD := $(shell sed -n 's/^\#define BRIDGEPLAY_BUILD \([0-9][0-9]*\)$$/\1/p' dylib/version.h)+APP_UPSTREAM := $(shell sed -n 's/^\#define NOTPROTON_VERSION "\(.*\)"/\1/p' dylib/version.h)APP_SIGN_ID ?= -@@ -744,10 +746,13 @@ app: app-payload $(ICON_CAR)swift build --package-path app -c releaserm -rf "$(APP_BUNDLE)"@mkdir -p "$(APP_BUNDLE)/Contents/MacOS" "$(APP_BUNDLE)/Contents/Resources"+ @if [ -z "$(APP_VERSION)" ] || [ -z "$(APP_BUILD)" ] || [ -z "$(APP_UPSTREAM)" ]; then \+ echo "dylib/version.h needs BRIDGEPLAY_VERSION, BRIDGEPLAY_BUILD and NOTPROTON_VERSION" >&2; exit 1; ficp app/Info.plist "$(APP_BUNDLE)/Contents/Info.plist"/usr/libexec/PlistBuddy -c \"Set :CFBundleShortVersionString $(APP_VERSION)" -c \- "Set :CFBundleVersion $(APP_BUILD)" \+ "Set :CFBundleVersion $(APP_BUILD)" -c \+ "Set :NotProtonVersion $(APP_UPSTREAM)" \"$(APP_BUNDLE)/Contents/Info.plist"cp "$$(swift build --package-path app -c release --show-bin-path)/NotProtonApp" \"$(APP_BUNDLE)/Contents/MacOS/NotProtonApp"@@ -778,7 +783,7 @@ app: app-payload $(ICON_CAR)@echo "==> Payload complete in the bundle"codesign -f -s "$(APP_SIGN_ID)" "$(APP_BUNDLE)"codesign --verify --strict "$(APP_BUNDLE)"- @echo "==> Built $(APP_BUNDLE) ($(APP_VERSION))"+ @echo "==> Built $(APP_BUNDLE) ($(APP_VERSION) build $(APP_BUILD), NotProton $(APP_UPSTREAM))"app-zip: apprm -f "$(APP_ZIP)"diff --git a/app/Info.plist b/app/Info.plistindex abe4e4e..eb45fa3 100644--- a/app/Info.plist+++ b/app/Info.plist@@ -27,7 +27,7 @@<key>CFBundleShortVersionString</key><string>0.0.0</string><key>CFBundleVersion</key>- <string>0.0.0</string>+ <string>0</string><key>LSApplicationCategoryType</key><string>public.app-category.utilities</string><key>LSMinimumSystemVersion</key>@@ -36,6 +36,8 @@<true/><key>NSPrincipalClass</key><string>NSApplication</string>+ <key>NotProtonVersion</key>+ <string>0.0.0</string><key>SUEnableAutomaticChecks</key><false/><key>SUFeedURL</key>diff --git a/docs/BUILD-LOCAL.md b/docs/BUILD-LOCAL.mdindex 5288155..9daee8b 100644--- a/docs/BUILD-LOCAL.md+++ b/docs/BUILD-LOCAL.md@@ -33,9 +33,9 @@ output to `build/logs/<phase>.log`.| `build/NotProton.zip` | `ditto -c -k --keepParent` of the app, as CI packages it || `out/NotProton.app` | the bundle `make app` writes; the script copies it to `build/` |-At the end the script prints the version (from `dylib/version.h`, which `make app`-writes into both `CFBundleShortVersionString` and `CFBundleVersion`) and the zip's-sha256.+At the end the script prints the version (from `dylib/version.h`: `make app` writes+`BRIDGEPLAY_VERSION` into `CFBundleShortVersionString` and `BRIDGEPLAY_BUILD` into+`CFBundleVersion`, see [RELEASING.md](RELEASING.md)) and the zip's sha256.## Timings (M5 Max, 18 cores, Xcode 27.0 beta 27A5218g)diff --git a/dylib/core/loader.c b/dylib/core/loader.cindex 503ed9a..1d0a689 100644--- a/dylib/core/loader.c+++ b/dylib/core/loader.c@@ -274,8 +274,8 @@ static void np_init(void) {clear_relaunch_markers();- NP_LOG("np_init: loaded into %s (pid %d) version %s",- pn, getpid(), NOTPROTON_VERSION);+ NP_LOG("np_init: loaded into %s (pid %d) Bridgeplay %s (%d), NotProton %s",+ pn, getpid(), BRIDGEPLAY_VERSION, BRIDGEPLAY_BUILD, NOTPROTON_VERSION);np_log_platform_overrides();np_compat_export_tools_path();diff --git a/dylib/version.h b/dylib/version.hindex 796ab12..bf1bc96 100644--- a/dylib/version.h+++ b/dylib/version.h@@ -2,6 +2,16 @@#ifndef NOTPROTON_VERSION_H#define NOTPROTON_VERSION_H-#define NOTPROTON_VERSION "1.2.0-winehq.1-ray.32"+#define NOTPROTON_VERSION "1.2.0"++// Bridgeplay's own version, independent of the NotProton release above, which stays+// exactly as upstream ships it so merging upstream never conflicts here.+// BRIDGEPLAY_VERSION semver people see: patch for fixes, minor for an upstream merge+// or new features (CFBundleShortVersionString, sparkle:shortVersionString)+// BRIDGEPLAY_BUILD +1 on every release, continuing the old "-ray.N" counter; Sparkle+// orders updates by it (CFBundleVersion, sparkle:version)+// Change both with scripts/bump-version.sh, see docs/RELEASING.md.+#define BRIDGEPLAY_VERSION "2.0.0"+#define BRIDGEPLAY_BUILD 32#endif // NOTPROTON_VERSION_Hdiff --git a/scripts/bump-version.sh b/scripts/bump-version.shnew file mode 100755index 0000000..b267013--- /dev/null+++ b/scripts/bump-version.sh@@ -0,0 +1,71 @@+#!/bin/sh+# Bump Bridgeplay's version in dylib/version.h before a release.+#+# scripts/bump-version.sh patch|minor|major [--upstream "NotProton X.Y.Z"]+#+# patch for fixes, minor for an upstream NotProton merge or new features, major for a+# break. BRIDGEPLAY_BUILD goes up by one every time, since Sparkle orders updates by it.+# --upstream records the NotProton release this build is based on (NOTPROTON_VERSION);+# a clean upstream merge already brings upstream's value, so it is rarely needed.+# Edits the file only; commit it yourself. See docs/RELEASING.md.++set -eu++repo=$(cd "$(dirname "$0")/.." && pwd)+header=$repo/dylib/version.h++usage() {+ sed -n '4p' "$0" | sed 's/^# \{0,1\}//' >&2+ exit 1+}++part=${1:-}+case "$part" in+ patch|minor|major) shift ;;+ *) usage ;;+esac++upstream=""+while [ $# -gt 0 ]; do+ case "$1" in+ --upstream)+ [ $# -ge 2 ] || usage+ upstream=${2#NotProton }+ shift 2+ ;;+ *) usage ;;+ esac+done++die() { echo "==> $*" >&2; exit 1; }++version=$(sed -n 's/^#define BRIDGEPLAY_VERSION "\(.*\)"$/\1/p' "$header")+build=$(sed -n 's/^#define BRIDGEPLAY_BUILD \([0-9][0-9]*\)$/\1/p' "$header")+based=$(sed -n 's/^#define NOTPROTON_VERSION "\(.*\)"$/\1/p' "$header")+echo "$version" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+$' || die "BRIDGEPLAY_VERSION '$version' in $header is not X.Y.Z"+[ -n "$build" ] || die "no numeric BRIDGEPLAY_BUILD in $header"+[ -n "$based" ] || die "no NOTPROTON_VERSION in $header"+if [ -n "$upstream" ]; then+ echo "$upstream" | grep -Eq '^[0-9]+(\.[0-9]+)*$' || die "--upstream wants 'NotProton X.Y.Z', got '$upstream'"+fi++major=${version%%.*}+rest=${version#*.}+minor=${rest%%.*}+patch=${rest#*.}+case "$part" in+ major) major=$((major + 1)); minor=0; patch=0 ;;+ minor) minor=$((minor + 1)); patch=0 ;;+ patch) patch=$((patch + 1)) ;;+esac+next="$major.$minor.$patch"+next_build=$((build + 1))+next_based=${upstream:-$based}++sed -i '' \+ -e "s/^#define BRIDGEPLAY_VERSION \".*\"$/#define BRIDGEPLAY_VERSION \"$next\"/" \+ -e "s/^#define BRIDGEPLAY_BUILD [0-9][0-9]*$/#define BRIDGEPLAY_BUILD $next_build/" \+ -e "s/^#define NOTPROTON_VERSION \".*\"$/#define NOTPROTON_VERSION \"$next_based\"/" \+ "$header"++echo "==> Bridgeplay $version ($build) -> $next ($next_build), based on NotProton $next_based"diff --git a/scripts/sync-upstream.sh b/scripts/sync-upstream.shindex e4ef090..93b930f 100755--- a/scripts/sync-upstream.sh+++ b/scripts/sync-upstream.sh@@ -7,9 +7,9 @@# Source: NotProtonNot/NotProton (remote upstream). The fork this one started from,# leonseemann/NotProton-WineHQ, was deleted in October 2026. Upstream is merged with a merge commit, never# rebased or taken with -X theirs, so local commits stay as they are. The only conflict-# resolved automatically is dylib/version.h: the result is upstream's base version with-# this fork's "-winehq.N-ray.M" suffix, M bumped so Sparkle sees a newer build. Any-# other conflict aborts that merge and leaves the tree untouched.+# resolved automatically is dylib/version.h: Bridgeplay's lines are kept and+# NOTPROTON_VERSION takes upstream's value. Any other conflict aborts that merge and+# leaves the tree untouched. After a merge, scripts/bump-version.sh minor is committed.set -eu@@ -40,6 +40,10 @@ version_of() {sed -n 's/^#define NOTPROTON_VERSION "\(.*\)"/\1/p'}+product_of() {+ sed -n 's/^#define BRIDGEPLAY_VERSION "\(.*\)"/\1/p'+}+pending=""count=$(git rev-list --count "HEAD..upstream/main")[ "$count" -eq 0 ] || pending=" upstream/main:$count"@@ -51,7 +55,7 @@ fiecho "==> new upstream commits:$pending"[ "$check_only" -eq 0 ] || exit 2-ours_before=$(version_of <dylib/version.h)+ours_before=$(product_of <dylib/version.h)for entry in $pending; doref=${entry%%:*}echo "==> merging $ref"@@ -68,26 +72,17 @@ for entry in $pending; doexit 1fitheirs=$(git show "$ref:dylib/version.h" | version_of)- base=${theirs%%-*}- suffix=${ours_before#*-}- ray=${suffix##*-ray.}- next="$base-${suffix%-ray.*}-ray.$((ray + 1))"- printf '%s\n' "// Build version string" "#ifndef NOTPROTON_VERSION_H" "#define NOTPROTON_VERSION_H" "" \- "#define NOTPROTON_VERSION \"$next\"" "" "#endif // NOTPROTON_VERSION_H" >dylib/version.h+ git checkout -q --ours dylib/version.h+ sed -i '' "s/^#define NOTPROTON_VERSION \".*\"/#define NOTPROTON_VERSION \"$theirs\"/" dylib/version.hgit add dylib/version.hgit commit -q --no-edit- echo "==> version $ours_before -> $next"+ echo "==> kept Bridgeplay's version.h, NotProton $theirs"done-ours_after=$(version_of <dylib/version.h)-if [ "$ours_after" = "$ours_before" ]; then- # The merges were clean but a release still needs a newer version than the last one.- suffix=${ours_before#*-}- ray=${suffix##*-ray.}- next="${ours_before%-ray.*}-ray.$((ray + 1))"- sed -i '' "s/^#define NOTPROTON_VERSION \".*\"/#define NOTPROTON_VERSION \"$next\"/" dylib/version.h- git commit -q -m "chore: bump version to $next after upstream merge" dylib/version.h- echo "==> version $ours_before -> $next"+# Every upstream merge ships as a new minor Bridgeplay release.+if [ "$(product_of <dylib/version.h)" = "$ours_before" ]; then+ scripts/bump-version.sh minor+ git commit -q -m "chore(release): bump Bridgeplay to $(product_of <dylib/version.h) after upstream merge" dylib/version.hfiecho "==> merged. Build and test, then publish with scripts/release-local.sh"