From a25ed0e92ca77f02e9584e3c705686f2ba6ce4a1 Mon Sep 17 00:00:00 2001 From: syui Date: Thu, 8 Jan 2026 08:32:20 +0900 Subject: [PATCH] fix patch test --- install.zsh | 56 ++++++++++++++++++- ios/README.md | 6 +- ios/build.zsh | 24 +++++--- ios/patching/005-social-app-ios-screens.patch | 2 +- ios/preview.zsh | 2 - 5 files changed, 75 insertions(+), 15 deletions(-) diff --git a/install.zsh b/install.zsh index a4c331b..4244328 100755 --- a/install.zsh +++ b/install.zsh @@ -276,6 +276,10 @@ function at-repos-patch-apply-all() { repo="atproto" elif [[ $filename == *"feed"* ]]; then repo="feed-generator" + # feed-generatorパッチ適用前に既存のDockerfileを削除(upstreamと競合回避) + if [[ $filename == "200-feed-generator-custom.patch" ]]; then + rm -f "$d/repos/feed-generator/Dockerfile" + fi fi patch-apply "$title" "$repo" "$filename" @@ -331,6 +335,54 @@ export const SOCIAL_APP_DOMAIN =\ popd > /dev/null } +function at-repos-feed-generator-newfiles() { + echo "" + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + echo "📝 Creating feed-generator new files..." + + # Create app.ts + cat > $d/repos/feed-generator/src/algos/app.ts <<'EOF' +import { QueryParams } from '../lexicon/types/app/bsky/feed/getFeedSkeleton' +import { AppContext } from '../config' + +// max 15 chars +export const shortname = 'app' + +export const handler = async (ctx: AppContext, params: QueryParams) => { + let builder = ctx.db + .selectFrom('post') + .selectAll() + .orderBy('indexedAt', 'desc') + .orderBy('cid', 'desc') + .limit(params.limit) + + if (params.cursor) { + const timeStr = new Date(parseInt(params.cursor, 10)).toISOString() + builder = builder.where('post.indexedAt', '<', timeStr) + } + const res = await builder.execute() + + const feed = res.map((row) => ({ + post: row.uri, + })) + + let cursor: string | undefined + const last = res.at(-1) + if (last) { + cursor = new Date(last.indexedAt).getTime().toString(10) + } + + return { + cursor, + feed, + } +} +EOF + + echo "✅ Created src/algos/app.ts" + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +} + function at-repos-build-docker-atproto() { cd $d docker image prune -a @@ -533,6 +585,7 @@ case "$1" in at-repos-social-app-ios-patch at-repos-patch-apply-all at-repos-ozone-patch + at-repos-feed-generator-newfiles show-failed-patches exit ;; @@ -561,7 +614,7 @@ esac case "`cat /etc/hostname`" in at) if [ "$1" = "bgs-reset" ];then - at-repos-reset-bgs-db + # at-repos-reset-bgs-db exit fi at-repos-pull-docker @@ -574,6 +627,7 @@ case "`cat /etc/hostname`" in at-repos-social-app-ios-patch at-repos-patch-apply-all at-repos-ozone-patch + at-repos-feed-generator-newfiles show-failed-patches at-repos-build-docker-atproto at-repos-push-docker diff --git a/ios/README.md b/ios/README.md index c08d5da..678c1b9 100644 --- a/ios/README.md +++ b/ios/README.md @@ -1,9 +1,7 @@ 今回の./ios (social-app)開発の要点をまとめます。 1. MITのライセンスを遵守すること、iosアプリとして出品しても問題ないようにすること -https://raw.githubusercontent.com/bluesky-social/social-app/refs/heads/main/LICENSE - 2. "Bluesky"という名称を使用しないこと。アイコンの変更。リンクの変更 +3. selfhostでも動くこと。 -3. selfhostでも動くこと。これはすでにpatchで実現しています。 - +https://raw.githubusercontent.com/bluesky-social/social-app/refs/heads/main/LICENSE diff --git a/ios/build.zsh b/ios/build.zsh index a379cff..cef231a 100755 --- a/ios/build.zsh +++ b/ios/build.zsh @@ -78,11 +78,11 @@ function cleanup_build { # 3. CocoaPods echo "3. Installing CocoaPods..." - # Ensure PATH includes Homebrew ruby gems if needed - export PATH="/opt/homebrew/lib/ruby/gems/3.4.0/bin:$PATH" - cd ios - pod install - cd .. + if [ -z "$1" ];then + cd ios + pod install + cd .. + fi # 4. Signing (Automated) echo "4. Configuring Xcode Signing..." @@ -132,6 +132,9 @@ EOF case $1 in i) + echo "Skipping cleanup_build..." + ;; + *) cleanup_build ;; esac @@ -167,8 +170,15 @@ cp -R ${APP_NAME}.xcarchive/Products/Applications/${APP_NAME}.app Payload/ # store.mobileprovisionの存在確認とコピー # https://developer.apple.com/account/resources/profiles/list if [ ! -f "$MOBILEPROVISION" ]; then - echo "Error: store.mobileprovision not found at $MOBILEPROVISION" - exit 1 + # 親ディレクトリからコピーを試みる + PARENT_MOBILEPROVISION="$SCRIPT_DIR/../embedded.mobileprovision" + if [ -f "$PARENT_MOBILEPROVISION" ]; then + echo "Copying mobileprovision from $PARENT_MOBILEPROVISION to $MOBILEPROVISION" + cp "$PARENT_MOBILEPROVISION" "$MOBILEPROVISION" + else + echo "Error: store.mobileprovision not found at $MOBILEPROVISION or $PARENT_MOBILEPROVISION" + exit 1 + fi fi cp "$MOBILEPROVISION" Payload/${APP_NAME}.app/embedded.mobileprovision diff --git a/ios/patching/005-social-app-ios-screens.patch b/ios/patching/005-social-app-ios-screens.patch index 492e263..f54c8b0 100644 --- a/ios/patching/005-social-app-ios-screens.patch +++ b/ios/patching/005-social-app-ios-screens.patch @@ -32,7 +32,7 @@ index 77f219e55..53f5e0cc0 100644 - to="https://bsky.social/about/support/tos" + label={_(msg`syu.is Terms of Service`)} + to="https://syu.is/about/support/tos" - style={[a.text_md, a.leading_normal]}> + style={[a.text_md, a.leading_snug]}> - Bluesky Social Terms of Service + syu.is Terms of Service diff --git a/ios/preview.zsh b/ios/preview.zsh index 3644670..96a412d 100755 --- a/ios/preview.zsh +++ b/ios/preview.zsh @@ -70,8 +70,6 @@ npx expo prebuild --platform ios --clean # 3. CocoaPods echo "3. Installing CocoaPods..." -# Ensure PATH includes Homebrew ruby gems if needed -export PATH="/opt/homebrew/lib/ruby/gems/3.4.0/bin:$PATH" cd ios pod install cd ..