├── .github
├── FUNDING.yml
└── workflows
│ ├── build-head.yml
│ ├── build-previous.yml
│ ├── nightly-arm64.yml
│ ├── nightly-x86_64.yml
│ ├── release-latest.yml
│ ├── release-latest_native.yml
│ └── release-latest_pure.yml
├── .gitignore
├── LICENSE
├── README.org
├── archive
├── fix-working-text.patch
├── ns-ime-191230.patch
├── ns-ime-191231.patch
├── ns-ime-202007.patch
├── ns-ime-202008.patch
└── revert-89d0c445.patch
├── build
├── emacs-26.3.sh
├── emacs-27.2.sh
├── emacs-28.sh
├── emacs-29.sh
├── emacs-30.sh
├── emacs-head.sh
├── rudix
│ ├── README.txt
│ └── emacs-27.1.sh
└── setup.sh
├── emacs-25.2-inline.patch
├── emacs-27.1-inline.patch
├── emacs-28.1-inline.patch
├── emacs-29.1-inline.patch
├── emacs-head-inline.patch
├── fix-emacs25.3-unexmacosx.c.patch
├── fix-emacs26.3-unexmacosx.c.patch
├── private
├── ns-26.2-private.patch
├── ns-27.0-private.patch
└── ns-head-private.patch
└── release
├── notarize-emacs.sh
├── portable-emacs.sh
└── upload.bat
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: takaxp # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4 | patreon: takaxp # Replace with a single Patreon username
5 | open_collective: # Replace with a single Open Collective username
6 | ko_fi: # Replace with a single Ko-fi username
7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9 | liberapay: # Replace with a single Liberapay username
10 | issuehunt: # Replace with a single IssueHunt username
11 | otechie: # Replace with a single Otechie username
12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
13 |
--------------------------------------------------------------------------------
/.github/workflows/build-head.yml:
--------------------------------------------------------------------------------
1 | name: "Test master (HEAD)"
2 | on:
3 | push:
4 | pull_request:
5 | workflow_dispatch:
6 | schedule:
7 | - cron: '0 5 * * *'
8 |
9 | jobs:
10 | build-head:
11 | runs-on: macos-latest
12 | timeout-minutes: 120
13 | steps:
14 | - name: Checkout repository
15 | uses: actions/checkout@v4
16 | - name: Setup to build
17 | run: sh build/setup.sh
18 | - name: Build HEAD with inline patch
19 | run: sh build/emacs-head.sh -d ${{ github.workspace }} -n
20 | - name: Verification
21 | run: ${{ github.workspace }}/emacs/nextstep/Emacs.app/Contents/MacOS/Emacs --batch --eval="(unless (fboundp 'mac-input-method-mode) (error \"The inline-patch is NOT integrated\"))"
22 |
--------------------------------------------------------------------------------
/.github/workflows/build-previous.yml:
--------------------------------------------------------------------------------
1 | name: "Test emacs-30,29,28,27,26"
2 | on:
3 | pull_request:
4 | workflow_dispatch:
5 | schedule:
6 | - cron: '0 10 * * *'
7 |
8 | jobs:
9 | build-30:
10 | needs: build-29
11 | runs-on: macos-latest
12 | timeout-minutes: 60
13 | steps:
14 | - name: Checkout repository
15 | uses: actions/checkout@v4
16 | - name: Setup to build
17 | run: sh build/setup.sh
18 | - name: Build emacs-30.1 with inline patch
19 | run: sh build/emacs-30.sh -d ${{ github.workspace }} -p inline
20 | - name: Verification
21 | run: ${{ github.workspace }}/emacs-30.1/nextstep/Emacs.app/Contents/MacOS/Emacs --batch --eval="(unless (fboundp 'mac-input-method-mode) (error \"The inline-patch is NOT integrated\"))"
22 | build-29:
23 | runs-on: macos-latest
24 | timeout-minutes: 60
25 | steps:
26 | - name: Checkout repository
27 | uses: actions/checkout@v4
28 | - name: Setup to build
29 | run: sh build/setup.sh
30 | - name: Build emacs-29.4 with inline patch
31 | run: sh build/emacs-29.sh -d ${{ github.workspace }} -p inline
32 | - name: Verification
33 | run: ${{ github.workspace }}/emacs-29.4/nextstep/Emacs.app/Contents/MacOS/Emacs --batch --eval="(unless (fboundp 'mac-input-method-mode) (error \"The inline-patch is NOT integrated\"))"
34 | build-28:
35 | needs: build-27
36 | runs-on: macos-latest
37 | timeout-minutes: 60
38 | steps:
39 | - uses: actions/checkout@v4
40 | - name: Setup to build
41 | run: sh build/setup.sh
42 | - name: Build emacs-28 with inline patch
43 | run: sh build/emacs-28.sh -d ${{ github.workspace }}
44 | - name: Verification
45 | run: ${{ github.workspace }}/emacs-28.2/nextstep/Emacs.app/Contents/MacOS/Emacs --batch --eval="(unless (fboundp 'mac-input-method-mode) (error \"The inline-patch is NOT integrated\"))"
46 | build-27:
47 | needs: build-26
48 | runs-on: macos-latest
49 | timeout-minutes: 60
50 | steps:
51 | - uses: actions/checkout@v4
52 | - name: Setup to build
53 | run: sh build/setup.sh
54 | - name: Build emacs-27 with inline patch
55 | run: sh build/emacs-27.2.sh -d ${{ github.workspace }}
56 | - name: Verification
57 | run: ${{ github.workspace }}/emacs-27.2/nextstep/Emacs.app/Contents/MacOS/Emacs --batch --eval="(unless (fboundp 'mac-input-method-mode) (error \"The inline-patch is NOT integrated\"))"
58 | build-26:
59 | runs-on: macos-13
60 | timeout-minutes: 60
61 | steps:
62 | - uses: actions/checkout@v4
63 | - name: Setup to build
64 | run: sh build/setup.sh
65 | - name: Build emacs-26.3 with inline patch
66 | run: sh build/emacs-26.3.sh -d ${{ github.workspace }}
67 | - name: Verification
68 | run: ${{ github.workspace }}/emacs_ns/emacs-26.3/nextstep/Emacs.app/Contents/MacOS/Emacs --batch --eval="(unless (fboundp 'mac-input-method-mode) (error \"The inline-patch is NOT integrated\"))"
69 |
--------------------------------------------------------------------------------
/.github/workflows/nightly-arm64.yml:
--------------------------------------------------------------------------------
1 | name: "Experiment master (HEAD) for Apple Silicon"
2 | on:
3 | workflow_dispatch:
4 | schedule:
5 | - cron: '30 1 * * *'
6 |
7 | jobs:
8 | nightly-arm64:
9 | runs-on: macos-14
10 | timeout-minutes: 60
11 | steps:
12 | - name: Checkout repository
13 | uses: actions/checkout@v4
14 | - name: Install the Apple certificate and provisioning profile
15 | env:
16 | BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
17 | DISTRIBUTE_CERTIFICATE_BASE64: ${{ secrets.DISTRIBUTE_CERTIFICATE_BASE64 }}
18 | P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
19 | BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
20 | KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
21 | APP_PASSWORD: ${{ secrets.APP_PASSWORD }}
22 | APPLE_ID: ${{ secrets.APPLE_ID }}
23 | run: |
24 | # create variables
25 | BUILD_CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
26 | DISTRIBUTE_CERTIFICATE_PATH=$RUNNER_TEMP/distribute_certificate.p12
27 | PP_PATH=$RUNNER_TEMP/build_pp.provisionprofile
28 | KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
29 | # import certificate and provisioning profile from secrets
30 | echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $BUILD_CERTIFICATE_PATH
31 | echo -n "$DISTRIBUTE_CERTIFICATE_BASE64" | base64 --decode -o $DISTRIBUTE_CERTIFICATE_PATH
32 | echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH
33 | # create temporary keychain
34 | security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
35 | security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
36 | security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
37 | # import certificate to keychain
38 | security import $BUILD_CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
39 | security import $DISTRIBUTE_CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
40 | security set-key-partition-list -S apple-tool:,apple:,codesign: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
41 | security list-keychain -d user -s $KEYCHAIN_PATH
42 | # apply provisioning profile
43 | mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
44 | cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
45 | # register a profile to keychain for notarize
46 | xcrun notarytool store-credentials "github-emacs-build" --apple-id $APPLE_ID --team-id "H2PH8KNN3H" --password $APP_PASSWORD
47 | - name: Setup to build
48 | run: sh build/setup.sh
49 | - name: Build HEAD with inline patch
50 | run: sh build/emacs-head.sh -d ${{ github.workspace }}
51 | - name: Verification
52 | run: ${{ github.workspace }}/emacs/nextstep/Emacs.app/Contents/MacOS/Emacs --batch --eval="(unless (fboundp 'mac-input-method-mode) (error \"The inline-patch is NOT integrated\"))"
53 | - name: Portable
54 | run: sh release/portable-emacs.sh -b master -d ${{ github.workspace }}
55 | - name: Notarize
56 | run: sh release/notarize-emacs.sh -b master -d ${{ github.workspace }} -s ${{ github.workspace }} -p inline -a "github-emacs-build"
57 | - name: Export
58 | env:
59 | ORZ_HOST: ${{ secrets.ORZ_HOST }}
60 | ORZ_PORT: ${{ secrets.ORZ_PORT }}
61 | ORZ_ID_BASE64: ${{ secrets.ORZ_ID_BASE64 }}
62 | run: |
63 | ID_PATH=$RUNNER_TEMP/orz_id
64 | rm -f ~/.ssh/known_hosts
65 | echo -n "$ORZ_ID_BASE64" | base64 --decode -o $ID_PATH
66 | chmod 600 $ID_PATH
67 | sftp -b release/upload.bat -o StrictHostKeyChecking=no -i $ID_PATH -P $ORZ_PORT github-ci@$ORZ_HOST
68 | - name: Clean up keychain and provisioning profile
69 | if: ${{ always() }}
70 | run: |
71 | security delete-keychain $RUNNER_TEMP/app-signing.keychain-db
72 | rm ~/Library/MobileDevice/Provisioning\ Profiles/build_pp.provisionprofile
73 | rm $RUNNER_TEMP/orz_id
74 | nightly-native-arm64:
75 | runs-on: macos-14
76 | timeout-minutes: 120
77 | steps:
78 | - name: Checkout repository
79 | uses: actions/checkout@v4
80 | - name: Install the Apple certificate and provisioning profile
81 | env:
82 | BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
83 | DISTRIBUTE_CERTIFICATE_BASE64: ${{ secrets.DISTRIBUTE_CERTIFICATE_BASE64 }}
84 | P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
85 | BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
86 | KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
87 | APP_PASSWORD: ${{ secrets.APP_PASSWORD }}
88 | APPLE_ID: ${{ secrets.APPLE_ID }}
89 | run: |
90 | # create variables
91 | BUILD_CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
92 | DISTRIBUTE_CERTIFICATE_PATH=$RUNNER_TEMP/distribute_certificate.p12
93 | PP_PATH=$RUNNER_TEMP/build_pp.provisionprofile
94 | KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
95 | # import certificate and provisioning profile from secrets
96 | echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $BUILD_CERTIFICATE_PATH
97 | echo -n "$DISTRIBUTE_CERTIFICATE_BASE64" | base64 --decode -o $DISTRIBUTE_CERTIFICATE_PATH
98 | echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH
99 | # create temporary keychain
100 | security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
101 | security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
102 | security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
103 | # import certificate to keychain
104 | security import $BUILD_CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
105 | security import $DISTRIBUTE_CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
106 | security set-key-partition-list -S apple-tool:,apple:,codesign: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
107 | security list-keychain -d user -s $KEYCHAIN_PATH
108 | # apply provisioning profile
109 | mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
110 | cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
111 | # register a profile to keychain for notarize
112 | xcrun notarytool store-credentials "github-emacs-build" --apple-id $APPLE_ID --team-id "H2PH8KNN3H" --password $APP_PASSWORD
113 | - name: Setup to build
114 | run: sh build/setup.sh
115 | - name: Build HEAD with inline patch
116 | run: sh build/emacs-head.sh -d ${{ github.workspace }} -n
117 | - name: Verification
118 | run: ${{ github.workspace }}/emacs/nextstep/Emacs.app/Contents/MacOS/Emacs --batch --eval="(unless (fboundp 'mac-input-method-mode) (error \"The inline-patch is NOT integrated\"))"
119 | - name: Portable
120 | run: sh release/portable-emacs.sh -b master -d ${{ github.workspace }}
121 | - name: Notarize
122 | run: sh release/notarize-emacs.sh -b master -d ${{ github.workspace }} -s ${{ github.workspace }} -p inline -a "github-emacs-build"
123 | - name: Export
124 | env:
125 | ORZ_HOST: ${{ secrets.ORZ_HOST }}
126 | ORZ_PORT: ${{ secrets.ORZ_PORT }}
127 | ORZ_ID_BASE64: ${{ secrets.ORZ_ID_BASE64 }}
128 | run: |
129 | ID_PATH=$RUNNER_TEMP/orz_id
130 | rm -f ~/.ssh/known_hosts
131 | echo -n "$ORZ_ID_BASE64" | base64 --decode -o $ID_PATH
132 | chmod 600 $ID_PATH
133 | sftp -b release/upload.bat -o StrictHostKeyChecking=no -i $ID_PATH -P $ORZ_PORT github-ci@$ORZ_HOST
134 | - name: Clean up keychain and provisioning profile
135 | if: ${{ always() }}
136 | run: |
137 | security delete-keychain $RUNNER_TEMP/app-signing.keychain-db
138 | rm ~/Library/MobileDevice/Provisioning\ Profiles/build_pp.provisionprofile
139 | rm $RUNNER_TEMP/orz_id
140 |
--------------------------------------------------------------------------------
/.github/workflows/nightly-x86_64.yml:
--------------------------------------------------------------------------------
1 | name: "Experiment master (HEAD) for Intel Chips"
2 | on:
3 | workflow_dispatch:
4 | schedule:
5 | - cron: '0 2 * * *'
6 |
7 | jobs:
8 | nightly-x86_64:
9 | runs-on: macos-13
10 | timeout-minutes: 60
11 | steps:
12 | - name: Checkout repository
13 | uses: actions/checkout@v4
14 | - name: Install the Apple certificate and provisioning profile
15 | env:
16 | BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
17 | DISTRIBUTE_CERTIFICATE_BASE64: ${{ secrets.DISTRIBUTE_CERTIFICATE_BASE64 }}
18 | P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
19 | BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
20 | KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
21 | APP_PASSWORD: ${{ secrets.APP_PASSWORD }}
22 | APPLE_ID: ${{ secrets.APPLE_ID }}
23 | run: |
24 | # create variables
25 | BUILD_CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
26 | DISTRIBUTE_CERTIFICATE_PATH=$RUNNER_TEMP/distribute_certificate.p12
27 | PP_PATH=$RUNNER_TEMP/build_pp.provisionprofile
28 | KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
29 | # import certificate and provisioning profile from secrets
30 | echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $BUILD_CERTIFICATE_PATH
31 | echo -n "$DISTRIBUTE_CERTIFICATE_BASE64" | base64 --decode -o $DISTRIBUTE_CERTIFICATE_PATH
32 | echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH
33 | # create temporary keychain
34 | security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
35 | security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
36 | security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
37 | # import certificate to keychain
38 | security import $BUILD_CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
39 | security import $DISTRIBUTE_CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
40 | security set-key-partition-list -S apple-tool:,apple:,codesign: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
41 | security list-keychain -d user -s $KEYCHAIN_PATH
42 | # apply provisioning profile
43 | mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
44 | cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
45 | # register a profile to keychain for notarize
46 | xcrun notarytool store-credentials "github-emacs-build" --apple-id $APPLE_ID --team-id "H2PH8KNN3H" --password $APP_PASSWORD
47 | - name: Setup to build
48 | run: sh build/setup.sh
49 | - name: Build HEAD with inline patch
50 | run: sh build/emacs-head.sh -d ${{ github.workspace }}
51 | - name: Verification
52 | run: ${{ github.workspace }}/emacs/nextstep/Emacs.app/Contents/MacOS/Emacs --batch --eval="(unless (fboundp 'mac-input-method-mode) (error \"The inline-patch is NOT integrated\"))"
53 | - name: Portable
54 | run: sh release/portable-emacs.sh -b master -d ${{ github.workspace }}
55 | - name: Notarize
56 | run: sh release/notarize-emacs.sh -b master -d ${{ github.workspace }} -s ${{ github.workspace }} -p inline -a "github-emacs-build"
57 | - name: Export
58 | env:
59 | ORZ_HOST: ${{ secrets.ORZ_HOST }}
60 | ORZ_PORT: ${{ secrets.ORZ_PORT }}
61 | ORZ_ID_BASE64: ${{ secrets.ORZ_ID_BASE64 }}
62 | run: |
63 | ID_PATH=$RUNNER_TEMP/orz_id
64 | rm -f ~/.ssh/known_hosts
65 | echo -n "$ORZ_ID_BASE64" | base64 --decode -o $ID_PATH
66 | chmod 600 $ID_PATH
67 | sftp -b release/upload.bat -o StrictHostKeyChecking=no -i $ID_PATH -P $ORZ_PORT github-ci@$ORZ_HOST
68 | - name: Clean up keychain and provisioning profile
69 | if: ${{ always() }}
70 | run: |
71 | security delete-keychain $RUNNER_TEMP/app-signing.keychain-db
72 | rm ~/Library/MobileDevice/Provisioning\ Profiles/build_pp.provisionprofile
73 | rm $RUNNER_TEMP/orz_id
74 | nightly-native-x86_64:
75 | runs-on: macos-13
76 | timeout-minutes: 120
77 | steps:
78 | - name: Checkout repository
79 | uses: actions/checkout@v4
80 | - name: Install the Apple certificate and provisioning profile
81 | env:
82 | BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
83 | DISTRIBUTE_CERTIFICATE_BASE64: ${{ secrets.DISTRIBUTE_CERTIFICATE_BASE64 }}
84 | P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
85 | BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
86 | KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
87 | APP_PASSWORD: ${{ secrets.APP_PASSWORD }}
88 | APPLE_ID: ${{ secrets.APPLE_ID }}
89 | run: |
90 | # create variables
91 | BUILD_CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
92 | DISTRIBUTE_CERTIFICATE_PATH=$RUNNER_TEMP/distribute_certificate.p12
93 | PP_PATH=$RUNNER_TEMP/build_pp.provisionprofile
94 | KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
95 | # import certificate and provisioning profile from secrets
96 | echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $BUILD_CERTIFICATE_PATH
97 | echo -n "$DISTRIBUTE_CERTIFICATE_BASE64" | base64 --decode -o $DISTRIBUTE_CERTIFICATE_PATH
98 | echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH
99 | # create temporary keychain
100 | security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
101 | security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
102 | security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
103 | # import certificate to keychain
104 | security import $BUILD_CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
105 | security import $DISTRIBUTE_CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
106 | security set-key-partition-list -S apple-tool:,apple:,codesign: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
107 | security list-keychain -d user -s $KEYCHAIN_PATH
108 | # apply provisioning profile
109 | mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
110 | cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
111 | # register a profile to keychain for notarize
112 | xcrun notarytool store-credentials "github-emacs-build" --apple-id $APPLE_ID --team-id "H2PH8KNN3H" --password $APP_PASSWORD
113 | - name: Setup to build
114 | run: sh build/setup.sh
115 | - name: Build HEAD with inline patch
116 | run: sh build/emacs-head.sh -d ${{ github.workspace }} -n
117 | - name: Verification
118 | run: ${{ github.workspace }}/emacs/nextstep/Emacs.app/Contents/MacOS/Emacs --batch --eval="(unless (fboundp 'mac-input-method-mode) (error \"The inline-patch is NOT integrated\"))"
119 | - name: Portable
120 | run: sh release/portable-emacs.sh -b master -d ${{ github.workspace }}
121 | - name: Notarize
122 | run: sh release/notarize-emacs.sh -b master -d ${{ github.workspace }} -s ${{ github.workspace }} -p inline -a "github-emacs-build"
123 | - name: Export
124 | env:
125 | ORZ_HOST: ${{ secrets.ORZ_HOST }}
126 | ORZ_PORT: ${{ secrets.ORZ_PORT }}
127 | ORZ_ID_BASE64: ${{ secrets.ORZ_ID_BASE64 }}
128 | run: |
129 | ID_PATH=$RUNNER_TEMP/orz_id
130 | rm -f ~/.ssh/known_hosts
131 | echo -n "$ORZ_ID_BASE64" | base64 --decode -o $ID_PATH
132 | chmod 600 $ID_PATH
133 | sftp -b release/upload.bat -o StrictHostKeyChecking=no -i $ID_PATH -P $ORZ_PORT github-ci@$ORZ_HOST
134 | - name: Clean up keychain and provisioning profile
135 | if: ${{ always() }}
136 | run: |
137 | security delete-keychain $RUNNER_TEMP/app-signing.keychain-db
138 | rm ~/Library/MobileDevice/Provisioning\ Profiles/build_pp.provisionprofile
139 | rm $RUNNER_TEMP/orz_id
140 |
--------------------------------------------------------------------------------
/.github/workflows/release-latest.yml:
--------------------------------------------------------------------------------
1 | name: "Release v30.1 (inline)"
2 | on:
3 | workflow_dispatch:
4 |
5 | jobs:
6 | release_x86_64:
7 | runs-on: macos-13
8 | timeout-minutes: 90
9 | steps:
10 | - name: Checkout repository
11 | uses: actions/checkout@v4
12 | - name: Install the Apple certificate and provisioning profile
13 | env:
14 | BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
15 | DISTRIBUTE_CERTIFICATE_BASE64: ${{ secrets.DISTRIBUTE_CERTIFICATE_BASE64 }}
16 | P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
17 | BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
18 | KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
19 | APP_PASSWORD: ${{ secrets.APP_PASSWORD }}
20 | APPLE_ID: ${{ secrets.APPLE_ID }}
21 | run: |
22 | # create variables
23 | BUILD_CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
24 | DISTRIBUTE_CERTIFICATE_PATH=$RUNNER_TEMP/distribute_certificate.p12
25 | PP_PATH=$RUNNER_TEMP/build_pp.provisionprofile
26 | KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
27 | # import certificate and provisioning profile from secrets
28 | echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $BUILD_CERTIFICATE_PATH
29 | echo -n "$DISTRIBUTE_CERTIFICATE_BASE64" | base64 --decode -o $DISTRIBUTE_CERTIFICATE_PATH
30 | echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH
31 | # create temporary keychain
32 | security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
33 | security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
34 | security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
35 | # import certificate to keychain
36 | security import $BUILD_CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
37 | security import $DISTRIBUTE_CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
38 | security set-key-partition-list -S apple-tool:,apple:,codesign: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
39 | security list-keychain -d user -s $KEYCHAIN_PATH
40 | # apply provisioning profile
41 | mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
42 | cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
43 | # register a profile to keychain for notarize
44 | xcrun notarytool store-credentials "github-emacs-build" --apple-id $APPLE_ID --team-id "H2PH8KNN3H" --password $APP_PASSWORD
45 | - name: Setup to build
46 | run: sh build/setup.sh
47 | - name: Build Emacs 30.1 with inline patch
48 | run: sh build/emacs-30.sh -d ${{ github.workspace }} -p inline
49 | - name: Verification
50 | run: ${{ github.workspace }}/emacs-30.1/nextstep/Emacs.app/Contents/MacOS/Emacs --batch --eval="(unless (fboundp 'mac-input-method-mode) (error \"The inline-patch is NOT integrated\"))"
51 | - name: Portable
52 | run: sh release/portable-emacs.sh -v 30.1 -d ${{ github.workspace }}
53 | - name: Notarize
54 | run: sh release/notarize-emacs.sh -v 30.1 -d ${{ github.workspace }} -s ${{ github.workspace }} -p inline -a "github-emacs-build"
55 | - name: Export
56 | env:
57 | ORZ_HOST: ${{ secrets.ORZ_HOST }}
58 | ORZ_PORT: ${{ secrets.ORZ_PORT }}
59 | ORZ_ID_BASE64: ${{ secrets.ORZ_ID_BASE64 }}
60 | run: |
61 | ID_PATH=$RUNNER_TEMP/orz_id
62 | rm -f ~/.ssh/known_hosts
63 | echo -n "$ORZ_ID_BASE64" | base64 --decode -o $ID_PATH
64 | chmod 600 $ID_PATH
65 | sftp -b release/upload.bat -o StrictHostKeyChecking=no -i $ID_PATH -P $ORZ_PORT github-ci@$ORZ_HOST
66 | - name: Clean up keychain and provisioning profile
67 | if: ${{ always() }}
68 | run: |
69 | security delete-keychain $RUNNER_TEMP/app-signing.keychain-db
70 | rm ~/Library/MobileDevice/Provisioning\ Profiles/build_pp.provisionprofile
71 | rm $RUNNER_TEMP/orz_id
72 | release_arm64:
73 | runs-on: macos-14
74 | timeout-minutes: 60
75 | steps:
76 | - name: Checkout repository
77 | uses: actions/checkout@v4
78 | - name: Install the Apple certificate and provisioning profile
79 | env:
80 | BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
81 | DISTRIBUTE_CERTIFICATE_BASE64: ${{ secrets.DISTRIBUTE_CERTIFICATE_BASE64 }}
82 | P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
83 | BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
84 | KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
85 | APP_PASSWORD: ${{ secrets.APP_PASSWORD }}
86 | APPLE_ID: ${{ secrets.APPLE_ID }}
87 | run: |
88 | # create variables
89 | BUILD_CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
90 | DISTRIBUTE_CERTIFICATE_PATH=$RUNNER_TEMP/distribute_certificate.p12
91 | PP_PATH=$RUNNER_TEMP/build_pp.provisionprofile
92 | KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
93 | # import certificate and provisioning profile from secrets
94 | echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $BUILD_CERTIFICATE_PATH
95 | echo -n "$DISTRIBUTE_CERTIFICATE_BASE64" | base64 --decode -o $DISTRIBUTE_CERTIFICATE_PATH
96 | echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH
97 | # create temporary keychain
98 | security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
99 | security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
100 | security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
101 | # import certificate to keychain
102 | security import $BUILD_CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
103 | security import $DISTRIBUTE_CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
104 | security set-key-partition-list -S apple-tool:,apple:,codesign: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
105 | security list-keychain -d user -s $KEYCHAIN_PATH
106 | # apply provisioning profile
107 | mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
108 | cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
109 | # register a profile to keychain for notarize
110 | xcrun notarytool store-credentials "github-emacs-build" --apple-id $APPLE_ID --team-id "H2PH8KNN3H" --password $APP_PASSWORD
111 | - name: Setup to build
112 | run: sh build/setup.sh
113 | - name: Build Emacs 30.1 with inline patch
114 | run: sh build/emacs-30.sh -d ${{ github.workspace }} -p inline
115 | - name: Verification
116 | run: ${{ github.workspace }}/emacs-30.1/nextstep/Emacs.app/Contents/MacOS/Emacs --batch --eval="(unless (fboundp 'mac-input-method-mode) (error \"The inline-patch is NOT integrated\"))"
117 | - name: Portable
118 | run: sh release/portable-emacs.sh -v 30.1 -d ${{ github.workspace }}
119 | - name: Notarize
120 | run: sh release/notarize-emacs.sh -v 30.1 -d ${{ github.workspace }} -s ${{ github.workspace }} -p inline -a "github-emacs-build"
121 | - name: Export
122 | env:
123 | ORZ_HOST: ${{ secrets.ORZ_HOST }}
124 | ORZ_PORT: ${{ secrets.ORZ_PORT }}
125 | ORZ_ID_BASE64: ${{ secrets.ORZ_ID_BASE64 }}
126 | run: |
127 | ID_PATH=$RUNNER_TEMP/orz_id
128 | rm -f ~/.ssh/known_hosts
129 | echo -n "$ORZ_ID_BASE64" | base64 --decode -o $ID_PATH
130 | chmod 600 $ID_PATH
131 | sftp -b release/upload.bat -o StrictHostKeyChecking=no -i $ID_PATH -P $ORZ_PORT github-ci@$ORZ_HOST
132 | - name: Clean up keychain and provisioning profile
133 | if: ${{ always() }}
134 | run: |
135 | security delete-keychain $RUNNER_TEMP/app-signing.keychain-db
136 | rm ~/Library/MobileDevice/Provisioning\ Profiles/build_pp.provisionprofile
137 | rm $RUNNER_TEMP/orz_id
138 |
--------------------------------------------------------------------------------
/.github/workflows/release-latest_native.yml:
--------------------------------------------------------------------------------
1 | name: "Release v30.1 (NativeComp)"
2 | on:
3 | workflow_dispatch:
4 |
5 | jobs:
6 | release_native_x86_64:
7 | runs-on: macos-13
8 | timeout-minutes: 120
9 | steps:
10 | - name: Checkout repository
11 | uses: actions/checkout@v4
12 | - name: Install the Apple certificate and provisioning profile
13 | env:
14 | BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
15 | DISTRIBUTE_CERTIFICATE_BASE64: ${{ secrets.DISTRIBUTE_CERTIFICATE_BASE64 }}
16 | P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
17 | BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
18 | KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
19 | APP_PASSWORD: ${{ secrets.APP_PASSWORD }}
20 | APPLE_ID: ${{ secrets.APPLE_ID }}
21 | run: |
22 | # create variables
23 | BUILD_CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
24 | DISTRIBUTE_CERTIFICATE_PATH=$RUNNER_TEMP/distribute_certificate.p12
25 | PP_PATH=$RUNNER_TEMP/build_pp.provisionprofile
26 | KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
27 | # import certificate and provisioning profile from secrets
28 | echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $BUILD_CERTIFICATE_PATH
29 | echo -n "$DISTRIBUTE_CERTIFICATE_BASE64" | base64 --decode -o $DISTRIBUTE_CERTIFICATE_PATH
30 | echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH
31 | # create temporary keychain
32 | security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
33 | security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
34 | security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
35 | # import certificate to keychain
36 | security import $BUILD_CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
37 | security import $DISTRIBUTE_CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
38 | security set-key-partition-list -S apple-tool:,apple:,codesign: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
39 | security list-keychain -d user -s $KEYCHAIN_PATH
40 | # apply provisioning profile
41 | mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
42 | cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
43 | # register a profile to keychain for notarize
44 | xcrun notarytool store-credentials "github-emacs-build" --apple-id $APPLE_ID --team-id "H2PH8KNN3H" --password $APP_PASSWORD
45 | - name: Setup to build
46 | run: sh build/setup.sh
47 | - name: Build Emacs 30.1 with inline patch
48 | run: sh build/emacs-30.sh -d ${{ github.workspace }} -p inline -n
49 | - name: Verification
50 | run: ${{ github.workspace }}/emacs-30.1/nextstep/Emacs.app/Contents/MacOS/Emacs --batch --eval="(unless (fboundp 'mac-input-method-mode) (error \"The inline-patch is NOT integrated\"))"
51 | - name: Portable
52 | run: sh release/portable-emacs.sh -v 30.1 -d ${{ github.workspace }}
53 | - name: Notarize
54 | run: sh release/notarize-emacs.sh -v 30.1 -d ${{ github.workspace }} -s ${{ github.workspace }} -p inline -a "github-emacs-build"
55 | - name: Export
56 | env:
57 | ORZ_HOST: ${{ secrets.ORZ_HOST }}
58 | ORZ_PORT: ${{ secrets.ORZ_PORT }}
59 | ORZ_ID_BASE64: ${{ secrets.ORZ_ID_BASE64 }}
60 | run: |
61 | ID_PATH=$RUNNER_TEMP/orz_id
62 | rm -f ~/.ssh/known_hosts
63 | echo -n "$ORZ_ID_BASE64" | base64 --decode -o $ID_PATH
64 | chmod 600 $ID_PATH
65 | sftp -b release/upload.bat -o StrictHostKeyChecking=no -i $ID_PATH -P $ORZ_PORT github-ci@$ORZ_HOST
66 | - name: Clean up keychain and provisioning profile
67 | if: ${{ always() }}
68 | run: |
69 | security delete-keychain $RUNNER_TEMP/app-signing.keychain-db
70 | rm ~/Library/MobileDevice/Provisioning\ Profiles/build_pp.provisionprofile
71 | rm $RUNNER_TEMP/orz_id
72 | release_native_arm64:
73 | runs-on: macos-14
74 | timeout-minutes: 120
75 | steps:
76 | - name: Checkout repository
77 | uses: actions/checkout@v4
78 | - name: Install the Apple certificate and provisioning profile
79 | env:
80 | BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
81 | DISTRIBUTE_CERTIFICATE_BASE64: ${{ secrets.DISTRIBUTE_CERTIFICATE_BASE64 }}
82 | P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
83 | BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
84 | KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
85 | APP_PASSWORD: ${{ secrets.APP_PASSWORD }}
86 | APPLE_ID: ${{ secrets.APPLE_ID }}
87 | run: |
88 | # create variables
89 | BUILD_CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
90 | DISTRIBUTE_CERTIFICATE_PATH=$RUNNER_TEMP/distribute_certificate.p12
91 | PP_PATH=$RUNNER_TEMP/build_pp.provisionprofile
92 | KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
93 | # import certificate and provisioning profile from secrets
94 | echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $BUILD_CERTIFICATE_PATH
95 | echo -n "$DISTRIBUTE_CERTIFICATE_BASE64" | base64 --decode -o $DISTRIBUTE_CERTIFICATE_PATH
96 | echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH
97 | # create temporary keychain
98 | security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
99 | security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
100 | security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
101 | # import certificate to keychain
102 | security import $BUILD_CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
103 | security import $DISTRIBUTE_CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
104 | security set-key-partition-list -S apple-tool:,apple:,codesign: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
105 | security list-keychain -d user -s $KEYCHAIN_PATH
106 | # apply provisioning profile
107 | mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
108 | cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
109 | # register a profile to keychain for notarize
110 | xcrun notarytool store-credentials "github-emacs-build" --apple-id $APPLE_ID --team-id "H2PH8KNN3H" --password $APP_PASSWORD
111 | - name: Setup to build
112 | run: sh build/setup.sh
113 | - name: Build Emacs 30.1 with inline patch
114 | run: sh build/emacs-30.sh -d ${{ github.workspace }} -p inline -n
115 | - name: Verification
116 | run: ${{ github.workspace }}/emacs-30.1/nextstep/Emacs.app/Contents/MacOS/Emacs --batch --eval="(unless (fboundp 'mac-input-method-mode) (error \"The inline-patch is NOT integrated\"))"
117 | - name: Portable
118 | run: sh release/portable-emacs.sh -v 30.1 -d ${{ github.workspace }}
119 | - name: Notarize
120 | run: sh release/notarize-emacs.sh -v 30.1 -d ${{ github.workspace }} -s ${{ github.workspace }} -p inline -a "github-emacs-build"
121 | - name: Export
122 | env:
123 | ORZ_HOST: ${{ secrets.ORZ_HOST }}
124 | ORZ_PORT: ${{ secrets.ORZ_PORT }}
125 | ORZ_ID_BASE64: ${{ secrets.ORZ_ID_BASE64 }}
126 | run: |
127 | ID_PATH=$RUNNER_TEMP/orz_id
128 | rm -f ~/.ssh/known_hosts
129 | echo -n "$ORZ_ID_BASE64" | base64 --decode -o $ID_PATH
130 | chmod 600 $ID_PATH
131 | sftp -b release/upload.bat -o StrictHostKeyChecking=no -i $ID_PATH -P $ORZ_PORT github-ci@$ORZ_HOST
132 | - name: Clean up keychain and provisioning profile
133 | if: ${{ always() }}
134 | run: |
135 | security delete-keychain $RUNNER_TEMP/app-signing.keychain-db
136 | rm ~/Library/MobileDevice/Provisioning\ Profiles/build_pp.provisionprofile
137 | rm $RUNNER_TEMP/orz_id
138 |
--------------------------------------------------------------------------------
/.github/workflows/release-latest_pure.yml:
--------------------------------------------------------------------------------
1 | name: "Release v30.1 (pure)"
2 | on:
3 | workflow_dispatch:
4 |
5 | jobs:
6 | release_x86_64:
7 | runs-on: macos-13
8 | timeout-minutes: 60
9 | steps:
10 | - name: Checkout repository
11 | uses: actions/checkout@v4
12 | - name: Install the Apple certificate and provisioning profile
13 | env:
14 | BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
15 | DISTRIBUTE_CERTIFICATE_BASE64: ${{ secrets.DISTRIBUTE_CERTIFICATE_BASE64 }}
16 | P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
17 | BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
18 | KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
19 | APP_PASSWORD: ${{ secrets.APP_PASSWORD }}
20 | APPLE_ID: ${{ secrets.APPLE_ID }}
21 | run: |
22 | # create variables
23 | BUILD_CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
24 | DISTRIBUTE_CERTIFICATE_PATH=$RUNNER_TEMP/distribute_certificate.p12
25 | PP_PATH=$RUNNER_TEMP/build_pp.provisionprofile
26 | KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
27 | # import certificate and provisioning profile from secrets
28 | echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $BUILD_CERTIFICATE_PATH
29 | echo -n "$DISTRIBUTE_CERTIFICATE_BASE64" | base64 --decode -o $DISTRIBUTE_CERTIFICATE_PATH
30 | echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH
31 | # create temporary keychain
32 | security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
33 | security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
34 | security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
35 | # import certificate to keychain
36 | security import $BUILD_CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
37 | security import $DISTRIBUTE_CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
38 | security set-key-partition-list -S apple-tool:,apple:,codesign: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
39 | security list-keychain -d user -s $KEYCHAIN_PATH
40 | # apply provisioning profile
41 | mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
42 | cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
43 | # register a profile to keychain for notarize
44 | xcrun notarytool store-credentials "github-emacs-build" --apple-id $APPLE_ID --team-id "H2PH8KNN3H" --password $APP_PASSWORD
45 | - name: Setup to build
46 | run: sh build/setup.sh
47 | - name: Build Emacs 30.1
48 | run: sh build/emacs-30.sh -d ${{ github.workspace }} -p pure
49 | - name: Verification
50 | run: ${{ github.workspace }}/emacs-30.1/nextstep/Emacs.app/Contents/MacOS/Emacs --batch --eval="(when (fboundp 'mac-input-method-mode) (error \"The inline-patch is integrated for pure package\"))"
51 | - name: Portable
52 | run: sh release/portable-emacs.sh -v 30.1 -d ${{ github.workspace }}
53 | - name: Notarize
54 | run: sh release/notarize-emacs.sh -v 30.1 -d ${{ github.workspace }} -s ${{ github.workspace }} -p pure -a "github-emacs-build"
55 | - name: Export
56 | env:
57 | ORZ_HOST: ${{ secrets.ORZ_HOST }}
58 | ORZ_PORT: ${{ secrets.ORZ_PORT }}
59 | ORZ_ID_BASE64: ${{ secrets.ORZ_ID_BASE64 }}
60 | run: |
61 | ID_PATH=$RUNNER_TEMP/orz_id
62 | rm -f ~/.ssh/known_hosts
63 | echo -n "$ORZ_ID_BASE64" | base64 --decode -o $ID_PATH
64 | chmod 600 $ID_PATH
65 | sftp -b release/upload.bat -o StrictHostKeyChecking=no -i $ID_PATH -P $ORZ_PORT github-ci@$ORZ_HOST
66 | - name: Clean up keychain and provisioning profile
67 | if: ${{ always() }}
68 | run: |
69 | security delete-keychain $RUNNER_TEMP/app-signing.keychain-db
70 | rm ~/Library/MobileDevice/Provisioning\ Profiles/build_pp.provisionprofile
71 | rm $RUNNER_TEMP/orz_id
72 | release_arm64:
73 | runs-on: macos-14
74 | timeout-minutes: 60
75 | steps:
76 | - name: Checkout repository
77 | uses: actions/checkout@v4
78 | - name: Install the Apple certificate and provisioning profile
79 | env:
80 | BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
81 | DISTRIBUTE_CERTIFICATE_BASE64: ${{ secrets.DISTRIBUTE_CERTIFICATE_BASE64 }}
82 | P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
83 | BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
84 | KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
85 | APP_PASSWORD: ${{ secrets.APP_PASSWORD }}
86 | APPLE_ID: ${{ secrets.APPLE_ID }}
87 | run: |
88 | # create variables
89 | BUILD_CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
90 | DISTRIBUTE_CERTIFICATE_PATH=$RUNNER_TEMP/distribute_certificate.p12
91 | PP_PATH=$RUNNER_TEMP/build_pp.provisionprofile
92 | KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
93 | # import certificate and provisioning profile from secrets
94 | echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $BUILD_CERTIFICATE_PATH
95 | echo -n "$DISTRIBUTE_CERTIFICATE_BASE64" | base64 --decode -o $DISTRIBUTE_CERTIFICATE_PATH
96 | echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH
97 | # create temporary keychain
98 | security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
99 | security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
100 | security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
101 | # import certificate to keychain
102 | security import $BUILD_CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
103 | security import $DISTRIBUTE_CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
104 | security set-key-partition-list -S apple-tool:,apple:,codesign: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
105 | security list-keychain -d user -s $KEYCHAIN_PATH
106 | # apply provisioning profile
107 | mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
108 | cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
109 | # register a profile to keychain for notarize
110 | xcrun notarytool store-credentials "github-emacs-build" --apple-id $APPLE_ID --team-id "H2PH8KNN3H" --password $APP_PASSWORD
111 | - name: Setup to build
112 | run: sh build/setup.sh
113 | - name: Build Emacs 30.1
114 | run: sh build/emacs-30.sh -d ${{ github.workspace }} -p pure
115 | - name: Verification
116 | run: ${{ github.workspace }}/emacs-30.1/nextstep/Emacs.app/Contents/MacOS/Emacs --batch --eval="(when (fboundp 'mac-input-method-mode) (error \"The inline-patch is integrated for pure package\"))"
117 | - name: Portable
118 | run: sh release/portable-emacs.sh -v 30.1 -d ${{ github.workspace }}
119 | - name: Notarize
120 | run: sh release/notarize-emacs.sh -v 30.1 -d ${{ github.workspace }} -s ${{ github.workspace }} -p pure -a "github-emacs-build"
121 | - name: Export
122 | env:
123 | ORZ_HOST: ${{ secrets.ORZ_HOST }}
124 | ORZ_PORT: ${{ secrets.ORZ_PORT }}
125 | ORZ_ID_BASE64: ${{ secrets.ORZ_ID_BASE64 }}
126 | run: |
127 | ID_PATH=$RUNNER_TEMP/orz_id
128 | rm -f ~/.ssh/known_hosts
129 | echo -n "$ORZ_ID_BASE64" | base64 --decode -o $ID_PATH
130 | chmod 600 $ID_PATH
131 | sftp -b release/upload.bat -o StrictHostKeyChecking=no -i $ID_PATH -P $ORZ_PORT github-ci@$ORZ_HOST
132 | - name: Clean up keychain and provisioning profile
133 | if: ${{ always() }}
134 | run: |
135 | security delete-keychain $RUNNER_TEMP/app-signing.keychain-db
136 | rm ~/Library/MobileDevice/Provisioning\ Profiles/build_pp.provisionprofile
137 | rm $RUNNER_TEMP/orz_id
138 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/README.org:
--------------------------------------------------------------------------------
1 | #+title: An enhanced inline patch for GNU Emacs
2 |
3 | [[https://github.com/takaxp/ns-inline-patch/actions?query=workflow%3A%22Build+NS+with+inline-patch+%28HEAD%29%22][https://github.com/takaxp/ns-inline-patch/workflows/Build%20NS%20with%20inline-patch%20(HEAD)/badge.svg]]
4 | [[https://github.com/takaxp/ns-inline-patch/actions/workflows/release-latest_native.yml][https://github.com/takaxp/ns-inline-patch/actions/workflows/release-latest_native.yml/badge.svg]]
5 | [[https://github.com/takaxp/ns-inline-patch/actions/workflows/release-latest.yml][https://github.com/takaxp/ns-inline-patch/actions/workflows/release-latest.yml/badge.svg]]
6 | [[https://github.com/takaxp/ns-inline-patch/actions?query=workflow%3A%22Build+NS+with+inline-patch+%28emacs-29%29%22][https://github.com/takaxp/ns-inline-patch/workflows/Build%20NS%20with%20inline-patch%20(emacs-29)/badge.svg]]
7 | [[https://github.com/takaxp/ns-inline-patch/actions?query=workflow%3A%22Build+NS+with+inline-patch+%28emacs-28%29%22][https://github.com/takaxp/ns-inline-patch/workflows/Build%20NS%20with%20inline-patch%20(emacs-28)/badge.svg]]
8 | [[https://github.com/takaxp/ns-inline-patch/actions?query=workflow%3A%22Build+NS+with+inline-patch+%28emacs-27%29%22][https://github.com/takaxp/ns-inline-patch/workflows/Build%20NS%20with%20inline-patch%20(emacs-27)/badge.svg]]
9 | [[https://github.com/takaxp/ns-inline-patch/actions?query=workflow%3A%22Build+NS+with+inline-patch+%28emacs-26%29%22][https://github.com/takaxp/ns-inline-patch/workflows/Build%20NS%20with%20inline-patch%20(emacs-26)/badge.svg]]
10 |
11 | see https://qiita.com/takaxp/items/e07bb286d80fa9dd8e05 and https://qiita.com/takaxp/items/6a7f9b26eb1b1a8237a0
12 |
13 | #+begin_quote
14 | [!NOTE]
15 | Version 30.1 has been released. The inline patch (emacs-29.1-inline.patch) is still applicable to Emacs 30.1. Installer packages for Intel-based Mac and Apple Silicon Mac are also available. You may install them in macOS Catalina or later.
16 | #+end_quote
17 |
18 | ** Supported features
19 |
20 | - avoid "M-x あ"
21 | - faces for composing text
22 | - non ja locale
23 | - directly change input source
24 |
25 | ** Supported Emacs version
26 |
27 | - Emacs HEAD (emacs-head-inline.patch)
28 | - Emacs 30.1 (emacs-29.1-inline.patch)
29 | - Emacs 29.4, 29.3, 29.2, 29.1 (emacs-29.1-inline.patch)
30 | - Emacs 28.2, 28.1 (emacs-28.1-inline.patch)
31 | - Emacs 27.2, 27.1 (emacs-27.1-inline.patch)
32 | - Emacs 26.3, 26.2, 26.1 (emacs-25.2-inline.patch)
33 | - Emacs 25.3, 25.2 (emacs-25.2-inline.patch)
34 |
35 | ** Integrated functions and hooks
36 | :PROPERTIES:
37 | :ID: 982CF02C-EE91-4EC1-8F21-98A581399E00
38 | :END:
39 |
40 | - M-x mac-build-info
41 | - M-x mac-ime-input-source-list
42 | - M-x mac-ime-activate
43 | - M-x mac-ime-deactivate
44 | - M-x mac-ime-toggle
45 | - mac-ime-before-put-text-hook
46 | - mac-ime-after-put-text-hook
47 |
48 | ** How to use?
49 | :PROPERTIES:
50 | :ID: 88272C0F-ED87-46B0-ADC8-64FAB20C6908
51 | :END:
52 |
53 | Add the following code to your init.el.
54 |
55 | #+begin_src emacs-lisp
56 | (when (and (memq window-system '(ns nil))
57 | (fboundp 'mac-get-current-input-source))
58 | (when (version< "27.0" emacs-version)
59 | ;; Required for some cases when auto detection is failed or the locale is "en".
60 | (custom-set-variables
61 | '(mac-default-input-source "com.google.inputmethod.Japanese.base")))
62 | (mac-input-method-mode 1))
63 | #+end_src
64 |
65 | #+begin_quote
66 | [!TIP]
67 | You can find available input sources by M-x mac-ime-input-source-list. The available sources will be listed in the Message buffer.
68 | #+end_quote
69 |
70 | ** Build scripts
71 | :PROPERTIES:
72 | :ID: C992491F-5B7F-4F0F-BB99-B1343603CBD6
73 | :END:
74 |
75 | For your convenience, some build scripts are provided. Before you run the script, please run =setup.sh= first.
76 |
77 | #+begin_src sh
78 | sh ./build/setup.sh
79 | sh ./build/emacs-30.sh -n
80 | #+end_src
81 |
82 | #+begin_quote
83 | [!IMPORTANT]
84 | Please provide ~-n~ option to enable NativComp if needed.
85 | #+end_quote
86 |
87 | #+begin_quote
88 | [!TIP]
89 | Specifying ~CC~ may resolve your issue when you get an error on missing AppKit.h.
90 | #+end_quote
91 |
92 | #+begin_src sh
93 | CC=/usr/bin/clang sh ./build/emacs-30.sh
94 | #+end_src
95 |
96 | If your environment for building Emacs is under PROXY, you can use =emacs-mirror= to get Emacs source codes. Please change the URL of the git repository specified in =emacs-head.sh= and =emacs-30.sh= if needed.
97 |
98 | ** Pre-built distribution package
99 | :PROPERTIES:
100 | :ID: 3A8A27A7-93D9-4F4E-A621-042FC4521D14
101 | :END:
102 |
103 | You can download my pre-built Emacs 26.3, 27.1, 27.2, 28.1, 28.2, 29.1, 29.2, 29.3, 29.4, =30.1= and HEAD with ns-inline patch. =Emacs.app= will be installed under =/Applications/Emacs-takaxp= in your macOS. The pkg contains =GnuTLS= and =jansson=. These packages are signed and notarized with my Apple developer ID: =H2PH8KNN3H=.
104 |
105 | *** Emacs 31.x (with inline patch) *!unstable!*
106 | :PROPERTIES:
107 | :ID: 9B7E9F4F-E5C7-4A09-A06B-7E1E58ADBDB9
108 | :END:
109 |
110 | #+begin_quote
111 | [!WARNING]
112 | These packages are built based on the current development source code. So it may be unstable or broken.
113 | #+end_quote
114 |
115 | # https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners
116 |
117 | #+caption: HEAD(master) build with NativeComp
118 | | Chip | Version | Download | macOS | md5 |
119 | |-------+---------+-----------------------+---------+----------------------------------|
120 | | Apple | 31.0.50 | [[https://pxaka.tokyo/emacs/pkg/emacs-head_apple_nc.pkg][⬇pkg(NC)]] (06JUN2025) | Sonoma | [[https://pxaka.tokyo/emacs/pkg/emacs-head_apple_nc.md5][c4aa1111976fd01d8fc01809c7b75bd4]] |
121 | | Intel | 31.0.50 | [[https://pxaka.tokyo/emacs/pkg/emacs-head_intel_nc.pkg][⬇pkg(NC)]] (06JUN2025) | Ventura | [[https://pxaka.tokyo/emacs/pkg/emacs-head_intel_nc.md5][f689a8a9d564d74d27178917786f58bd]] |
122 |
123 | #+begin_quote
124 | [!IMPORTANT]
125 | Please read [[https://github.com/takaxp/ns-inline-patch?tab=readme-ov-file#using-nativecomp][Using NativeComp]] section if you have any troubles.
126 | #+end_quote
127 |
128 | Following packages are built *without* NativeComp option.
129 |
130 | #+caption: HEAD(master)
131 | | Chip | Version | Download | macOS | md5 |
132 | |-------+---------+-------------------+---------+----------------------------------|
133 | | Apple | 31.0.50 | [[https://pxaka.tokyo/emacs/pkg/emacs-head_apple.pkg][⬇pkg]] (06JUN2025) | Sonoma | [[https://pxaka.tokyo/emacs/pkg/emacs-head_apple.md5][9e34e3f4359b36702ab53f45e0fdde86]] |
134 | | Intel | 31.0.50 | [[https://pxaka.tokyo/emacs/pkg/emacs-head_intel.pkg][⬇pkg]] (06JUN2025) | Ventura | [[https://pxaka.tokyo/emacs/pkg/emacs-head_intel.md5][142813da7dc38b7ab094ca8751c871b6]] |
135 |
136 | *** Emacs 30 (with inline patch)
137 | :PROPERTIES:
138 | :ID: E33762E0-D4DC-4E5D-B7A9-06CB5493E3C1
139 | :END:
140 |
141 | #+caption: emacs-30 with NativeComp
142 | | Chip | Version | Download | macOS | [MB] | md5 |
143 | |-------+---------+-----------------------+---------+-------+----------------------------------|
144 | | Apple | 30.1 | [[https://pxaka.tokyo/emacs/pkg/emacs-30.1_apple_nc.pkg][⬇pkg(NC)]] (2025-03-04) | Sonoma | 129.1 | [[https://pxaka.tokyo/emacs/pkg/emacs-30.1_apple_nc.md5][df64216ee5de0753f66cddd8be379d4c]] |
145 | | Intel | 30.1 | [[https://pxaka.tokyo/emacs/pkg/emacs-30.1_intel_nc.pkg][⬇pkg(NC)]] (2025-03-04) | Ventura | 131.8 | [[https://pxaka.tokyo/emacs/pkg/emacs-30.1_intel_nc.md5][a08f6e92b918e4d190a03249dc5058c5]] |
146 |
147 | #+begin_quote
148 | [!IMPORTANT]
149 | Please read [[https://github.com/takaxp/ns-inline-patch?tab=readme-ov-file#using-nativecomp][Using NativeComp]] section if you have any troubles.
150 | #+end_quote
151 |
152 | Following packages are built *without* NativeComp option.
153 |
154 | #+caption: emacs-30 without NativeComp
155 | | Chip | Version | Download | macOS | [MB] | md5 |
156 | |-------+---------+--------------------+---------+------+----------------------------------|
157 | | Apple | 30.1 | [[https://pxaka.tokyo/emacs/pkg/emacs-30.1_apple.pkg][⬇pkg]] (2025-03-04) | Sonoma | 61.4 | [[https://pxaka.tokyo/emacs/pkg/emacs-30.1_apple.md5][73ad729391e90cf24e59b3bcc32005bf]] |
158 | | Intel | 30.1 | [[https://pxaka.tokyo/emacs/pkg/emacs-30.1_intel.pkg][⬇pkg]] (2025-03-04) | Ventura | 61.7 | [[https://pxaka.tokyo/emacs/pkg/emacs-30.1_intel.md5][8572a3eef3ea7242a5aeb213b1f3b892]] |
159 |
160 | #+begin_quote
161 | [!NOTE]
162 | Not tested in previous versions, but it probably be installed.
163 | #+end_quote
164 |
165 | *** Emacs 29 (with inline patch)
166 | :PROPERTIES:
167 | :ID: 439F2090-DF77-4228-AAE1-54B97AD67C3E
168 | :END:
169 |
170 | #+begin_quote
171 | [!WARNING]
172 | Before installing the pre-built package, please remove previous Emacs.app from the installed directory if you have installed Emacs 29x. If the previously installed Emacs.app is not removed, the installation may fail.
173 | #+end_quote
174 |
175 | #+caption: emacs-29.x without NativeComp
176 | | Chip | Version | Download | macOS | [MB] | md5 |
177 | |-------+---------+-------------------+---------+------+----------------------------------|
178 | | Apple | 29.4 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.4_apple.pkg][⬇pkg]] (2024-08-13) | Sonoma | 59.3 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.4_apple.md5][122378bfe6c89eb8e29d292e6d982758]] |
179 | | Intel | 29.4 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.4_intel.pkg][⬇pkg]] (2024-08-13) | Ventura | 59.6 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.4_intel.md5][4871fb28c204254733de5f92fb2b2609]] |
180 | |-------+---------+-------------------+---------+------+----------------------------------|
181 | | Apple | 29.3 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.3_apple.pkg][⬇pkg]] (2024-03-26) | Sonoma | 59.3 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.3_apple.md5][00e6c45e8ca4701a2c14c68fcee3ac63]] |
182 | | Intel | 29.3 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.3_intel.pkg][⬇pkg]] (2024-03-26) | Ventura | 59.7 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.3_intel.md5][309c842fa1b4f9be822e2fb20433716b]] |
183 | |-------+---------+-------------------+---------+------+----------------------------------|
184 | | Apple | 29.2 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.2_apple.pkg][⬇pkg]] (2024-01-21) | Sonoma | 59.6 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.2_apple.md5][45db9d15059eec40a32a6570aae79200]] |
185 | | Intel | 29.2 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.2_intel.pkg][⬇pkg]] (2024-01-21) | Sonoma | 59.7 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.2_intel.md5][8b7bbe04fe87b586bc6848eb588bb005]] |
186 | |-------+---------+-------------------+---------+------+----------------------------------|
187 | | Apple | 29.1 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.1_apple.pkg][⬇pkg]] (2023-08-05) | Ventura | 59.5 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.1_apple.md5][d90aef769e18390247aa715bef781677]] |
188 | | Intel | 29.1 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.1_intel.pkg][⬇pkg]] (2023-08-05) | Ventura | 59.6 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.1_intel.md5][c47cf4e373d97e6ccbbe0775aa007a2c]] |
189 |
190 | #+begin_quote
191 | [!NOTE]
192 | Not tested in previous versions, but it probably be installed.
193 | #+end_quote
194 |
195 | Following packages are built with NativeComp option.
196 |
197 | #+caption: emacs-29.4 with NativeComp
198 | | Chip | Version | Download | macOS | [MB] | md5 |
199 | |-------+---------+-----------------------+---------+-------+----------------------------------|
200 | | Apple | 29.4 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.4_apple_nc.pkg][⬇pkg(NC)]] (13AUG2024) | Sonoma | 125.5 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.4_apple_nc.md5][909bca461aab416c4ed8a3971531685c]] |
201 | | Intel | 29.4 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.4_intel_nc.pkg][⬇pkg(NC)]] (13AUG2024) | Ventura | 128.1 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.4_intel_nc.md5][ede9e15e84926b4d834dd21029fde595]] |
202 |
203 | #+begin_quote
204 | [!IMPORTANT]
205 | Please read [[https://github.com/takaxp/ns-inline-patch?tab=readme-ov-file#using-nativecomp][Using NativeComp]] section if you have any troubles.
206 | #+end_quote
207 |
208 | *** Emacs 28 (with inline patch)
209 |
210 | #+begin_quote
211 | [!WARNING]
212 | Before installing the pre-built package, please remove previous Emacs.app from the installed directory if you have installed Emacs 29x. If the previously installed Emacs.app is not removed, the installation may fail.
213 | #+end_quote
214 |
215 | | Chip | Version | Download | macOS | [MB] | md5 |
216 | |-------+---------+-------------------+-------------------+------+----------------------------------|
217 | | Apple | 28.2 | [[https://pxaka.tokyo/emacs/pkg/emacs-28.2_apple.pkg][⬇pkg]] (2022-09-13) | Big Sur[*1] | 55.1 | [[https://pxaka.tokyo/emacs/pkg/emacs-28.2_apple.md5][ea4f7556fbbd971af50b1671e1daf586]] |
218 | | Intel | 28.2 | [[https://pxaka.tokyo/emacs/pkg/emacs-28.2_intel.pkg][⬇pkg]] (2022-09-13) | Monterey | 55.5 | [[https://pxaka.tokyo/emacs/pkg/emacs-28.2_intel.md5][8e7ed5945fcdb2c8cad2e663e96c569b]] |
219 | |-------+---------+-------------------+-------------------+------+----------------------------------|
220 | | Apple | 28.1 | [[https://pxaka.tokyo/emacs/pkg/emacs-28.1_apple.pkg][⬇pkg]] (2022-05-09) | Big Sur[*1] | 55.0 | [[https://pxaka.tokyo/emacs/pkg/emacs-28.1_apple.md5][29589057e1911dfec50b7a6c8fae890f]] |
221 | | Intel | 28.1 | [[https://pxaka.tokyo/emacs/pkg/emacs-28.1_intel.pkg][⬇pkg]] (2022-05-09) | Big Sur, Monterey | 55.4 | [[https://pxaka.tokyo/emacs/pkg/emacs-28.1_intel.md5][a2823a3e929bcf90e67b144dd1db220d]] |
222 |
223 | [*1] Not tested in Monterey but it probably be installed.
224 |
225 | *** Emacs 27 (with inline patch)
226 | | Chip | Version | Download | macOS | [MB] | md5 |
227 | |-------+---------+------------------+-------------------+------+----------------------------------|
228 | | Apple | 27.2 | [[https://pxaka.tokyo/emacs/pkg/emacs-27.2_apple.pkg][⬇pkg]] (2022-05-09) | Big Sur[*1] | 51.4 | [[https://pxaka.tokyo/emacs/pkg/emacs-27.2_apple.md5][52fda7e597430ae86997555317ff11b2]] |
229 | | Intel | 27.2 | [[https://pxaka.tokyo/emacs/pkg/emacs-27.2_intel.pkg][⬇pkg]] (2022-05-09) | Big Sur, Monterey | 51.8 | [[https://pxaka.tokyo/emacs/pkg/emacs-27.2_intel.md5][58f315e392a9fa893d3260eaf7424fe1]] |
230 | | Intel | 27.1 | [[https://pxaka.tokyo/emacs/pkg/emacs-27.1.pkg][⬇pkg]] | Catalina | 51.3 | 0c7048d147dea6fcdda638a25b161af8 |
231 |
232 | [*1] Not tested in Monterey but it probably be installed.
233 |
234 | (previous built)
235 | | Chip | Version | Download | macOS | [MB] | md5 |
236 | |-------+---------+-----------+---------+------+----------------------------------|
237 | | Apple | 27.2 | [[https://pxaka.tokyo/emacs/pkg/previous/emacs-27.2_apple.pkg][⬇pkg]] (old) | Big Sur | 51.2 | 2cc963b00c0d41c038941ebb35e18446 |
238 | | Intel | 27.2 | [[https://pxaka.tokyo/emacs/pkg/previous/emacs-27.2_intel.pkg][⬇pkg]] (old) | [*2] | 51.8 | 74e06cb24c8898a261d5778892355d3a |
239 |
240 | [*2] Mojave / Catalina / Big Sur
241 |
242 | *** Emacs 26 (with inline patch)
243 | | Chip | Version | Download | macOS | [MB] | md5 |
244 | |-------+---------+----------+----------+------+----------------------------------|
245 | | Intel | 26.3 | [[https://pxaka.tokyo/emacs/pkg/emacs-26.3.pkg][⬇pkg]] | Catalina | 52.9 | 1868c787177f515f18f500ce6b898b05 |
246 |
247 | *** without inline (pure)
248 | :PROPERTIES:
249 | :ID: A7862584-8CBB-434B-86D1-8990D6D47C0D
250 | :END:
251 |
252 | Additionally, the following package is "WITHOUT" inline-patch NS build. In this case, =Emacs.app= will be installed under =/Applications/Emacs-takaxp/pure=.
253 |
254 | #+caption: pure
255 | | Chip | Version | Download | macOS | [MB] | md5 |
256 | |-------+---------+-------------------------+-------------------+------+----------------------------------|
257 | | Apple | 30.1 | [[https://pxaka.tokyo/emacs/pkg/emacs-30.1_apple_pure.pkg][⬇pure.pkg]] (2025-03-04) | Sonoma[*1] | 61.4 | [[https://pxaka.tokyo/emacs/pkg/emacs-30.1_apple_pure.md5][2285e2e60423e0abcd2a09513f554d78]] |
258 | | Intel | 30.1 | [[https://pxaka.tokyo/emacs/pkg/emacs-30.1_intel_pure.pkg][⬇pure.pkg]] (2025-03-04) | Ventura[*1] | 61.7 | [[https://pxaka.tokyo/emacs/pkg/emacs-30.1_intel_pure.md5][847e88a6b4552f895cdeeed825654bed]] |
259 | |-------+---------+-------------------------+-------------------+------+----------------------------------|
260 | | Apple | 29.4 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.4_apple_pure.pkg][⬇pure.pkg]] (2024-08-13) | Sonoma[*1] | 59.2 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.4_apple_pure.md5][a85a6bd9a2d7e39b546d264dce08368a]] |
261 | | Intel | 29.4 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.4_intel_pure.pkg][⬇pure.pkg]] (2024-08-13) | Ventura[*1] | 59.5 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.4_intel_pure.md5][cb8a0c621c293c11aa1a273eb85dbe88]] |
262 | |-------+---------+-------------------------+-------------------+------+----------------------------------|
263 | | Apple | 29.3 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.3_apple_pure.pkg][⬇pure.pkg]] (2024-03-26) | Sonoma[*1] | 59.2 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.3_apple_pure.md5][f526b3d89d192e3ecfb927deb3fd057a]] |
264 | | Intel | 29.3 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.3_intel_pure.pkg][⬇pure.pkg]] (2024-03-26) | Ventura[*1] | 59.7 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.3_intel_pure.md5][af8d8ef6881ff7f548afd7caa1e266bf]] |
265 | |-------+---------+-------------------------+-------------------+------+----------------------------------|
266 | | Apple | 29.2 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.2_apple_pure.pkg][⬇pure.pkg]] (2024-01-21) | Sonoma[*1] | 59.5 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.2_apple_pure.md5][7eaeabb13aaf141203929fd9641c4189]] |
267 | | Intel | 29.2 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.2_intel_pure.pkg][⬇pure.pkg]] (2024-01-21) | Sonoma[*1] | 59.7 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.2_intel_pure.md5][709c2b95efe9a8fd5e45f916eaf54b00]] |
268 | |-------+---------+-------------------------+-------------------+------+----------------------------------|
269 | | Apple | 29.1 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.1_apple_pure.pkg][⬇pure.pkg]] (2023-08-05) | Ventura[*1] | 59.5 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.1_apple_pure.md5][65ce179a76b34f529db93885b053c823]] |
270 | | Intel | 29.1 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.1_intel_pure.pkg][⬇pure.pkg]] (2023-08-05) | Ventura[*1] | 59.6 | [[https://pxaka.tokyo/emacs/pkg/emacs-29.1_intel_pure.md5][7a6ee9639c673be6292d65dcdc681b27]] |
271 | |-------+---------+-------------------------+-------------------+------+----------------------------------|
272 | | Apple | 28.2 | [[https://pxaka.tokyo/emacs/pkg/emacs-28.2_apple_pure.pkg][⬇pure.pkg]] (2022-09-13) | Big Sur[*1] | 55.1 | [[https://pxaka.tokyo/emacs/pkg/emacs-28.2_apple_pure.md5][de3d302f63bbc0d03a5b9c5b64d9f916]] |
273 | | Intel | 28.2 | [[https://pxaka.tokyo/emacs/pkg/emacs-28.2_intel_pure.pkg][⬇pure.pkg]] (2022-09-13) | Big Sur, Monterey | 55.5 | [[https://pxaka.tokyo/emacs/pkg/emacs-28.2_intel_pure.md5][b4475438d04c7b7601e61d18104bb0aa]] |
274 | |-------+---------+-------------------------+-------------------+------+----------------------------------|
275 | | Apple | 28.1 | [[https://pxaka.tokyo/emacs/pkg/emacs-28.1_apple_pure.pkg][⬇pure.pkg]] (2022-05-09) | Big Sur[*1] | 55.0 | [[https://pxaka.tokyo/emacs/pkg/emacs-28.1_apple_pure.md5][e7fa6185f55d0578a236e35ee1dd0f12]] |
276 | | Intel | 28.1 | [[https://pxaka.tokyo/emacs/pkg/emacs-28.1_intel_pure.pkg][⬇pure.pkg]] (2022-05-09) | Big Sur, Monterey | 55.4 | [[https://pxaka.tokyo/emacs/pkg/emacs-28.1_intel_pure.md5][1f20caee450e46fb1afca50ffc6dfb22]] |
277 | |-------+---------+-------------------------+-------------------+------+----------------------------------|
278 | | Apple | 27.2 | [[https://pxaka.tokyo/emacs/pkg/emacs-27.2_apple_pure.pkg][⬇pure.pkg]] | Big Sur | 51.2 | [[https://pxaka.tokyo/emacs/pkg/emacs-27.2_apple_pure.md5][64583b05ebf4d9aa89e8812af980b06f]] |
279 | | Intel | 27.2 | [[https://pxaka.tokyo/emacs/pkg/emacs-27.2_intel_pure.pkg][⬇pure.pkg]] | [*2] | 51.7 | [[https://pxaka.tokyo/emacs/pkg/emacs-27.2_intel_pure.md5][165fed95067d5b4b6d885bfacd1ff9fa]] |
280 | | Intel | 27.1 | [[https://pxaka.tokyo/emacs/pkg/emacs-27.1_pure.pkg][⬇pure.pkg]] | Catalina | 51.3 | [[https://pxaka.tokyo/emacs/pkg/emacs-27.1_pure.md5][fdd14baf87ed4f903b5b02c4e1dd022c]] |
281 |
282 | [*1] Not tested in previous versions, but it probably be installed.
283 | [*2] Mojave / Catalina / Big Sur
284 |
285 | *** Using NativeComp
286 |
287 | For Emacs =31.x=, =30.1=, and =29.4= users, you can try to use an Emacs supporting =NativeComp= by downloading pkg from the links in above sections. Integrated lisp code are natively compiled so the pkg size is increased compared to that of the normal pkg file.
288 |
289 | Currently, installing =gcc= by brew is required to compile additional lisp code by the installed Emacs. And adding the following configuration will be needed to your =early-init.el= or beginning of =init.el= when you face a warning like *Warning (comp): libgccjit.so: error: error invoking gcc driver*.
290 |
291 | #+begin_src emacs-lisp
292 | (setenv "LIBRARY_PATH"
293 | (string-join
294 | '("/opt/homebrew/opt/gcc/lib/gcc/14"
295 | "/opt/homebrew/opt/libgccjit/lib/gcc/14"
296 | "/opt/homebrew/opt/gcc/lib/gcc/14/gcc/aarch64-apple-darwin24/14")
297 | ":"))
298 | #+end_src
299 |
300 | #+begin_quote
301 | [!NOTE]
302 | - =14= specified in the above paths may have to be aligned to your environment.
303 | - For Intel mac user, please replace =aarch64= with =x86_64=.
304 | - =darwin24= may also be changed, check the output of M-x ~emacs-version~.
305 | #+end_quote
306 |
307 | **** install gcc by HomeBrew
308 |
309 | Just run the following two commands.
310 |
311 | #+begin_src sh
312 | # setup grew
313 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
314 | # install gcc
315 | brew install gcc
316 | #+end_src
317 |
318 | *** Integrated dynamic libraries:
319 |
320 | - libffi.7.dylib (or libffi.8.dylib), libffi is NOT contained in HEAD pkg.
321 | - libgmp.10.dylib
322 | - libgnutls.30.dylib
323 | - libhogweed.6.dylib
324 | - libidn2.0.dylib
325 | - libintl.8.dylib
326 | - libjansson.4.dylib
327 | - libnettle.8.dylib
328 | - libp11-kit.0.dylib
329 | - libtasn1.6.dylib
330 | - libunistring.5.dylib
331 |
332 | The =system-configuration-features= is:
333 |
334 | =NOTIFY KQUEUE ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES THREADS JSON PDUMPER=
335 |
336 | Enjoy!
337 |
338 |
--------------------------------------------------------------------------------
/archive/fix-working-text.patch:
--------------------------------------------------------------------------------
1 | *** emacs_origin/src/keyboard.c 2020-02-18 15:49:01.000000000 +0900
2 | --- emacs/src/keyboard.c 2020-02-18 15:54:48.000000000 +0900
3 | ***************
4 | *** 2901,2906 ****
5 | --- 2901,2912 ----
6 | example banishing the mouse under mouse-avoidance-mode. */
7 | timer_resume_idle ();
8 |
9 | + #ifdef HAVE_NS
10 | + if (CONSP (c)
11 | + && (EQ (XCAR (c), intern ("ns-unput-working-text"))))
12 | + input_was_pending = input_pending;
13 | + #endif
14 | +
15 | if (current_buffer != prev_buffer)
16 | {
17 | /* The command may have changed the keymaps. Pretend there
18 | *** emacs_origin/src/nsterm.m 2020-02-18 15:49:01.000000000 +0900
19 | --- emacs/src/nsterm.m 2020-02-18 16:01:51.000000000 +0900
20 | ***************
21 | *** 6487,6492 ****
22 | --- 6487,6496 ----
23 | if (!emacs_event)
24 | return;
25 |
26 | + /* First, clear any working text. */
27 | + if (workingText != nil)
28 | + [self deleteWorkingText];
29 | +
30 | /* It might be preferable to use getCharacters:range: below,
31 | cf. https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/CocoaPerformance/Articles/StringDrawing.html#//apple_ref/doc/uid/TP40001445-112378.
32 | However, we probably can't use SAFE_NALLOCA here because it might
33 | ***************
34 | *** 6515,6524 ****
35 | emacs_event->code = code;
36 | EV_TRAILER ((id)nil);
37 | }
38 | -
39 | - /* Last, clear any working text. */
40 | - if (workingText != nil)
41 | - [self deleteWorkingText];
42 | }
43 |
44 |
45 | --- 6519,6524 ----
46 | ***************
47 | *** 6743,6750 ****
48 |
49 | NSTRACE ("[EmacsView mouseDown:]");
50 |
51 | - [self deleteWorkingText];
52 | -
53 | if (!emacs_event)
54 | return;
55 |
56 | --- 6743,6748 ----
57 | ***************
58 | *** 7369,7375 ****
59 |
60 | if (emacs_event && is_focus_frame)
61 | {
62 | - [self deleteWorkingText];
63 | emacs_event->kind = FOCUS_OUT_EVENT;
64 | EV_TRAILER ((id)nil);
65 | }
66 | --- 7367,7372 ----
67 |
--------------------------------------------------------------------------------
/archive/ns-ime-191230.patch:
--------------------------------------------------------------------------------
1 | diff -crN --exclude .git emacs_origin/configure.ac emacs/configure.ac
2 | *** emacs_origin/configure.ac 2019-12-30 01:06:49.000000000 +0900
3 | --- emacs/configure.ac 2019-12-30 07:22:13.000000000 +0900
4 | ***************
5 | *** 2073,2079 ****
6 | INSTALL_ARCH_INDEP_EXTRA=
7 | fi
8 |
9 | ! NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o $ns_fontfile"
10 | fi
11 | CFLAGS="$tmp_CFLAGS"
12 | CPPFLAGS="$tmp_CPPFLAGS"
13 | --- 2073,2079 ----
14 | INSTALL_ARCH_INDEP_EXTRA=
15 | fi
16 |
17 | ! NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o macim.o $ns_fontfile"
18 | fi
19 | CFLAGS="$tmp_CFLAGS"
20 | CPPFLAGS="$tmp_CPPFLAGS"
21 | ***************
22 | *** 5459,5465 ****
23 |
24 | darwin)
25 | if test "$HAVE_NS" = "yes"; then
26 | ! libs_nsgui="-framework AppKit"
27 | if test "$NS_IMPL_COCOA" = "yes"; then
28 | libs_nsgui="$libs_nsgui -framework IOKit -framework Carbon"
29 | fi
30 | --- 5459,5465 ----
31 |
32 | darwin)
33 | if test "$HAVE_NS" = "yes"; then
34 | ! libs_nsgui="-framework AppKit -framework Carbon"
35 | if test "$NS_IMPL_COCOA" = "yes"; then
36 | libs_nsgui="$libs_nsgui -framework IOKit -framework Carbon"
37 | fi
38 | diff -crN --exclude .git emacs_origin/lisp/term/common-win.el emacs/lisp/term/common-win.el
39 | *** emacs_origin/lisp/term/common-win.el 2019-12-30 01:06:56.000000000 +0900
40 | --- emacs/lisp/term/common-win.el 2019-12-30 07:22:13.000000000 +0900
41 | ***************
42 | *** 73,78 ****
43 | --- 73,79 ----
44 | (cons 12 'ns-new-frame)
45 | (cons 13 'ns-toggle-toolbar)
46 | (cons 14 'ns-show-prefs)
47 | + (cons 15 'mac-change-input-method)
48 | ))))
49 | (set-terminal-parameter frame 'x-setup-function-keys t)))
50 |
51 | diff -crN --exclude .git emacs_origin/lisp/term/ns-win.el emacs/lisp/term/ns-win.el
52 | *** emacs_origin/lisp/term/ns-win.el 2019-12-30 01:06:56.000000000 +0900
53 | --- emacs/lisp/term/ns-win.el 2019-12-30 07:24:16.000000000 +0900
54 | ***************
55 | *** 175,181 ****
56 | (define-key global-map [ns-new-frame] 'make-frame)
57 | (define-key global-map [ns-toggle-toolbar] 'ns-toggle-toolbar)
58 | (define-key global-map [ns-show-prefs] 'customize)
59 | !
60 |
61 | ;; Set up a number of aliases and other layers to pretend we're using
62 | ;; the Choi/Mitsuharu Carbon port.
63 | --- 175,181 ----
64 | (define-key global-map [ns-new-frame] 'make-frame)
65 | (define-key global-map [ns-toggle-toolbar] 'ns-toggle-toolbar)
66 | (define-key global-map [ns-show-prefs] 'customize)
67 | ! (define-key global-map [mac-change-input-method] 'mac-change-input-method)
68 |
69 | ;; Set up a number of aliases and other layers to pretend we're using
70 | ;; the Choi/Mitsuharu Carbon port.
71 | ***************
72 | *** 269,282 ****
73 | ;; editing window.)
74 |
75 | (defface ns-working-text-face
76 | ! '((t :underline t))
77 | "Face used to highlight working text during compose sequence insert."
78 | :group 'ns)
79 |
80 | (defvar ns-working-overlay nil
81 | "Overlay used to highlight working text during compose sequence insert.
82 | When text is in th echo area, this just stores the length of the working text.")
83 |
84 | (defvar ns-working-text) ; nsterm.m
85 |
86 | ;; Test if in echo area, based on mac-win.el 2007/08/26 unicode-2.
87 | --- 269,298 ----
88 | ;; editing window.)
89 |
90 | (defface ns-working-text-face
91 | ! '((((background dark)) :underline "gray80")
92 | ! (t :underline "gray20"))
93 | "Face used to highlight working text during compose sequence insert."
94 | :group 'ns)
95 |
96 | + (defface ns-marked-text-face
97 | + '((((background dark)) :underline "gray80")
98 | + (t :underline "gray20"))
99 | + "Face used to highlight marked text during compose sequence insert."
100 | + :group 'ns)
101 | +
102 | + (defface ns-unmarked-text-face
103 | + '((((background dark)) :underline "gray20")
104 | + (t :underline "gray80"))
105 | + "Face used to highlight marked text during compose sequence insert."
106 | + :group 'ns)
107 | +
108 | (defvar ns-working-overlay nil
109 | "Overlay used to highlight working text during compose sequence insert.
110 | When text is in th echo area, this just stores the length of the working text.")
111 |
112 | + (defvar ns-marked-overlay nil
113 | + "Overlay used to highlight marked text during compose sequence insert.")
114 | +
115 | (defvar ns-working-text) ; nsterm.m
116 |
117 | ;; Test if in echo area, based on mac-win.el 2007/08/26 unicode-2.
118 | ***************
119 | *** 284,300 ****
120 | (defun ns-in-echo-area ()
121 | "Whether, for purposes of inserting working composition text, the minibuffer
122 | is currently being used."
123 | ! (or isearch-mode
124 | ! (and cursor-in-echo-area (current-message))
125 | ! ;; Overlay strings are not shown in some cases.
126 | ! (get-char-property (point) 'invisible)
127 | ! (and (not (bobp))
128 | ! (or (and (get-char-property (point) 'display)
129 | ! (eq (get-char-property (1- (point)) 'display)
130 | ! (get-char-property (point) 'display)))
131 | ! (and (get-char-property (point) 'composition)
132 | ! (eq (get-char-property (1- (point)) 'composition)
133 | ! (get-char-property (point) 'composition)))))))
134 |
135 | ;; The 'interactive' here stays for subinvocations, so the ns-in-echo-area
136 | ;; always returns nil for some reason. If this WASN'T the case, we could
137 | --- 300,318 ----
138 | (defun ns-in-echo-area ()
139 | "Whether, for purposes of inserting working composition text, the minibuffer
140 | is currently being used."
141 | ! (setq mac-in-echo-area
142 | ! (or isearch-mode
143 | ! (and cursor-in-echo-area (current-message))
144 | ! ;; Overlay strings are not shown in some cases.
145 | ! (get-char-property (point) 'invisible)
146 | ! (and (not (bobp))
147 | ! (or (and (get-char-property (point) 'display)
148 | ! (eq (get-char-property (1- (point)) 'display)
149 | ! (get-char-property (point) 'display)))
150 | ! (and (get-char-property (point) 'composition)
151 | ! (eq (get-char-property (1- (point)) 'composition)
152 | ! (get-char-property (point) 'composition)))))))
153 | ! mac-in-echo-area)
154 |
155 | ;; The 'interactive' here stays for subinvocations, so the ns-in-echo-area
156 | ;; always returns nil for some reason. If this WASN'T the case, we could
157 | ***************
158 | *** 303,311 ****
159 | (defun ns-put-working-text ()
160 | (interactive)
161 | (if (ns-in-echo-area) (ns-echo-working-text) (ns-insert-working-text)))
162 | (defun ns-unput-working-text ()
163 | (interactive)
164 | ! (ns-delete-working-text))
165 |
166 | (defun ns-insert-working-text ()
167 | "Insert contents of `ns-working-text' as UTF-8 string and mark with
168 | --- 321,332 ----
169 | (defun ns-put-working-text ()
170 | (interactive)
171 | (if (ns-in-echo-area) (ns-echo-working-text) (ns-insert-working-text)))
172 | + (defvar mac-ime-cursor-type nil)
173 | (defun ns-unput-working-text ()
174 | (interactive)
175 | ! (ns-delete-working-text)
176 | ! (when mac-ime-cursor-type
177 | ! (setq cursor-type mac-ime-cursor-type)))
178 |
179 | (defun ns-insert-working-text ()
180 | "Insert contents of `ns-working-text' as UTF-8 string and mark with
181 | ***************
182 | *** 909,914 ****
183 | --- 930,1432 ----
184 | &context (window-system ns))
185 | (ns-get-selection selection-symbol target-type))
186 |
187 | + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
188 | + ;;
189 | + ;; Implementation of Input Method Extension for MacOS X
190 | + ;; written by Taiichi Hashimoto
191 | + ;; enhanced by Takaaki Ishikawa
192 | + (defvar mac-input-method-parameters
193 | + '(
194 | + ("com.apple.inputmethod.Kotoeri.Roman"
195 | + (title . "A")
196 | + (cursor-color)
197 | + (cursor-type))
198 | + ("com.apple.inputmethod.Kotoeri.Japanese"
199 | + (title . "あ")
200 | + (cursor-color)
201 | + (cursor-type))
202 | + ("com.apple.inputmethod.Kotoeri.Japanese.Katakana"
203 | + (title . "ア")
204 | + (cursor-color)
205 | + (cursor-type))
206 | + ("com.apple.inputmethod.Kotoeri.Japanese.FullWidthRoman"
207 | + (title . "A")
208 | + (cursor-color)
209 | + (cursor-type))
210 | + ("com.apple.inputmethod.Kotoeri.Japanese.HalfWidthKana"
211 | + (title . "ア")
212 | + (cursor-color)
213 | + (cursor-type))
214 | + ("com.apple.inputmethod.kotoeri.Ainu"
215 | + (title . "アイヌ")
216 | + (cursor-color)
217 | + (cursor-type))
218 | + ("com.apple.inputmethod.Korean.2SetKorean"
219 | + (title . "가2")
220 | + (cursor-color)
221 | + (cursor-type))
222 | + ("com.apple.inputmethod.Korean.3SetKorean"
223 | + (title . "가3")
224 | + (cursor-color)
225 | + (cursor-type))
226 | + ("com.apple.inputmethod.Korean.390Sebulshik"
227 | + (title . "가5")
228 | + (cursor-color)
229 | + (cursor-type))
230 | + ("com.apple.inputmethod.Korean.GongjinCheongRomaja"
231 | + (title . "가G")
232 | + (cursor-color)
233 | + (cursor-type))
234 | + ("com.apple.inputmethod.Korean.HNCRomaja"
235 | + (title . "가H")
236 | + (cursor-color)
237 | + (cursor-type))
238 | + ("com.apple.inputmethod.Tamil.AnjalIM"
239 | + (title . "Anjal")
240 | + (cursor-color)
241 | + (cursor-type))
242 | + ("com.apple.inputmethod.Tamil.Tamil99"
243 | + (title . "Tamil")
244 | + (cursor-color)
245 | + (cursor-type))
246 | + ("com.apple.inputmethod.VietnameseIM.VietnameseSimpleTelex"
247 | + (title . "ST")
248 | + (cursor-color)
249 | + (cursor-type))
250 | + ("com.apple.inputmethod.VietnameseIM.VietnameseTelex"
251 | + (title . "TX")
252 | + (cursor-color)
253 | + (cursor-type))
254 | + ("com.apple.inputmethod.VietnameseIM.VietnameseVNI"
255 | + (title . "VN")
256 | + (cursor-color)
257 | + (cursor-type))
258 | + ("com.apple.inputmethod.VietnameseIM.VietnameseVIQR"
259 | + (title . "VQ")
260 | + (cursor-color)
261 | + (cursor-type))
262 | + ("com.apple.inputmethod.SCIM.ITABC"
263 | + (title . "拼")
264 | + (cursor-color)
265 | + (cursor-type))
266 | + ("com.apple.inputmethod.SCIM.WBX"
267 | + (title . "型")
268 | + (cursor-color)
269 | + (cursor-type))
270 | + ("com.apple.inputmethod.SCIM.WBH"
271 | + (title . "画")
272 | + (cursor-color)
273 | + (cursor-type))
274 | + ("com.apple.inputmethod.TCIM.Zhuyin"
275 | + (title . "注")
276 | + (cursor-color)
277 | + (cursor-type))
278 | + ("com.apple.inputmethod.TCIM.Pinyin"
279 | + (title . "拼")
280 | + (cursor-color)
281 | + (cursor-type))
282 | + ("com.apple.inputmethod.TCIM.Cangjie"
283 | + (title . "倉")
284 | + (cursor-color)
285 | + (cursor-type))
286 | + ("com.apple.inputmethod.TCIM.Jianyi"
287 | + (title . "速")
288 | + (cursor-color)
289 | + (cursor-type))
290 | + ("com.apple.inputmethod.TCIM.Dayi"
291 | + (title . "易")
292 | + (cursor-color)
293 | + (cursor-type))
294 | + ("com.apple.inputmethod.TCIM.Hanin"
295 | + (title . "漢")
296 | + (cursor-color)
297 | + (cursor-type))
298 | + ("com.google.inputmethod.Japanese.Roman"
299 | + (title . "G")
300 | + (cursor-color)
301 | + (cursor-type))
302 | + ("com.google.inputmethod.Japanese.base"
303 | + (title . "ぐ")
304 | + (cursor-color)
305 | + (cursor-type))
306 | + ("com.google.inputmethod.Japanese.Katakana"
307 | + (title . "グ")
308 | + (cursor-color)
309 | + (cursor-type))
310 | + ("com.google.inputmethod.Japanese.FullWidthRoman"
311 | + (title . "G")
312 | + (cursor-color)
313 | + (cursor-type))
314 | + ("com.google.inputmethod.Japanese.HalfWidthKana"
315 | + (title . "グ")
316 | + (cursor-color)
317 | + (cursor-type))
318 | + ("jp.monokakido.inputmethod.Kawasemi.Roman"
319 | + (title . "K")
320 | + (cursor-color)
321 | + (cursor-type))
322 | + ("jp.monokakido.inputmethod.Kawasemi.Japanese"
323 | + (title . "か")
324 | + (cursor-color)
325 | + (cursor-type))
326 | + ("jp.monokakido.inputmethod.Kawasemi.Japanese.Katakana"
327 | + (title . "カ")
328 | + (cursor-color)
329 | + (cursor-type))
330 | + ("jp.monokakido.inputmethod.Kawasemi.Japanese.FullWidthRoman"
331 | + (title . "K")
332 | + (cursor-color)
333 | + (cursor-type))
334 | + ("jp.monokakido.inputmethod.Kawasemi.Japanese.HalfWidthKana"
335 | + (title . "カ")
336 | + (cursor-color)
337 | + (cursor-type))
338 | + ("jp.monokakido.inputmethod.Kawasemi.Japanese.HalfWidthRoman"
339 | + (title . "_K")
340 | + (cursor-color)
341 | + (cursor-type))
342 | + ("jp.monokakido.inputmethod.Kawasemi.Japanese.Code"
343 | + (title . "C")
344 | + (cursor-color)
345 | + (cursor-type))
346 | + ("com.justsystems.inputmethod.atok21.Roman"
347 | + (title . "A")
348 | + (cursor-color)
349 | + (cursor-type))
350 | + ("com.justsystems.inputmethod.atok21.Japanese"
351 | + (title . "あ")
352 | + (cursor-color)
353 | + (cursor-type))
354 | + ("com.justsystems.inputmethod.atok21.Japanese.Katakana"
355 | + (title . "ア")
356 | + (cursor-color)
357 | + (cursor-type))
358 | + ("com.justsystems.inputmethod.atok21.Japanese.FullWidthRoman"
359 | + (title . "英")
360 | + (cursor-color)
361 | + (cursor-type))
362 | + ("com.justsystems.inputmethod.atok21.Japanese.HalfWidthEiji"
363 | + (title . "半英")
364 | + (cursor-color)
365 | + (cursor-type))
366 | + ("com.justsystems.inputmethod.atok22.Roman"
367 | + (title . "A")
368 | + (cursor-color)
369 | + (cursor-type))
370 | + ("com.justsystems.inputmethod.atok22.Japanese"
371 | + (title . "あ")
372 | + (cursor-color)
373 | + (cursor-type))
374 | + ("com.justsystems.inputmethod.atok22.Japanese.Katakana"
375 | + (title . "ア")
376 | + (cursor-color)
377 | + (cursor-type))
378 | + ("com.justsystems.inputmethod.atok22.Japanese.FullWidthRoman"
379 | + (title . "英")
380 | + (cursor-color)
381 | + (cursor-type))
382 | + ("com.justsystems.inputmethod.atok22.Japanese.HalfWidthEiji"
383 | + (title . "半英")
384 | + (cursor-color)
385 | + (cursor-type))
386 | + ("com.justsystems.inputmethod.atok23.Roman"
387 | + (title . "A")
388 | + (cursor-color)
389 | + (cursor-type))
390 | + ("com.justsystems.inputmethod.atok23.Japanese"
391 | + (title . "あ")
392 | + (cursor-color)
393 | + (cursor-type))
394 | + ("com.justsystems.inputmethod.atok23.Japanese.Katakana"
395 | + (title . "ア")
396 | + (cursor-color)
397 | + (cursor-type))
398 | + ("com.justsystems.inputmethod.atok23.Japanese.FullWidthRoman"
399 | + (title . "英")
400 | + (cursor-color)
401 | + (cursor-type))
402 | + ("com.justsystems.inputmethod.atok23.Japanese.HalfWidthEiji"
403 | + (title . "半英")
404 | + (cursor-color)
405 | + (cursor-type))
406 | + ("com.justsystems.inputmethod.atok24.Roman"
407 | + (title . "A")
408 | + (cursor-color)
409 | + (cursor-type))
410 | + ("com.justsystems.inputmethod.atok24.Japanese"
411 | + (title . "あ")
412 | + (cursor-color)
413 | + (cursor-type))
414 | + ("com.justsystems.inputmethod.atok24.Japanese.Katakana"
415 | + (title . "ア")
416 | + (cursor-color)
417 | + (cursor-type))
418 | + ("com.justsystems.inputmethod.atok24.Japanese.FullWidthRoman"
419 | + (title . "英")
420 | + (cursor-color)
421 | + (cursor-type))
422 | + ("com.justsystems.inputmethod.atok24.Japanese.HalfWidthEiji"
423 | + (title . "半英")
424 | + (cursor-color)
425 | + (cursor-type))
426 | + ("com.justsystems.inputmethod.atok25.Roman"
427 | + (title . "A")
428 | + (cursor-color)
429 | + (cursor-type))
430 | + ("com.justsystems.inputmethod.atok25.Japanese"
431 | + (title . "あ")
432 | + (cursor-color)
433 | + (cursor-type))
434 | + ("com.justsystems.inputmethod.atok25.Japanese.Katakana"
435 | + (title . "ア")
436 | + (cursor-color)
437 | + (cursor-type))
438 | + ("com.justsystems.inputmethod.atok25.Japanese.FullWidthRoman"
439 | + (title . "英")
440 | + (cursor-color)
441 | + (cursor-type))
442 | + ("com.justsystems.inputmethod.atok25.Japanese.HalfWidthEiji"
443 | + (title . "半英")
444 | + (cursor-color)
445 | + (cursor-type))
446 | + )
447 | + "Alist of Mac script code vs parameters for input method on macOS.")
448 | +
449 | + (defun mac-get-input-method-parameter (is key)
450 | + "Function to get a parameter of a input method."
451 | + (assq key (cdr (assoc is mac-input-method-parameters))))
452 | +
453 | + (defun mac-get-input-method-title (&optional input-source)
454 | + "Return input method title of input source.
455 | + If input-source is nil, return one of current frame."
456 | + (if input-source
457 | + (cdr (mac-get-input-method-parameter input-source 'title))
458 | + current-input-method-title))
459 | +
460 | + (defun mac-get-cursor-type (&optional input-source)
461 | + "Return cursor type of input source.
462 | + If input-source is nil, return one of current frame."
463 | + (if input-source
464 | + (or (cdr (mac-get-input-method-parameter input-source 'cursor-type))
465 | + (cdr (assq 'cursor-type default-frame-alist))
466 | + cursor-type)
467 | + (cdr (assq 'cursor-type (frame-parameters (selected-frame))))))
468 | +
469 | + (defun mac-get-cursor-color (&optional input-source)
470 | + "Return cursor color of input source.
471 | + If input-source is nil, return one of current frame."
472 | + (if input-source
473 | + (or (cdr (mac-get-input-method-parameter input-source 'cursor-color))
474 | + (cdr (assq 'cursor-color default-frame-alist)))
475 | + (cdr (assq 'cursor-color (frame-parameters (selected-frame))))))
476 | +
477 | + (defun mac-set-input-method-parameter (is key value)
478 | + "Function to set a parameter of a input method."
479 | + (let* ((is-param (assoc is mac-input-method-parameters))
480 | + (param (assq key is-param)))
481 | + (if is-param
482 | + (if param
483 | + (setcdr param value)
484 | + (setcdr is-param (cons (cons key value) (cdr is-param))))
485 | + (setq mac-input-method-parameters
486 | + (cons (list is (cons key value))
487 | + mac-input-method-parameters)))))
488 | +
489 | + (defun mac-input-method-update (is)
490 | + "Funtion to update parameters of a input method."
491 | + (let ((title (mac-get-input-method-title is))
492 | + (type (mac-get-cursor-type is))
493 | + (color (mac-get-cursor-color is)))
494 | + (if (and title (not (equal title (mac-get-input-method-title))))
495 | + (setq current-input-method-title title))
496 | + (if (and type (not (equal type (mac-get-cursor-type))))
497 | + (setq cursor-type type))
498 | + (if (and color (not (equal color (mac-get-cursor-color))))
499 | + (set-cursor-color color))
500 | + (force-mode-line-update)
501 | + (if isearch-mode (isearch-update))))
502 | +
503 | + (defun mac-ime-active-p ()
504 | + "Non-nil if current input source is not Roman or `mac-default-input-ascii'."
505 | + (let ((input-source (mac-get-current-input-source)))
506 | + (or (not (string-match "\\.Roman$" input-source))
507 | + (not (equal mac-default-input-ascii input-source)))))
508 | +
509 | + (defun mac-ime-activate ()
510 | + "Activate input method."
511 | + (interactive)
512 | + (mac-toggle-input-method t)
513 | + (run-hooks 'input-method-activate-hook))
514 | +
515 | + (defun mac-ime-deactivate ()
516 | + "Deactivate input method."
517 | + (interactive)
518 | + (mac-toggle-input-method nil)
519 | + (run-hooks 'input-method-deactivate-hook))
520 | +
521 | + (defun mac-ime-toggle ()
522 | + "Toggle IME."
523 | + (interactive)
524 | + (if (mac-ime-active-p) (mac-ime-deactivate) (mac-ime-activate)))
525 | +
526 | + (defvar mac-ime--before-action nil)
527 | + (defun mac-ime-activate-sticky ()
528 | + "Activate IME for minibuffer."
529 | + (when mac-ime--before-action
530 | + (mac-ime-activate)))
531 | +
532 | + (defun mac-ime-deactivate-sticky ()
533 | + "Deactivate IME for minibuffer."
534 | + (when (setq mac-ime--before-action (mac-ime-active-p))
535 | + (mac-ime-deactivate)))
536 | +
537 | + (defun mac-input-source-registerd-p (&optional input-source)
538 | + "Return nil, if the INPUT-SOURCE is not listed in system.
539 | + If INPUT-SOURCE is nil, `mac-default-input-source' is checked."
540 | + (let ((is (or input-source mac-default-input-source)))
541 | + (when (member is (mac-get-input-source-list))
542 | + t)))
543 | +
544 | + (defun mac-toggle-input-method (&optional arg)
545 | + "Function to toggle input method on macOS."
546 | + (if arg
547 | + (progn
548 | + (make-local-variable 'input-method-function)
549 | + (setq inactivate-current-input-method-function 'mac-toggle-input-method)
550 | + (setq input-method-function nil)
551 | + (setq describe-current-input-method-function nil)
552 | + (mac-toggle-input-source t))
553 | + (kill-local-variable 'input-method-function)
554 | + (setq describe-current-input-method-function nil)
555 | + (mac-toggle-input-source nil)))
556 | +
557 | + (defun mac-change-language-to-us ()
558 | + "Function to change language to us."
559 | + (interactive)
560 | + (mac-toggle-input-method nil))
561 | +
562 | + (defun mac-ime-input-source-list ()
563 | + "Show available input sources."
564 | + (interactive)
565 | + (message "----------------")
566 | + (dolist (is (mac-get-input-source-list))
567 | + (message "%s" is))
568 | + (message "----------------")
569 | + (message "see *Messages*"))
570 | +
571 | + (defun mac-handle-input-method-change ()
572 | + "Function run when a input method change."
573 | + (interactive)
574 | + (when (member default-input-method '("MacOSX" "macOS"))
575 | + (let ((input-source (mac-get-current-input-source))
576 | + (ascii-capable (mac-input-source-is-ascii-capable)))
577 | + (cond ((and (not current-input-method) (not ascii-capable))
578 | + (set-input-method "macOS"))
579 | + ((and (equal current-input-method "macOS") ascii-capable)
580 | + (toggle-input-method nil)))
581 | + (mac-input-method-update input-source))))
582 | +
583 | + ;;
584 | + ;; Emacs input method for input method on macOS.
585 | + ;;
586 | + (register-input-method "macOS" "macOS" 'mac-toggle-input-method
587 | + "Mac" "Input Method on macOS System")
588 | +
589 | + ;;
590 | + ;; Minor mode of using input methods on macOS
591 | + ;;
592 | + (define-minor-mode mac-input-method-mode
593 | + "Use input methods on macOS."
594 | + :init-value nil
595 | + :group 'ns
596 | + :global t
597 | + (if mac-input-method-mode
598 | + (progn
599 | + (setq default-input-method "macOS")
600 | + ;; (add-hook 'minibuffer-setup-hook 'mac-change-language-to-us)
601 | + (if (mac-ime-active-p) (mac-ime-activate) (mac-ime-deactivate))
602 | + (add-hook 'minibuffer-setup-hook #'mac-ime-deactivate-sticky)
603 | + (add-hook 'minibuffer-exit-hook #'mac-ime-activate-sticky)
604 | + (mac-translate-from-yen-to-backslash))
605 | + (setq default-input-method nil)
606 | + (remove-hook 'minibuffer-setup-hook #'mac-ime-deactivate-sticky)
607 | + (remove-hook 'minibuffer-exit-hook #'mac-ime-activate-sticky)))
608 | +
609 | + ;;
610 | + ;; Valiable and functions to pass key(shortcut) to system.
611 | + ;;
612 | + (defvar mac-keys-passed-to-system nil
613 | + "A list of keys passed to system on macOS.")
614 | +
615 | + (defun mac-add-key-passed-to-system (key)
616 | + (let ((shift '(shift shft))
617 | + (control '(control ctrl ctl))
618 | + (option '(option opt alternate alt))
619 | + (command '(command cmd)))
620 | +
621 | + (add-to-list 'mac-keys-passed-to-system
622 | + (cond ((symbolp key)
623 | + (cond ((memq key shift)
624 | + (cons ns-shift-key-mask nil))
625 | + ((memq key control)
626 | + (cons ns-control-key-mask nil))
627 | + ((memq key option)
628 | + (cons ns-alternate-key-mask nil))
629 | + ((memq key command)
630 | + (cons ns-command-key-mask nil))
631 | + (t (cons nil nil))))
632 | + ((numberp key) (cons 0 key))
633 | + ((listp key)
634 | + (let ((l key) (k nil) (m 0))
635 | + (while l
636 | + (cond ((memq (car l) shift)
637 | + (setq m (logior m ns-shift-key-mask)))
638 | + ((memq (car l) control)
639 | + (setq m (logior m ns-control-key-mask)))
640 | + ((memq (car l) option)
641 | + (setq m (logior m ns-alternate-key-mask)))
642 | + ((memq (car l) command)
643 | + (setq m (logior m ns-command-key-mask)))
644 | + ((numberp (car l))
645 | + (if (not k) (setq k (car l)))))
646 | + (setq l (cdr l)))
647 | + (cons m k)))
648 | + (t (cons nil nil))))))
649 | +
650 | + ;;
651 | + ;; Entry Emacs event for inline input method on macOS.
652 | + ;;
653 | + (define-key special-event-map
654 | + [mac-change-input-method] 'mac-handle-input-method-change)
655 | +
656 | + ;;
657 | + ;; Convert yen to backslash for JIS keyboard.
658 | + ;;
659 | + (defun mac-translate-from-yen-to-backslash ()
660 | + ;; Convert yen to backslash for JIS keyboard.
661 | + (interactive)
662 | +
663 | + (define-key global-map [165] nil)
664 | + (define-key global-map [2213] nil)
665 | + (define-key global-map [3420] nil)
666 | + (define-key global-map [67109029] nil)
667 | + (define-key global-map [67111077] nil)
668 | + (define-key global-map [8388773] nil)
669 | + (define-key global-map [134219941] nil)
670 | + (define-key global-map [75497596] nil)
671 | + (define-key global-map [201328805] nil)
672 | + (define-key function-key-map [165] [?\\])
673 | + (define-key function-key-map [2213] [?\\]) ;; for Intel
674 | + (define-key function-key-map [3420] [?\\]) ;; for PowerPC
675 | + (define-key function-key-map [67109029] [?\C-\\])
676 | + (define-key function-key-map [67111077] [?\C-\\])
677 | + (define-key function-key-map [8388773] [?\M-\\])
678 | + (define-key function-key-map [134219941] [?\M-\\])
679 | + (define-key function-key-map [75497596] [?\C-\M-\\])
680 | + (define-key function-key-map [201328805] [?\C-\M-\\])
681 | + )
682 | + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
683 | +
684 | (provide 'ns-win)
685 | (provide 'term/ns-win)
686 |
687 | diff -crN --exclude .git emacs_origin/src/Makefile.in emacs/src/Makefile.in
688 | *** emacs_origin/src/Makefile.in 2019-12-30 01:10:55.000000000 +0900
689 | --- emacs/src/Makefile.in 2019-12-30 07:22:13.000000000 +0900
690 | ***************
691 | *** 433,439 ****
692 | SOME_MACHINE_OBJECTS = dosfns.o msdos.o \
693 | xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \
694 | fontset.o dbusbind.o cygw32.o \
695 | ! nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o macfont.o \
696 | w32.o w32console.o w32cygwinx.o w32fns.o w32heap.o w32inevt.o w32notify.o \
697 | w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o \
698 | w16select.o widget.o xfont.o ftfont.o xftfont.o ftxfont.o gtkutil.o \
699 | --- 433,439 ----
700 | SOME_MACHINE_OBJECTS = dosfns.o msdos.o \
701 | xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \
702 | fontset.o dbusbind.o cygw32.o \
703 | ! nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o macfont.o macim.o \
704 | w32.o w32console.o w32cygwinx.o w32fns.o w32heap.o w32inevt.o w32notify.o \
705 | w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o \
706 | w16select.o widget.o xfont.o ftfont.o xftfont.o ftxfont.o gtkutil.o \
707 | diff -crN --exclude .git emacs_origin/src/macim.m emacs/src/macim.m
708 | *** emacs_origin/src/macim.m 1970-01-01 09:00:00.000000000 +0900
709 | --- emacs/src/macim.m 2019-12-30 07:22:13.000000000 +0900
710 | ***************
711 | *** 0 ****
712 | --- 1,208 ----
713 | + /* Implementation of Input Method Extension for macOS.
714 | + Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
715 | + Taiichi Hashimoto .
716 | +
717 | + 2019
718 | + enhanced by Takaaki Ishikawa
719 | + */
720 | +
721 | + #include "config.h"
722 | +
723 | + #ifdef NS_IMPL_COCOA
724 | +
725 | + #include
726 | + #include
727 | + #include
728 | + #include
729 | + #include
730 | +
731 | + #include
732 | +
733 | + #include "lisp.h"
734 | + #include "blockinput.h"
735 | +
736 | + #include "termhooks.h"
737 | + #include "keyboard.h"
738 | + #include "buffer.h"
739 | +
740 | + //extern Lisp_Object Qcurrent_input_method;
741 | + //extern int cursor_in_echo_area;
742 | + static Lisp_Object Qmac_keys_passed_to_system;
743 | +
744 | + void mac_init_input_method ();
745 | + int mac_pass_key_to_system (int code, int modifiers);
746 | + int mac_pass_key_directly_to_emacs ();
747 | + int mac_store_change_input_method_event ();
748 | +
749 | + DEFUN ("mac-input-source-is-ascii-capable", Fmac_input_source_is_ascii_capable, Smac_input_source_is_ascii_capable,
750 | + 0, 0, 0,
751 | + doc: /* Is current input source ascii capable? */)
752 | + (void)
753 | + {
754 | + TISInputSourceRef is = TISCopyCurrentKeyboardInputSource();
755 | + CFBooleanRef ret = TISGetInputSourceProperty(is, kTISPropertyInputSourceIsASCIICapable);
756 | +
757 | + return CFBooleanGetValue(ret)? Qt : Qnil;
758 | + }
759 | +
760 | + DEFUN ("mac-get-input-source-list", Fmac_get_input_source_list, Smac_get_input_source_list,
761 | + 0, 0, 0,
762 | + doc: /* get input source list on macOS */)
763 | + (void)
764 | + {
765 | + NSArray *is_list = (NSArray *)TISCreateInputSourceList(NULL, false);
766 | + int list_size = [is_list count];
767 | + Lisp_Object list[list_size];
768 | + int i;
769 | +
770 | + for (i = 0; i < list_size; i++) {
771 | + TISInputSourceRef is = (TISInputSourceRef)[is_list objectAtIndex:i];
772 | + NSString *id = (NSString *)TISGetInputSourceProperty(is, kTISPropertyInputSourceID);
773 | + list[i] = make_string([id UTF8String],
774 | + [id lengthOfBytesUsingEncoding:NSUTF8StringEncoding]);
775 | + }
776 | +
777 | + return Flist(list_size, list);
778 | + }
779 | +
780 | + DEFUN ("mac-get-current-input-source", Fmac_get_current_input_source, Smac_get_current_input_source,
781 | + 0, 0, 0,
782 | + doc: /* get current input source on macOS */)
783 | + (void)
784 | + {
785 | + TISInputSourceRef is = TISCopyCurrentKeyboardInputSource();
786 | + NSString *id = (NSString *)TISGetInputSourceProperty(is, kTISPropertyInputSourceID);
787 | +
788 | + return make_string([id UTF8String],
789 | + [id lengthOfBytesUsingEncoding:NSUTF8StringEncoding]);
790 | + }
791 | +
792 | + DEFUN ("mac-toggle-input-source", Fmac_toggle_input_source, Smac_toggle_input_source,
793 | + 1, 1, 0,
794 | + doc: /* toggle input source on macOS */)
795 | + (arg)
796 | + Lisp_Object arg;
797 | + {
798 | + TISInputSourceRef is = NULL;
799 | + Lisp_Object Vinput_source = Qnil;
800 | + if (NILP (arg)) {
801 | + Vinput_source = Vmac_default_input_ascii;
802 | + } else {
803 | + Vinput_source = Vmac_default_input_source;
804 | + }
805 | +
806 | + if ( NILP (Vinput_source) || !STRINGP (Vinput_source) ){
807 | + if (NILP (arg)) {
808 | + is = TISCopyCurrentASCIICapableKeyboardInputSource();
809 | + } else {
810 | + NSString *locale;
811 | + NSArray *languages = [NSLocale preferredLanguages];
812 | + if (languages != nil) {
813 | + locale = [languages objectAtIndex:0];
814 | + } else {
815 | + locale = [[NSLocale currentLocale]
816 | + objectForKey:NSLocaleLanguageCode];
817 | + }
818 | + if ( [locale hasPrefix:@"ja"] ) {
819 | + is = TISCopyInputSourceForLanguage((CFStringRef)locale);
820 | + }
821 | + }
822 | +
823 | + if (is) TISSelectInputSource(is);
824 | + return arg;
825 | + }
826 | +
827 | + NSString *targetID = [NSString stringWithUTF8String: SSDATA (Vinput_source)];
828 | + if ( targetID == nil) {
829 | + return arg;
830 | + }
831 | + NSArray *is_list = (NSArray *)TISCreateInputSourceList(NULL, false);
832 | + int list_size = [is_list count];
833 | + for(int i=0; i< list_size; i++) {
834 | + NSString *id = (NSString *)TISGetInputSourceProperty((TISInputSourceRef)[is_list objectAtIndex:i], kTISPropertyInputSourceID);
835 | + if ( [id compare:targetID] == NSOrderedSame ) {
836 | + is = (TISInputSourceRef)[is_list objectAtIndex:i];
837 | + break;
838 | + }
839 | + }
840 | +
841 | + if (is) TISSelectInputSource(is);
842 | + return arg;
843 | + }
844 | +
845 | + int
846 | + mac_store_change_input_method_event ()
847 | + {
848 | + Lisp_Object dim;
849 | + int ret = FALSE;
850 | +
851 | + dim = Fsymbol_value (intern ("default-input-method"));
852 | + if (STRINGP (dim) && (strcmp(SDATA (dim), "MacOSX") == 0
853 | + || strcmp(SDATA (dim), "macOS") == 0))
854 | + {
855 | + ret = TRUE;
856 | + }
857 | +
858 | + return ret;
859 | + }
860 | +
861 | + int
862 | + mac_pass_key_to_system (int code, int modifiers)
863 | + {
864 | + Lisp_Object keys = Fsymbol_value (Qmac_keys_passed_to_system);
865 | + Lisp_Object m, k;
866 | +
867 | + while (!NILP (keys))
868 | + {
869 | + m = XCAR (XCAR (keys));
870 | + k = XCDR (XCAR (keys));
871 | + keys = XCDR (keys);
872 | +
873 | + if (NUMBERP (m) && modifiers == XFIXNUM (m))
874 | + if (NILP (k)
875 | + || (NUMBERP (k) && code == XFIXNUM (k)))
876 | + return TRUE;
877 | + }
878 | +
879 | + return FALSE;
880 | + }
881 | +
882 | + int
883 | + mac_pass_key_directly_to_emacs (void)
884 | + {
885 | +
886 | + if (NILP (Fmac_input_source_is_ascii_capable()))
887 | + {
888 | + if (NILP (Vmac_use_input_method_on_system)
889 | + || this_command_key_count
890 | + || cursor_in_echo_area
891 | + || !NILP (BVAR (current_buffer, read_only)))
892 | + return TRUE;
893 | + }
894 | +
895 | + return FALSE;
896 | + }
897 | +
898 | + void mac_init_input_method (void)
899 | + {
900 | + Qmac_keys_passed_to_system = intern ("mac-keys-passed-to-system");
901 | + staticpro (&Qmac_keys_passed_to_system);
902 | +
903 | + DEFVAR_LISP ("mac-use-input-method-on-system", Vmac_use_input_method_on_system,
904 | + doc: /* If it is non-nil, use input method on system. */);
905 | + Vmac_use_input_method_on_system = Qt;
906 | +
907 | + DEFVAR_LISP ("mac-default-input-source", Vmac_default_input_source,
908 | + doc: /* The default input source. */);
909 | + Vmac_default_input_source = Qnil;
910 | +
911 | + DEFVAR_LISP ("mac-default-input-ascii", Vmac_default_input_ascii,
912 | + doc: /* The default input source for ASCII. */);
913 | + Vmac_default_input_ascii = Qnil;
914 | +
915 | + defsubr (&Smac_input_source_is_ascii_capable);
916 | + defsubr (&Smac_get_input_source_list);
917 | + defsubr (&Smac_get_current_input_source);
918 | + defsubr (&Smac_toggle_input_source);
919 | + }
920 | + #endif
921 | diff -crN --exclude .git emacs_origin/src/nsfns.m emacs/src/nsfns.m
922 | *** emacs_origin/src/nsfns.m 2019-12-30 01:10:54.000000000 +0900
923 | --- emacs/src/nsfns.m 2019-12-30 07:22:13.000000000 +0900
924 | ***************
925 | *** 3166,3171 ****
926 | --- 3166,3187 ----
927 | Default is t. */);
928 | ns_use_proxy_icon = true;
929 |
930 | + DEFVAR_LISP ("ns-shift-key-mask", Vns_shift_key_mask,
931 | + doc: /* Shift key mask defined in system. */);
932 | + Vns_shift_key_mask = make_fixnum (NSShiftKeyMask);
933 | +
934 | + DEFVAR_LISP ("ns-control-key-mask", Vns_control_key_mask,
935 | + doc: /* Control key mask defined in system. */);
936 | + Vns_control_key_mask = make_fixnum (NSControlKeyMask);
937 | +
938 | + DEFVAR_LISP ("ns-alternate-key-mask", Vns_alternate_key_mask,
939 | + doc: /* Alternate key mask defined in system. */);
940 | + Vns_alternate_key_mask = make_fixnum (NSAlternateKeyMask);
941 | +
942 | + DEFVAR_LISP ("ns-command-key-mask", Vns_command_key_mask,
943 | + doc: /* Command key mask defined in system. */);
944 | + Vns_command_key_mask = make_fixnum (NSCommandKeyMask);
945 | +
946 | defsubr (&Sns_read_file_name);
947 | defsubr (&Sns_get_resource);
948 | defsubr (&Sns_set_resource);
949 | ***************
950 | *** 3212,3217 ****
951 | --- 3228,3237 ----
952 | defsubr (&Sns_popup_font_panel);
953 | defsubr (&Sns_popup_color_panel);
954 |
955 | + #ifdef NS_IMPL_COCOA
956 | + mac_init_input_method ();
957 | + #endif
958 | +
959 | defsubr (&Sx_show_tip);
960 | defsubr (&Sx_hide_tip);
961 |
962 | diff -crN --exclude .git emacs_origin/src/nsterm.h emacs/src/nsterm.h
963 | *** emacs_origin/src/nsterm.h 2019-12-30 01:10:54.000000000 +0900
964 | --- emacs/src/nsterm.h 2019-12-30 07:22:13.000000000 +0900
965 | ***************
966 | *** 754,759 ****
967 | --- 754,760 ----
968 | #define KEY_NS_NEW_FRAME ((1<<28)|(0<<16)|12)
969 | #define KEY_NS_TOGGLE_TOOLBAR ((1<<28)|(0<<16)|13)
970 | #define KEY_NS_SHOW_PREFS ((1<<28)|(0<<16)|14)
971 | + #define KEY_MAC_CHANGE_INPUT_METHOD ((1<<28)|(0<<16)|15)
972 |
973 | /* Could use list to store these, but rest of emacs has a big infrastructure
974 | for managing a table of bitmap "records". */
975 | diff -crN --exclude .git emacs_origin/src/nsterm.m emacs/src/nsterm.m
976 | *** emacs_origin/src/nsterm.m 2019-12-30 06:49:02.000000000 +0900
977 | --- emacs/src/nsterm.m 2019-12-30 07:22:13.000000000 +0900
978 | ***************
979 | *** 5321,5326 ****
980 | --- 5321,5330 ----
981 | selector: @selector (logNotification:)
982 | name: nil object: nil]; */
983 |
984 | + [[NSDistributedNotificationCenter defaultCenter] addObserver: NSApp
985 | + selector: @selector (changeInputMethod:)
986 | + name: @"AppleSelectedInputSourcesChangedNotification" object: nil];
987 | +
988 | dpyinfo = xzalloc (sizeof *dpyinfo);
989 |
990 | ns_initialize_display_info (dpyinfo);
991 | ***************
992 | *** 5637,5642 ****
993 | --- 5641,5661 ----
994 | NSLog (@"notification: '%@'", [notification name]);
995 | }
996 |
997 | + - (void)changeInputMethod: (NSNotification *)notification
998 | + {
999 | +
1000 | + struct frame *emacsframe = SELECTED_FRAME ();
1001 | +
1002 | + if (mac_store_change_input_method_event())
1003 | + {
1004 | + if (!emacs_event)
1005 | + return;
1006 | + emacs_event->kind = NS_NONKEY_EVENT;
1007 | + emacs_event->code = KEY_MAC_CHANGE_INPUT_METHOD;
1008 | + emacs_event->modifiers = 0;
1009 | + EV_TRAILER ((id)nil);
1010 | + }
1011 | + }
1012 |
1013 | - (void)sendEvent: (NSEvent *)theEvent
1014 | /* --------------------------------------------------------------------------
1015 | ***************
1016 | *** 6362,6368 ****
1017 |
1018 | /* If it was a function key or had control-like modifiers, pass
1019 | it directly to Emacs. */
1020 | ! if (fnKeysym || (emacs_event->modifiers
1021 | && (emacs_event->modifiers != shift_modifier)
1022 | && [[theEvent charactersIgnoringModifiers] length] > 0))
1023 | {
1024 | --- 6381,6388 ----
1025 |
1026 | /* If it was a function key or had control-like modifiers, pass
1027 | it directly to Emacs. */
1028 | ! if (mac_pass_key_directly_to_emacs ()
1029 | ! || fnKeysym || (emacs_event->modifiers
1030 | && (emacs_event->modifiers != shift_modifier)
1031 | && [[theEvent charactersIgnoringModifiers] length] > 0))
1032 | {
1033 | ***************
1034 | *** 6390,6398 ****
1035 | }
1036 |
1037 | emacs_event->code = code;
1038 | ! EV_TRAILER (theEvent);
1039 | ! processingCompose = NO;
1040 | ! return;
1041 | }
1042 | }
1043 |
1044 | --- 6410,6428 ----
1045 | }
1046 |
1047 | emacs_event->code = code;
1048 | ! /* The function mac_pass_key_to_system decides
1049 | ! whether it is passed directly to emacs or not. */
1050 | ! if (emacs_event->kind == NON_ASCII_KEYSTROKE_EVENT
1051 | ! || !mac_pass_key_to_system (code, flags
1052 | ! & (NSShiftKeyMask
1053 | ! | NSControlKeyMask
1054 | ! | NSAlternateKeyMask
1055 | ! | NSCommandKeyMask)))
1056 | ! {
1057 | ! EV_TRAILER (theEvent);
1058 | ! processingCompose = NO;
1059 | ! return;
1060 | ! }
1061 | }
1062 | }
1063 |
1064 | ***************
1065 | *** 6582,6594 ****
1066 | {
1067 | NSRect rect;
1068 | NSPoint pt;
1069 | ! struct window *win = XWINDOW (FRAME_SELECTED_WINDOW (emacsframe));
1070 |
1071 | NSTRACE ("[EmacsView firstRectForCharacterRange:]");
1072 |
1073 | if (NS_KEYLOG)
1074 | NSLog (@"firstRectForCharRange request");
1075 |
1076 | rect.size.width = theRange.length * FRAME_COLUMN_WIDTH (emacsframe);
1077 | rect.size.height = FRAME_LINE_HEIGHT (emacsframe);
1078 | pt.x = WINDOW_TEXT_TO_FRAME_PIXEL_X (win, win->phys_cursor.x);
1079 | --- 6612,6631 ----
1080 | {
1081 | NSRect rect;
1082 | NSPoint pt;
1083 | ! struct window *win;
1084 |
1085 | NSTRACE ("[EmacsView firstRectForCharacterRange:]");
1086 |
1087 | if (NS_KEYLOG)
1088 | NSLog (@"firstRectForCharRange request");
1089 |
1090 | + if (NILP (Vmac_in_echo_area))
1091 | + win = XWINDOW (FRAME_SELECTED_WINDOW (emacsframe));
1092 | + else if (WINDOWP (echo_area_window))
1093 | + win = XWINDOW (echo_area_window);
1094 | + else
1095 | + win = XWINDOW (FRAME_SELECTED_WINDOW (emacsframe));
1096 | +
1097 | rect.size.width = theRange.length * FRAME_COLUMN_WIDTH (emacsframe);
1098 | rect.size.height = FRAME_LINE_HEIGHT (emacsframe);
1099 | pt.x = WINDOW_TEXT_TO_FRAME_PIXEL_X (win, win->phys_cursor.x);
1100 | ***************
1101 | *** 9600,9605 ****
1102 | --- 9637,9646 ----
1103 | x_underline_at_descent_line = 0;
1104 | DEFSYM (Qx_underline_at_descent_line, "x-underline-at-descent-line");
1105 |
1106 | + DEFVAR_LISP ("mac-in-echo-area", Vmac_in_echo_area,
1107 | + doc: /* state of cursor in echo area. */);
1108 | + Vmac_in_echo_area = Qnil;
1109 | +
1110 | /* Tell Emacs about this window system. */
1111 | Fprovide (Qns, Qnil);
1112 |
1113 |
--------------------------------------------------------------------------------
/archive/revert-89d0c445.patch:
--------------------------------------------------------------------------------
1 | *** emacs_origin/src/nsterm.m 2020-02-13 13:51:26.000000000 +0900
2 | --- emacs/src/nsterm.m 2020-02-13 13:54:57.000000000 +0900
3 | ***************
4 | *** 6487,6496 ****
5 | if (!emacs_event)
6 | return;
7 |
8 | - /* First, clear any working text. */
9 | - if (workingText != nil)
10 | - [self deleteWorkingText];
11 | -
12 | /* It might be preferable to use getCharacters:range: below,
13 | cf. https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/CocoaPerformance/Articles/StringDrawing.html#//apple_ref/doc/uid/TP40001445-112378.
14 | However, we probably can't use SAFE_NALLOCA here because it might
15 | --- 6487,6492 ----
16 | ***************
17 | *** 6519,6524 ****
18 | --- 6515,6524 ----
19 | emacs_event->code = code;
20 | EV_TRAILER ((id)nil);
21 | }
22 | +
23 | + /* Last, clear any working text. */
24 | + if (workingText != nil)
25 | + [self deleteWorkingText];
26 | }
27 |
28 |
29 | *** emacs_origin/lisp/term/ns-win.el 2020-02-13 13:51:21.000000000 +0900
30 | --- emacs/lisp/term/ns-win.el 2020-02-13 13:54:07.000000000 +0900
31 | ***************
32 | *** 336,345 ****
33 | (interactive)
34 | (ns-delete-working-text)
35 | (let ((start (point)))
36 | ! (insert ns-working-text)
37 | ! (overlay-put (setq ns-working-overlay (make-overlay start (point)
38 | ! (current-buffer) nil t))
39 | ! 'face 'ns-working-text-face)))
40 |
41 | (defun ns-echo-working-text ()
42 | "Echo contents of `ns-working-text' in message display area.
43 | --- 336,344 ----
44 | (interactive)
45 | (ns-delete-working-text)
46 | (let ((start (point)))
47 | ! (overlay-put (setq ns-working-overlay (make-overlay start (point)))
48 | ! 'after-string
49 | ! (propertize ns-working-text 'face 'ns-working-text-face))))
50 |
51 | (defun ns-echo-working-text ()
52 | "Echo contents of `ns-working-text' in message display area.
53 | ***************
54 | *** 423,430 ****
55 | ;; Still alive?
56 | (overlay-buffer ns-working-overlay))
57 | (with-current-buffer (overlay-buffer ns-working-overlay)
58 | ! (delete-region (overlay-start ns-working-overlay)
59 | ! (overlay-end ns-working-overlay))
60 | (delete-overlay ns-working-overlay)))
61 | ((integerp ns-working-overlay)
62 | (let ((msg (current-message))
63 | --- 422,428 ----
64 | ;; Still alive?
65 | (overlay-buffer ns-working-overlay))
66 | (with-current-buffer (overlay-buffer ns-working-overlay)
67 | ! (overlay-put ns-working-overlay 'after-string nil)
68 | (delete-overlay ns-working-overlay)))
69 | ((integerp ns-working-overlay)
70 | (let ((msg (current-message))
71 |
--------------------------------------------------------------------------------
/build/emacs-26.3.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # LIBXML2 for Catalina
4 | MACSDK=`xcrun --show-sdk-path`
5 | export LIBXML2_CFLAGS="-I${MACSDK}/usr/include/libxml2"
6 | export LIBXML2_LIBS="-lxml2"
7 | export PATH="/usr/local/opt/texinfo/bin:$PATH"
8 |
9 | export WORKING_DIR="${HOME}/Desktop"
10 | while getopts d: opt
11 | do
12 | case ${opt} in
13 | d)
14 | WORKING_DIR=${OPTARG}
15 | ;;
16 | esac
17 | done
18 |
19 | cd ${WORKING_DIR}
20 | mkdir emacs_ns
21 | cd emacs_ns
22 | VERSION=26.3
23 | curl -LOk https://ftp.gnu.org/gnu/emacs/emacs-$VERSION.tar.gz
24 | git clone --depth 1 https://github.com/takaxp/ns-inline-patch.git
25 | tar zxvf emacs-$VERSION.tar.gz
26 | cd ./emacs-$VERSION
27 | patch -p1 < ../ns-inline-patch/emacs-25.2-inline.patch
28 | patch -p1 < ../ns-inline-patch/fix-emacs26.3-unexmacosx.c.patch
29 | if [ $? -ne 0 ]; then echo "FAILED"; exit 1; fi
30 | sleep 5
31 | ./autogen.sh
32 | ./configure CC=clang --without-x --with-ns --with-modules
33 | CORES=
34 | #CORES=1
35 | make bootstrap -j$CORES
36 | make install -j$CORES
37 | cd ./nextstep
38 | open .
39 |
--------------------------------------------------------------------------------
/build/emacs-27.2.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | VERSION=27.2
4 |
5 | # LIBXML2 for Catalina
6 | MACSDK=`xcrun --show-sdk-path`
7 | export LIBXML2_CFLAGS="-I${MACSDK}/usr/include/libxml2"
8 | export LIBXML2_LIBS="-lxml2"
9 |
10 | export WORKING_DIR="${HOME}/Desktop"
11 | while getopts d: opt
12 | do
13 | case ${opt} in
14 | d)
15 | WORKING_DIR=${OPTARG}
16 | ;;
17 | esac
18 | done
19 |
20 | cd ${WORKING_DIR}
21 |
22 | # if [ ! -f emacs-$VERSION.tar.gz ]; then
23 | # curl -LO ftp://ftp.gnu.org/gnu/emacs/emacs-$VERSION.tar.gz
24 | # fi
25 | curl -LO ftp://ftp.gnu.org/gnu/emacs/emacs-$VERSION.tar.gz
26 |
27 | rm -rf ./emacs-${VERSION}
28 | tar xvf ./emacs-$VERSION.tar.gz
29 | if [ ! -d "emacs-$VERSION" ]; then
30 | echo "missing emacs-$VERSION/"
31 | exit 1
32 | fi
33 | echo "---------------------------------"
34 |
35 | # inline-patch
36 | git clone --depth 1 https://github.com/takaxp/ns-inline-patch.git
37 |
38 | cd emacs-${VERSION}
39 | patch -p1 < ../ns-inline-patch/emacs-27.1-inline.patch
40 | if [ $? -ne 0 ]; then echo "FAILED"; exit 1; fi
41 | # patch -p1 < ../ns-inline-patch/revert-89d0c445.patch
42 | # if [ $? -ne 0 ]; then echo "FAILED"; exit 1; fi
43 | # patch -p1 < ../$PATCH/ns-inline-patch/fix-working-text.patch
44 | # if [ $? -ne 0 ]; then echo "FAILED"; exit 1; fi
45 |
46 | sleep 5
47 | ./autogen.sh
48 | ./configure CC=clang --without-x --with-ns --with-modules
49 | CORES=
50 | #CORES=4
51 | make bootstrap -j$CORES
52 | make install -j$CORES
53 | cd ./nextstep
54 | open .
55 |
--------------------------------------------------------------------------------
/build/emacs-28.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | VERSION=28.2
4 |
5 | # LIBXML2 for Catalina
6 | MACSDK=`xcrun --show-sdk-path`
7 | export LIBXML2_CFLAGS="-I${MACSDK}/usr/include/libxml2"
8 | export LIBXML2_LIBS="-lxml2"
9 |
10 | export WORKING_DIR="${HOME}/Desktop"
11 | while getopts d: opt
12 | do
13 | case ${opt} in
14 | d)
15 | WORKING_DIR=${OPTARG}
16 | ;;
17 | esac
18 | done
19 |
20 | cd ${WORKING_DIR}
21 |
22 | # if [ ! -f emacs-$VERSION.tar.gz ]; then
23 | # curl -LO ftp://ftp.gnu.org/gnu/emacs/emacs-$VERSION.tar.gz
24 | # fi
25 | curl -LO ftp://ftp.gnu.org/gnu/emacs/emacs-$VERSION.tar.gz
26 |
27 | rm -rf ./emacs-${VERSION}
28 | tar xvf ./emacs-$VERSION.tar.gz
29 | if [ ! -d "emacs-$VERSION" ]; then
30 | echo "missing emacs-$VERSION/"
31 | exit 1
32 | fi
33 | echo "---------------------------------"
34 |
35 | # inline-patch
36 | git clone --depth 1 https://github.com/takaxp/ns-inline-patch.git
37 |
38 | cd emacs-${VERSION}
39 | patch -p1 < ../ns-inline-patch/emacs-28.1-inline.patch
40 | if [ $? -ne 0 ]; then echo "FAILED"; exit 1; fi
41 | # patch -p1 < ../ns-inline-patch/revert-89d0c445.patch
42 | # if [ $? -ne 0 ]; then echo "FAILED"; exit 1; fi
43 | # patch -p1 < ../$PATCH/ns-inline-patch/fix-working-text.patch
44 | # if [ $? -ne 0 ]; then echo "FAILED"; exit 1; fi
45 |
46 | sleep 5
47 | ./autogen.sh
48 | ./configure CC=clang --without-x --with-ns --with-modules
49 | CORES=
50 | #CORES=4
51 | make bootstrap -j$CORES
52 | make install -j$CORES
53 | cd ./nextstep
54 | open .
55 |
--------------------------------------------------------------------------------
/build/emacs-29.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | VERSION=29.4
4 |
5 | # LIBXML2 for Catalina
6 | MACSDK=`xcrun --show-sdk-path`
7 | export LIBXML2_CFLAGS="-I${MACSDK}/usr/include/libxml2"
8 | export LIBXML2_LIBS="-lxml2"
9 |
10 | # For Apple Silicon, Emacs version 27.2 or later supports to build.
11 | CPUARC=`uname -m`
12 | if [ "${CPUARC}" = "x86_64" ]; then
13 | # Catalina or later
14 | export MACOSX_DEPLOYMENT_TARGET=10.15
15 | else
16 | # Big Sur or later
17 | export MACOSX_DEPLOYMENT_TARGET=11.0
18 | fi
19 |
20 | # Native compilation
21 | BREW=`which brew`
22 | BREW_PREFIX=`$BREW --prefix`
23 | BREW_LIBGCCJIT_PREFIX=`$BREW --prefix --installed libgccjit 2>/dev/null`
24 | export CFLAGS="$CFLAGS -I${BREW_LIBGCCJIT_PREFIX}/include"
25 | export LIBRARY_PATH=${BREW_PREFIX}/lib/gcc/current
26 |
27 | WORKING_DIR="${HOME}/Desktop"
28 | CORES=4
29 | NATIVE="no"
30 | PATCH="inline"
31 | while getopts d:j:ngp: opt
32 | do
33 | case ${opt} in
34 | n)
35 | NATIVE="aot"
36 | ;;
37 | j)
38 | CORES=${OPTARG}
39 | ;;
40 | d)
41 | WORKING_DIR=${OPTARG}
42 | ;;
43 | p)
44 | PATCH=${OPTARG}
45 | ;;
46 | esac
47 | done
48 |
49 | cd ${WORKING_DIR}
50 |
51 | echo "---------------------------------"
52 | echo "WorkingDir: ${WORKING_DIR}"
53 | echo "NativeComp: ${NATIVE}"
54 | echo "Cores: ${CORES}"
55 | echo "PATCH: ${PATCH}"
56 |
57 | curl -LO ftp://ftp.gnu.org/gnu/emacs/emacs-$VERSION.tar.gz
58 | tar xvf ./emacs-$VERSION.tar.gz
59 | if [ ! -d "emacs-$VERSION" ]; then
60 | echo "missing emacs-$VERSION/"
61 | exit 1
62 | fi
63 |
64 | echo "---------------------------------"
65 |
66 | if [ "${PATCH}" = "inline" ]; then
67 | # inline-patch
68 | git clone --depth 1 https://github.com/takaxp/ns-inline-patch.git
69 |
70 | cd emacs-${VERSION}
71 | patch -p1 < ../ns-inline-patch/emacs-29.1-inline.patch
72 | if [ $? -ne 0 ]; then echo "FAILED"; exit 1; fi
73 |
74 | elif [ "${PATCH}" = "pure" ]; then
75 | # build without inline-patch
76 | cd emacs-${VERSION}
77 |
78 | else
79 | echo "PATCH is missing."
80 | exit 1
81 | fi
82 |
83 | sleep 5
84 | ./autogen.sh
85 | ./configure --without-x --with-ns --with-modules --with-jpeg=no --with-tiff=no --with-gif=no --with-png=no --with-lcms2=no --with-webp=no --with-rsvg=no --with-tree-sitter=no --with-native-compilation=${NATIVE}
86 | make bootstrap -j$CORES
87 | make install -j$CORES
88 | cd ./nextstep
89 | open .
90 |
--------------------------------------------------------------------------------
/build/emacs-30.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | VERSION=30.1
4 |
5 | # LIBXML2 for Catalina
6 | MACSDK=`xcrun --show-sdk-path`
7 | export LIBXML2_CFLAGS="-I${MACSDK}/usr/include/libxml2"
8 | export LIBXML2_LIBS="-lxml2"
9 |
10 | # For Apple Silicon, Emacs version 27.2 or later supports to build.
11 | CPUARC=`uname -m`
12 | if [ "${CPUARC}" = "x86_64" ]; then
13 | # Catalina or later
14 | export MACOSX_DEPLOYMENT_TARGET=10.15
15 | else
16 | # Big Sur or later
17 | export MACOSX_DEPLOYMENT_TARGET=11.0
18 | fi
19 |
20 | # Native compilation
21 | BREW=`which brew`
22 | BREW_PREFIX=`$BREW --prefix`
23 | BREW_LIBGCCJIT_PREFIX=`$BREW --prefix --installed libgccjit 2>/dev/null`
24 | export CFLAGS="$CFLAGS -I${BREW_LIBGCCJIT_PREFIX}/include"
25 | export LIBRARY_PATH=${BREW_PREFIX}/lib/gcc/current
26 |
27 | WORKING_DIR="${HOME}/Desktop"
28 | CORES=4
29 | NATIVE="no"
30 | PATCH="inline"
31 | while getopts d:j:ngp: opt
32 | do
33 | case ${opt} in
34 | n)
35 | NATIVE="aot"
36 | ;;
37 | j)
38 | CORES=${OPTARG}
39 | ;;
40 | d)
41 | WORKING_DIR=${OPTARG}
42 | ;;
43 | p)
44 | PATCH=${OPTARG}
45 | ;;
46 | esac
47 | done
48 |
49 | cd ${WORKING_DIR}
50 |
51 | echo "---------------------------------"
52 | echo "WorkingDir: ${WORKING_DIR}"
53 | echo "NativeComp: ${NATIVE}"
54 | echo "Cores: ${CORES}"
55 | echo "PATCH: ${PATCH}"
56 |
57 | # if [ ! -f emacs-$VERSION.tar.gz ]; then
58 | # curl -LO ftp://ftp.gnu.org/gnu/emacs/emacs-$VERSION.tar.gz
59 | # fi
60 | curl -LO ftp://ftp.gnu.org/gnu/emacs/emacs-$VERSION.tar.gz
61 |
62 | rm -rf ./emacs-${VERSION}
63 | tar xvf ./emacs-$VERSION.tar.gz
64 | if [ ! -d "emacs-$VERSION" ]; then
65 | echo "missing emacs-$VERSION/"
66 | exit 1
67 | fi
68 | echo "---------------------------------"
69 |
70 | if [ "${PATCH}" = "inline" ]; then
71 | # inline-patch
72 | git clone --depth 1 https://github.com/takaxp/ns-inline-patch.git
73 |
74 | cd emacs-${VERSION}
75 | patch -p1 < ../ns-inline-patch/emacs-29.1-inline.patch # still work for emacs-30.x
76 | if [ $? -ne 0 ]; then echo "FAILED"; exit 1; fi
77 |
78 | elif [ "${PATCH}" = "pure" ]; then
79 | # build without inline-patch
80 | cd emacs-${VERSION}
81 |
82 | else
83 | echo "PATCH is missing."
84 | exit 1
85 | fi
86 |
87 | sleep 5
88 | ./autogen.sh
89 | ./configure --without-x --with-ns --with-modules --with-jpeg=no --with-tiff=no --with-gif=no --with-png=no --with-lcms2=no --with-webp=no --with-rsvg=no --with-tree-sitter=no --with-native-compilation=${NATIVE}
90 | make bootstrap -j$CORES
91 | make install -j$CORES
92 | cd ./nextstep
93 | open .
94 |
--------------------------------------------------------------------------------
/build/emacs-head.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # LIBXML2 for Catalina
4 | MACSDK=`xcrun --show-sdk-path`
5 | export LIBXML2_CFLAGS="-I${MACSDK}/usr/include/libxml2"
6 | export LIBXML2_LIBS="-lxml2"
7 |
8 | # For Apple Silicon, Emacs version 27.2 or later supports to build.
9 | CPUARC=`uname -m`
10 | if [ "${CPUARC}" = "x86_64" ]; then
11 | # Catalina or later
12 | export MACOSX_DEPLOYMENT_TARGET=10.15
13 | else
14 | # Big Sur or later
15 | export MACOSX_DEPLOYMENT_TARGET=11.0
16 | fi
17 |
18 | # Native compilation
19 | BREW=`which brew`
20 | BREW_PREFIX=`$BREW --prefix`
21 | BREW_LIBGCCJIT_PREFIX=`$BREW --prefix --installed libgccjit 2>/dev/null`
22 | export CFLAGS="$CFLAGS -I${BREW_LIBGCCJIT_PREFIX}/include"
23 | export LIBRARY_PATH=${BREW_PREFIX}/lib/gcc/current
24 |
25 | WORKING_DIR="${HOME}/Desktop"
26 | CORES=4
27 | NATIVE="no"
28 | BRANCH=master
29 | while getopts d:j:ngb: opt
30 | do
31 | case ${opt} in
32 | n)
33 | NATIVE="aot"
34 | ;;
35 | j)
36 | CORES=${OPTARG}
37 | ;;
38 | d)
39 | WORKING_DIR=${OPTARG}
40 | ;;
41 | g)
42 | SV_HOST=true
43 | ;;
44 | b)
45 | BRANCH=${OPTARG}
46 | esac
47 | done
48 |
49 | cd ${WORKING_DIR}
50 |
51 | echo "---------------------------------"
52 | echo "WorkingDir: ${WORKING_DIR}"
53 | echo "NativeComp: ${NATIVE}"
54 | echo "Cores: ${CORES}"
55 | echo "Target branch: ${BRANCH}"
56 | rm -rf ./emacs
57 | SHALLOW="--depth 1"
58 | if [ ! ${BRANCH} = "master" ]; then
59 | SHALLOW="--depth 1 --no-single-branch -b ${BRANCH}"
60 | fi
61 |
62 | if [ $SV_HOST ]; then
63 | echo "Source: git://git.sv.gnu.org/emacs.git"
64 | git clone ${SHALLOW} git://git.sv.gnu.org/emacs.git
65 | else
66 | echo "Source: https://github.com/emacs-mirror/emacs.git"
67 | git clone ${SHALLOW} https://github.com/emacs-mirror/emacs.git
68 | fi
69 | echo "---------------------------------"
70 |
71 | # inline-patch
72 | git clone --depth 1 https://github.com/takaxp/ns-inline-patch.git
73 |
74 | cd emacs
75 | if [ "${BRANCH}" = "emacs-29" -o "${BRANCH}" = "emacs-30" ]; then
76 | patch -p1 < ../ns-inline-patch/emacs-29.1-inline.patch
77 | elif [ "${BRANCH}" = "emacs-28" ]; then
78 | patch -p1 < ../ns-inline-patch/emacs-28.1-inline.patch
79 | elif [ "${BRANCH}" = "emacs-27" ]; then
80 | patch -p1 < ../ns-inline-patch/emacs-27.1-inline.patch
81 | else
82 | patch -p1 < ../ns-inline-patch/emacs-head-inline.patch
83 | fi
84 |
85 | if [ $? -ne 0 ]; then echo "FAILED"; exit 1; fi
86 |
87 | sleep 5
88 | ./autogen.sh
89 | ./configure --without-x --with-ns --with-modules --with-jpeg=no --with-tiff=no --with-gif=no --with-png=no --with-lcms2=no --with-webp=no --with-rsvg=no --with-tree-sitter=no --with-native-compilation=${NATIVE}
90 | make bootstrap -j$CORES
91 | make install -j$CORES
92 | cd ./nextstep
93 | open .
94 |
--------------------------------------------------------------------------------
/build/rudix/README.txt:
--------------------------------------------------------------------------------
1 | * For rudix
2 | - Create a standalone distributable Emacs.app that uses local libraries from Rudix or brew
3 | - Tested with libraries from my Rudix fork https://github.com/paaguti/rudix and OSX 10.13.6
4 |
--------------------------------------------------------------------------------
/build/rudix/emacs-27.1.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # LIBXML2 for Catalina
4 | MACSDK=`xcrun --show-sdk-path`
5 | export LIBXML2_CFLAGS="-I${MACSDK}/usr/include/libxml2"
6 | export LIBXML2_LIBS="-lxml2"
7 |
8 | #
9 | # For BREW, change to
10 | # LOCAL_BASE=/opt/local
11 | LOCAL_BASE=/usr/local
12 |
13 | cd ~/Desktop
14 | git clone git://git.sv.gnu.org/emacs.git
15 | git clone --depth 1 https://github.com/takaxp/ns-inline-patch.git
16 |
17 | cd emacs
18 | git checkout --track origin/emacs-27
19 | patch -p1 < ../ns-inline-patch/emacs-27.1-inline.patch
20 |
21 | sleep 5
22 | ./autogen.sh
23 | #./configure CC=clang --without-x --with-ns --with-modules
24 | ./configure --without-x --with-ns --with-modules --enable-silent-rules \
25 | PKG_CONFIG_PATH=${LOCAL_BASE}/lib/pkgconfig \
26 | LDFLAGS="-L${LOCAL_BASE}/lib" CPPFLAGS="-I${LOCAL_BASE}/include" \
27 | CC=clang OBJC=clang CFLAGS="-g -O2"
28 |
29 | CORES=
30 | #CORES=4
31 | make bootstrap -j$CORES
32 | make install -j$CORES
33 |
34 | #
35 | # Inspired by
36 | # https://www.reddit.com/r/emacs/comments/bclyyc/building_emacs_from_source_on_macos/
37 | #
38 | mkdir nextstep/Emacs.app/Contents/Frameworks
39 | /usr/bin/python -m macholib standalone nextstep/Emacs.app
40 | #
41 | #
42 | #
43 | cd ./nextstep
44 | open .
45 |
--------------------------------------------------------------------------------
/build/setup.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | function setup_homebrew () {
4 | # /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
5 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
6 |
7 | if [ $(uname -m) = "arm64" ]; then
8 | (echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> ${HOME}/.zprofile
9 | eval "$(/opt/homebrew/bin/brew shellenv)"
10 | else
11 | (echo 'eval "$(/usr/local/bin/brew shellenv)"') >> ${HOME}/.zprofile
12 | eval "$(/usr/local/bin/brew shellenv)"
13 | fi
14 | echo "--- Installed."
15 | echo "PREFIX: $HOMEBREW_PREFIX"
16 | echo "CELLAR: $HOMEBREW_CELLAR"
17 | echo "REPOSITORY: $HOMEBREW_REPOSITORY"
18 | echo "PATH: $PATH"
19 | echo "MANPATH: $MANPATH"
20 | echo "INFOPATH: $INFOPATH"
21 | }
22 |
23 | function install_deps () {
24 | brew install autoconf automake pkg-config gnutls texinfo jansson
25 | # Required to support NativeComp
26 | brew install gcc libgccjit
27 |
28 | if [ $(uname -m) = "x86_64" ]; then
29 | echo "--- Hot fix for libgccjit 14.1 on x86_64"
30 | cd /usr/local/opt/libgccjit/lib/gcc/current
31 | ln -s /usr/local/lib/gcc/current/libgcc_s.1.1.dylib .
32 | fi
33 | }
34 |
35 | function install_tool () {
36 | brew install xmlstarlet
37 | }
38 |
39 | function install_xcode () {
40 | xcode-select --install
41 | }
42 |
43 | function remove_homebrew () {
44 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"
45 | }
46 |
47 | setup_homebrew
48 | install_tool
49 | install_deps
50 | # install_xcode
51 | # remove_homebrew
52 |
53 | echo "----------------"
54 | echo "OK, let's start to build GNU Emacs with inline-patch."
55 | echo "Usage:"
56 | echo " sh emacs-****.sh"
57 | echo "Or you can install Emacs by runing pkg file located"
58 | echo " in https://github.com/takaxp/ns-inline-patch."
59 | echo "----------------"
60 |
--------------------------------------------------------------------------------
/fix-emacs25.3-unexmacosx.c.patch:
--------------------------------------------------------------------------------
1 | diff --git a/src/unexmacosx.c b/src/unexmacosx.c
2 | index 53a30e3627..59cbe3c18b 100644
3 | --- a/src/unexmacosx.c
4 | +++ b/src/unexmacosx.c
5 | @@ -1,5 +1,5 @@
6 | /* Dump Emacs in Mach-O format for use on macOS.
7 | - Copyright (C) 2001-2017 Free Software Foundation, Inc.
8 | + Copyright (C) 2001-2020 Free Software Foundation, Inc.
9 |
10 | This file is part of GNU Emacs.
11 |
12 | @@ -97,9 +97,9 @@ along with GNU Emacs. If not, see . */
13 |
14 | #include "unexec.h"
15 | #include "lisp.h"
16 | +#include "sysstdio.h"
17 |
18 | #include
19 | -#include
20 | #include
21 | #include
22 | #include
23 | @@ -303,9 +303,9 @@ unexec_error (const char *format, ...)
24 | va_list ap;
25 |
26 | va_start (ap, format);
27 | - fprintf (stderr, "unexec: ");
28 | + fputs ("unexec: ", stderr);
29 | vfprintf (stderr, format, ap);
30 | - fprintf (stderr, "\n");
31 | + putc ('\n', stderr);
32 | va_end (ap);
33 | exit (1);
34 | }
35 | @@ -447,7 +447,7 @@ unexec_regions_recorder (task_t task, void *rr, unsigned type,
36 |
37 | while (num && num_unexec_regions < MAX_UNEXEC_REGIONS)
38 | {
39 | - /* Subtract the size of trailing null bytes from filesize. It
40 | + /* Subtract the size of trailing NUL bytes from filesize. It
41 | can be smaller than vmsize in segment commands. In such a
42 | case, trailing bytes are initialized with zeros. */
43 | for (p = ranges->address + ranges->size; p > ranges->address; p--)
44 | @@ -503,22 +503,34 @@ unexec_regions_sort_compare (const void *a, const void *b)
45 | static void
46 | unexec_regions_merge (void)
47 | {
48 | - int i, n;
49 | - unexec_region_info r;
50 | - vm_size_t padsize;
51 | -
52 | qsort (unexec_regions, num_unexec_regions, sizeof (unexec_regions[0]),
53 | &unexec_regions_sort_compare);
54 | - n = 0;
55 | - r = unexec_regions[0];
56 | - padsize = r.range.address & (pagesize - 1);
57 | - if (padsize)
58 | +
59 | + /* Align each region start address to a page boundary. */
60 | + for (unexec_region_info *cur = unexec_regions;
61 | + cur < unexec_regions + num_unexec_regions; cur++)
62 | {
63 | - r.range.address -= padsize;
64 | - r.range.size += padsize;
65 | - r.filesize += padsize;
66 | + vm_size_t padsize = cur->range.address & (pagesize - 1);
67 | + if (padsize)
68 | + {
69 | + cur->range.address -= padsize;
70 | + cur->range.size += padsize;
71 | + cur->filesize += padsize;
72 | +
73 | + unexec_region_info *prev = cur == unexec_regions ? NULL : cur - 1;
74 | + if (prev
75 | + && prev->range.address + prev->range.size > cur->range.address)
76 | + {
77 | + prev->range.size = cur->range.address - prev->range.address;
78 | + if (prev->filesize > prev->range.size)
79 | + prev->filesize = prev->range.size;
80 | + }
81 | + }
82 | }
83 | - for (i = 1; i < num_unexec_regions; i++)
84 | +
85 | + int n = 0;
86 | + unexec_region_info r = unexec_regions[0];
87 | + for (int i = 1; i < num_unexec_regions; i++)
88 | {
89 | if (r.range.address + r.range.size == unexec_regions[i].range.address
90 | && r.range.size - r.filesize < 2 * pagesize)
91 | @@ -530,17 +542,6 @@ unexec_regions_merge (void)
92 | {
93 | unexec_regions[n++] = r;
94 | r = unexec_regions[i];
95 | - padsize = r.range.address & (pagesize - 1);
96 | - if (padsize)
97 | - {
98 | - if ((unexec_regions[n-1].range.address
99 | - + unexec_regions[n-1].range.size) == r.range.address)
100 | - unexec_regions[n-1].range.size -= padsize;
101 | -
102 | - r.range.address -= padsize;
103 | - r.range.size += padsize;
104 | - r.filesize += padsize;
105 | - }
106 | }
107 | }
108 | unexec_regions[n++] = r;
109 |
--------------------------------------------------------------------------------
/fix-emacs26.3-unexmacosx.c.patch:
--------------------------------------------------------------------------------
1 | diff --git a/src/unexmacosx.c b/src/unexmacosx.c
2 | index 53a30e3627..59cbe3c18b 100644
3 | --- a/src/unexmacosx.c
4 | +++ b/src/unexmacosx.c
5 | @@ -1,5 +1,5 @@
6 | /* Dump Emacs in Mach-O format for use on macOS.
7 | - Copyright (C) 2001-2019 Free Software Foundation, Inc.
8 | + Copyright (C) 2001-2020 Free Software Foundation, Inc.
9 |
10 | This file is part of GNU Emacs.
11 |
12 | @@ -97,9 +97,9 @@ along with GNU Emacs. If not, see . */
13 |
14 | #include "unexec.h"
15 | #include "lisp.h"
16 | +#include "sysstdio.h"
17 |
18 | #include
19 | -#include
20 | #include
21 | #include
22 | #include
23 | @@ -303,9 +303,9 @@ unexec_error (const char *format, ...)
24 | va_list ap;
25 |
26 | va_start (ap, format);
27 | - fprintf (stderr, "unexec: ");
28 | + fputs ("unexec: ", stderr);
29 | vfprintf (stderr, format, ap);
30 | - fprintf (stderr, "\n");
31 | + putc ('\n', stderr);
32 | va_end (ap);
33 | exit (1);
34 | }
35 | @@ -447,7 +447,7 @@ unexec_regions_recorder (task_t task, void *rr, unsigned type,
36 |
37 | while (num && num_unexec_regions < MAX_UNEXEC_REGIONS)
38 | {
39 | - /* Subtract the size of trailing null bytes from filesize. It
40 | + /* Subtract the size of trailing NUL bytes from filesize. It
41 | can be smaller than vmsize in segment commands. In such a
42 | case, trailing bytes are initialized with zeros. */
43 | for (p = ranges->address + ranges->size; p > ranges->address; p--)
44 | @@ -503,22 +503,34 @@ unexec_regions_sort_compare (const void *a, const void *b)
45 | static void
46 | unexec_regions_merge (void)
47 | {
48 | - int i, n;
49 | - unexec_region_info r;
50 | - vm_size_t padsize;
51 | -
52 | qsort (unexec_regions, num_unexec_regions, sizeof (unexec_regions[0]),
53 | &unexec_regions_sort_compare);
54 | - n = 0;
55 | - r = unexec_regions[0];
56 | - padsize = r.range.address & (pagesize - 1);
57 | - if (padsize)
58 | +
59 | + /* Align each region start address to a page boundary. */
60 | + for (unexec_region_info *cur = unexec_regions;
61 | + cur < unexec_regions + num_unexec_regions; cur++)
62 | {
63 | - r.range.address -= padsize;
64 | - r.range.size += padsize;
65 | - r.filesize += padsize;
66 | + vm_size_t padsize = cur->range.address & (pagesize - 1);
67 | + if (padsize)
68 | + {
69 | + cur->range.address -= padsize;
70 | + cur->range.size += padsize;
71 | + cur->filesize += padsize;
72 | +
73 | + unexec_region_info *prev = cur == unexec_regions ? NULL : cur - 1;
74 | + if (prev
75 | + && prev->range.address + prev->range.size > cur->range.address)
76 | + {
77 | + prev->range.size = cur->range.address - prev->range.address;
78 | + if (prev->filesize > prev->range.size)
79 | + prev->filesize = prev->range.size;
80 | + }
81 | + }
82 | }
83 | - for (i = 1; i < num_unexec_regions; i++)
84 | +
85 | + int n = 0;
86 | + unexec_region_info r = unexec_regions[0];
87 | + for (int i = 1; i < num_unexec_regions; i++)
88 | {
89 | if (r.range.address + r.range.size == unexec_regions[i].range.address
90 | && r.range.size - r.filesize < 2 * pagesize)
91 | @@ -530,17 +542,6 @@ unexec_regions_merge (void)
92 | {
93 | unexec_regions[n++] = r;
94 | r = unexec_regions[i];
95 | - padsize = r.range.address & (pagesize - 1);
96 | - if (padsize)
97 | - {
98 | - if ((unexec_regions[n-1].range.address
99 | - + unexec_regions[n-1].range.size) == r.range.address)
100 | - unexec_regions[n-1].range.size -= padsize;
101 | -
102 | - r.range.address -= padsize;
103 | - r.range.size += padsize;
104 | - r.filesize += padsize;
105 | - }
106 | }
107 | }
108 | unexec_regions[n++] = r;
109 |
--------------------------------------------------------------------------------
/private/ns-26.2-private.patch:
--------------------------------------------------------------------------------
1 | diff -crN emacs-26.0.91/src/nsfns.m emacs-26.0.91_patch/src/nsfns.m
2 | *** emacs-26.0.91/src/nsfns.m 2018-03-20 18:41:09.000000000 +0900
3 | --- emacs-26.0.91_patch/src/nsfns.m 2018-03-20 18:42:52.000000000 +0900
4 | ***************
5 | *** 1231,1239 ****
6 |
7 | x_default_parameter (f, parms, Qborder_width, make_number (0),
8 | "borderwidth", "BorderWidth", RES_TYPE_NUMBER);
9 | ! x_default_parameter (f, parms, Qinternal_border_width, make_number (2),
10 | ! "internalBorderWidth", "InternalBorderWidth",
11 | ! RES_TYPE_NUMBER);
12 | x_default_parameter (f, parms, Qright_divider_width, make_number (0),
13 | NULL, NULL, RES_TYPE_NUMBER);
14 | x_default_parameter (f, parms, Qbottom_divider_width, make_number (0),
15 | --- 1231,1239 ----
16 |
17 | x_default_parameter (f, parms, Qborder_width, make_number (0),
18 | "borderwidth", "BorderWidth", RES_TYPE_NUMBER);
19 | ! x_default_parameter (f, parms, Qinternal_border_width, make_number (0),
20 | ! "internalBorderWidth", "InternalBorderWidth",
21 | ! RES_TYPE_NUMBER);
22 | x_default_parameter (f, parms, Qright_divider_width, make_number (0),
23 | NULL, NULL, RES_TYPE_NUMBER);
24 | x_default_parameter (f, parms, Qbottom_divider_width, make_number (0),
25 | ***************
26 | *** 1247,1252 ****
27 | --- 1247,1253 ----
28 | #else
29 | = Qright;
30 | #endif
31 | + spos = Qnil;
32 | x_default_parameter (f, parms, Qvertical_scroll_bars, spos,
33 | "verticalScrollBars", "VerticalScrollBars",
34 | RES_TYPE_SYMBOL);
35 | diff -crN emacs-26.0.91/src/nsterm.m emacs-26.0.91_patch/src/nsterm.m
36 | *** emacs-26.0.91/src/nsterm.m 2018-03-20 18:41:09.000000000 +0900
37 | --- emacs-26.0.91_patch/src/nsterm.m 2018-03-20 18:43:13.000000000 +0900
38 | ***************
39 | *** 7073,7082 ****
40 | *pos = '\0';
41 | old_title = t;
42 | }
43 | ! size_title = xmalloc (strlen (old_title) + 40);
44 | ! esprintf (size_title, "%s — (%d x %d)", old_title, cols, rows);
45 | ! [window setTitle: [NSString stringWithUTF8String: size_title]];
46 | ! xfree (size_title);
47 | }
48 | }
49 | #endif /* NS_IMPL_COCOA */
50 | --- 7073,7082 ----
51 | *pos = '\0';
52 | old_title = t;
53 | }
54 | ! // size_title = xmalloc (strlen (old_title) + 40);
55 | ! // esprintf (size_title, "%s — (%d x %d)", old_title, cols, rows);
56 | ! // [window setTitle: [NSString stringWithUTF8String: size_title]];
57 | ! // xfree (size_title);
58 | }
59 | }
60 | #endif /* NS_IMPL_COCOA */
61 |
--------------------------------------------------------------------------------
/private/ns-27.0-private.patch:
--------------------------------------------------------------------------------
1 | diff --exclude .git -crN emacs-27/src/nsfns.m emacs/src/nsfns.m
2 | *** emacs-27/src/nsfns.m 2019-02-09 13:11:12.000000000 +0900
3 | --- emacs/src/nsfns.m 2019-02-09 13:18:14.000000000 +0900
4 | ***************
5 | *** 1185,1191 ****
6 |
7 | gui_default_parameter (f, parms, Qborder_width, make_fixnum (0),
8 | "borderwidth", "BorderWidth", RES_TYPE_NUMBER);
9 | ! gui_default_parameter (f, parms, Qinternal_border_width, make_fixnum (2),
10 | "internalBorderWidth", "InternalBorderWidth",
11 | RES_TYPE_NUMBER);
12 | gui_default_parameter (f, parms, Qright_divider_width, make_fixnum (0),
13 | --- 1185,1191 ----
14 |
15 | gui_default_parameter (f, parms, Qborder_width, make_fixnum (0),
16 | "borderwidth", "BorderWidth", RES_TYPE_NUMBER);
17 | ! gui_default_parameter (f, parms, Qinternal_border_width, make_fixnum (0),
18 | "internalBorderWidth", "InternalBorderWidth",
19 | RES_TYPE_NUMBER);
20 | gui_default_parameter (f, parms, Qright_divider_width, make_fixnum (0),
21 | ***************
22 | *** 1201,1206 ****
23 | --- 1201,1207 ----
24 | #else
25 | = Qright;
26 | #endif
27 | + spos = Qnil;
28 | gui_default_parameter (f, parms, Qvertical_scroll_bars, spos,
29 | "verticalScrollBars", "VerticalScrollBars",
30 | RES_TYPE_SYMBOL);
31 | diff --exclude .git -crN emacs-27/src/nsterm.m emacs/src/nsterm.m
32 | *** emacs-27/src/nsterm.m 2019-02-09 13:11:12.000000000 +0900
33 | --- emacs/src/nsterm.m 2019-02-09 13:12:06.000000000 +0900
34 | ***************
35 | *** 7154,7163 ****
36 | *pos = '\0';
37 | old_title = t;
38 | }
39 | ! size_title = xmalloc (strlen (old_title) + 40);
40 | ! esprintf (size_title, "%s — (%d x %d)", old_title, cols, rows);
41 | ! [window setTitle: [NSString stringWithUTF8String: size_title]];
42 | ! xfree (size_title);
43 | }
44 | }
45 | #endif /* NS_IMPL_COCOA */
46 | --- 7154,7163 ----
47 | *pos = '\0';
48 | old_title = t;
49 | }
50 | ! // size_title = xmalloc (strlen (old_title) + 40);
51 | ! // esprintf (size_title, "%s — (%d x %d)", old_title, cols, rows);
52 | ! // [window setTitle: [NSString stringWithUTF8String: size_title]];
53 | ! // xfree (size_title);
54 | }
55 | }
56 | #endif /* NS_IMPL_COCOA */
57 |
--------------------------------------------------------------------------------
/private/ns-head-private.patch:
--------------------------------------------------------------------------------
1 | diff --exclude .git -crN emacs-27/src/nsfns.m emacs/src/nsfns.m
2 | *** emacs-27/src/nsfns.m 2019-02-09 13:11:12.000000000 +0900
3 | --- emacs/src/nsfns.m 2019-02-09 13:18:14.000000000 +0900
4 | ***************
5 | *** 1185,1191 ****
6 |
7 | gui_default_parameter (f, parms, Qborder_width, make_fixnum (0),
8 | "borderwidth", "BorderWidth", RES_TYPE_NUMBER);
9 | ! gui_default_parameter (f, parms, Qinternal_border_width, make_fixnum (2),
10 | "internalBorderWidth", "InternalBorderWidth",
11 | RES_TYPE_NUMBER);
12 | gui_default_parameter (f, parms, Qright_divider_width, make_fixnum (0),
13 | --- 1185,1191 ----
14 |
15 | gui_default_parameter (f, parms, Qborder_width, make_fixnum (0),
16 | "borderwidth", "BorderWidth", RES_TYPE_NUMBER);
17 | ! gui_default_parameter (f, parms, Qinternal_border_width, make_fixnum (0),
18 | "internalBorderWidth", "InternalBorderWidth",
19 | RES_TYPE_NUMBER);
20 | gui_default_parameter (f, parms, Qright_divider_width, make_fixnum (0),
21 | ***************
22 | *** 1201,1206 ****
23 | --- 1201,1207 ----
24 | #else
25 | = Qright;
26 | #endif
27 | + spos = Qnil;
28 | gui_default_parameter (f, parms, Qvertical_scroll_bars, spos,
29 | "verticalScrollBars", "VerticalScrollBars",
30 | RES_TYPE_SYMBOL);
31 | *** emacs_origin/src/nsterm.m 2020-02-13 18:43:41.000000000 +0900
32 | --- emacs/src/nsterm.m 2020-02-13 18:45:38.000000000 +0900
33 | ***************
34 | *** 7241,7251 ****
35 | *pos = '\0';
36 | old_title = t;
37 | }
38 | ! size_title = xmalloc (strlen (old_title) + 40);
39 | ! esprintf (size_title, "%s — (%d × %d)", old_title, cols, rows);
40 | ! [window setTitle: [NSString stringWithUTF8String: size_title]];
41 | ! [window display];
42 | ! xfree (size_title);
43 | }
44 | }
45 | #endif /* NS_IMPL_COCOA */
46 | --- 7241,7251 ----
47 | *pos = '\0';
48 | old_title = t;
49 | }
50 | ! // size_title = xmalloc (strlen (old_title) + 40);
51 | ! // esprintf (size_title, "%s — (%d × %d)", old_title, cols, rows);
52 | ! // [window setTitle: [NSString stringWithUTF8String: size_title]];
53 | ! // [window display];
54 | ! // xfree (size_title);
55 | }
56 | }
57 | #endif /* NS_IMPL_COCOA */
58 |
--------------------------------------------------------------------------------
/release/notarize-emacs.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | SOURCE_DIR="${HOME}/devel/emacs-head"
4 | WORKING_DIR="${HOME}/Desktop"
5 | PROFILE_NAME="emacs-build"
6 | LIB_GCCJIT="libgccjit.0.dylib"
7 |
8 | while getopts v:p:b:k:d:s:a: opt
9 | do
10 | case ${opt} in
11 | s)
12 | SOURCE_DIR=${OPTARG}
13 | ;;
14 | d)
15 | WORKING_DIR=${OPTARG}
16 | ;;
17 | p)
18 | PATCH=${OPTARG}
19 | ;;
20 | a)
21 | PROFILE_NAME=${OPTARG}
22 | ;;
23 | b)
24 | BRANCH=${OPTARG}
25 | ;;
26 | v)
27 | VERSION=${OPTARG}
28 | ;;
29 | h)
30 | echo ""
31 | exit
32 | ;;
33 | esac
34 | done
35 |
36 | if [ "${PATCH}" = "pure" ]; then
37 | APPINSTALL_DIR="Emacs-takaxp/pure" # APPINSTALL_DIR="Emacs-takaxp"
38 | PKG_TITLE="GNU Emacs (NS without patch)"
39 | elif [ "${PATCH}" = "inline" ]; then
40 | APPINSTALL_DIR="Emacs-takaxp"
41 | PKG_TITLE="GNU Emacs (NS with inline-patch)"
42 | elif [ "${PATCH}" = "private" ]; then
43 | APPINSTALL_DIR="" # Emacs-takaxp/private
44 | PKG_TITLE="GNU Emacs (NS with private patch)"
45 | else
46 | echo "Please provide patch mode by \"-p pure\"."
47 | exit 1
48 | fi
49 |
50 | PKG_VERSION=$(date '+%Y.%m%d.%H%M')
51 | if [ ! "$VERSION" -a ! "${BRANCH}" ]; then
52 | echo "Please specify VERSION (-v 28.2)"
53 | echo "Also check APPINSTALL_DIR and PKG_VERSION ($APPINSTALL_DIR, $PKG_VERSION)"
54 | exit 1
55 | else
56 | echo "Version: $VERSION"
57 | echo "Branch: $BRANCH"
58 | echo "APPINSTALL_DIR: $APPINSTALL_DIR"
59 | echo "PKG_TITLE: $PKG_TITLE"
60 | echo "PKG_VERSION: $PKG_VERSION"
61 | fi
62 |
63 | ##############################################################################
64 |
65 | # Setup working directory
66 | cd ${WORKING_DIR}
67 | if [ -d "notarize" ]; then
68 | rm -rf notarize
69 | fi
70 | PKG_APPINSTALL_DIR="pkg/Applications/${APPINSTALL_DIR}"
71 | mkdir -p notarize/${PKG_APPINSTALL_DIR}
72 |
73 | cd ${WORKING_DIR}/notarize
74 |
75 | # Generate entitlements.plist
76 | rm -f entitlements.plist
77 | touch entitlements.plist
78 | echo '\n\n\n \n com.apple.security.network.client\n \n com.apple.security.cs.disable-library-validation\n \n \n' >> entitlements.plist
79 |
80 | # Codesign
81 | if [ ! "${BRANCH}" = "" -a "${VERSION}" = "" ]; then
82 | APP_DIR="${SOURCE_DIR}/emacs/nextstep"
83 | echo "--- Targeting branch: ${BRANCH}"
84 | fi
85 | if [ "${BRANCH}" = "" -a ! "${VERSION}" = "" ]; then
86 | APP_DIR="${SOURCE_DIR}/emacs-${VERSION}/nextstep"
87 | echo "--- Targeting version: ${VERSION}"
88 | fi
89 | cp -r ${APP_DIR}/Emacs.app ${PKG_APPINSTALL_DIR}
90 |
91 | DEVELOPER_ID='Developer ID Application: Takaaki Ishikawa (H2PH8KNN3H)'
92 | codesign --verify --sign "${DEVELOPER_ID}" --deep --force --verbose --option runtime --entitlements entitlements.plist --timestamp ./${PKG_APPINSTALL_DIR}/Emacs.app
93 |
94 | # Check the signature
95 | RESULT=$(pkgutil --check-signature ./${PKG_APPINSTALL_DIR}/Emacs.app | grep "no sign")
96 | if [ "${RESULT}" ]; then
97 | exit 1
98 | fi
99 |
100 | # Edit packages.plist
101 | cd ${WORKING_DIR}/notarize/pkg
102 | pkgbuild --analyze --root Applications packages.plist
103 |
104 | echo "---------------------------------"
105 | echo "Make BundleIsRelocatable false"
106 | echo "Make BundleIsVersionChecked false"
107 | echo "---------------------------------"
108 | plutil -replace 'BundleIsRelocatable' -bool false packages.plist
109 | plutil -replace 'BundleIsVersionChecked' -bool false packages.plist
110 |
111 | # Create pkg file
112 | pkgbuild Emacs.pkg --root Applications --component-plist packages.plist --identifier com.takaxp.emacs --version ${PKG_VERSION} --install-location "/Applications"
113 |
114 | # Edit Distribution.xml
115 | productbuild --synthesize --package Emacs.pkg Distribution.xml
116 |
117 | XMLSTARLET=$(which xmlstarlet)
118 | if [ ! ${XMLSTARLET} ]; then
119 | echo "xmlstarlet shall be instaled."
120 | exit 1
121 | fi
122 |
123 | echo "---------------------------------"
124 | echo "Add title and allowed-os-versions"
125 | echo "---------------------------------"
126 | ${XMLSTARLET} ed -a '/installer-gui-script/choice[@id="com.takaxp.emacs"]' -t 'elem' -n 'title' -v "${PKG_TITLE}" \
127 | -a '/installer-gui-script/title' -t 'elem' -n 'allowed-os-versions' \
128 | -s '/installer-gui-script/allowed-os-versions' -t 'elem' -n 'os-version' \
129 | -a '/installer-gui-script/allowed-os-versions/os-version' -t 'attr' -n 'min' -v '10.15' Distribution.xml > edited.xml
130 | mv edited.xml Distribution.xml
131 |
132 | # Create Emacs-Distribution.pkg
133 | productbuild --distribution Distribution.xml --package-path Emacs.pkg Emacs-Distribution.pkg
134 |
135 | # Productsign
136 | DEVELOPER_ID='Developer ID Installer: Takaaki Ishikawa (H2PH8KNN3H)'
137 | productsign --sign "${DEVELOPER_ID}" Emacs-Distribution.pkg Emacs-Distribution_SIGNED.pkg
138 |
139 | # Check the signature
140 | RESULT=$(pkgutil --check-signature Emacs-Distribution_SIGNED.pkg | grep "no sign")
141 | if [ "${RESULT}" ]; then
142 | exit 1
143 | fi
144 |
145 | # Uploading the pkg to apple server
146 | xcrun notarytool submit "Emacs-Distribution_SIGNED.pkg" --keychain-profile "${PROFILE_NAME}" --wait
147 | rm -f Emacs.pkg Emacs-Distribution.pkg
148 |
149 | sleep 2
150 |
151 | cd ${WORKING_DIR}/notarize/pkg
152 | xcrun stapler staple Emacs-Distribution_SIGNED.pkg
153 | CPUARC=$(uname -m)
154 | echo "--- Build for ${CPUARC}"
155 |
156 | if [ "${BRANCH}" ]; then
157 | FILENAME="${BRANCH}"
158 | if [ "${BRANCH}" = "master" ]; then
159 | FILENAME="emacs-head"
160 | fi
161 | elif [ "${VERSION}" ]; then
162 | FILENAME="emacs-${VERSION}"
163 | fi
164 |
165 | VENDER="_apple"
166 | [ "${CPUARC}" = "x86_64" ] && VENDER="_intel"
167 | [ "${PATCH}" = "pure" ] && PURE="_pure"
168 | if [ -f ./Applications/${APPINSTALL_DIR}/Emacs.app/Contents/MacOS/lib/${LIB_GCCJIT} ]; then
169 | NATIVE="_nc"
170 | fi
171 |
172 | mv Emacs-Distribution_SIGNED.pkg ${FILENAME}${VENDER}${PURE}${NATIVE}.pkg
173 | rm -f ${FILENAME}${VENDER}${PURE}${NATIVE}.md5
174 | md5 ${FILENAME}${VENDER}${PURE}${NATIVE}.pkg > ${FILENAME}${VENDER}${PURE}${NATIVE}.md5
175 |
176 | echo "--- ${FILENAME}${VENDER}${PURE}${NATIVE}.pkg and md5 are generaed"
177 |
178 | cp -f *.pkg ${WORKING_DIR}
179 | cp -f *.md5 ${WORKING_DIR}
180 | rm -rf ${WORKING_DIR}/notarize
181 |
182 | echo "--- done"
183 |
--------------------------------------------------------------------------------
/release/portable-emacs.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | BREW_DIR=$(brew --prefix)
4 | WORKING_DIR="${HOME}/devel/emacs-head"
5 | GLOBAL_LIB_LIST=()
6 | DIRECT_DEPS_LIST=()
7 |
8 | function lib_in_list () {
9 | for lib in ${GLOBAL_LIB_LIST[@]}
10 | do
11 | [ "$lib" = "$1" ] && return 0
12 | done
13 |
14 | return 1
15 | }
16 |
17 | function colloect_deps_lib () {
18 | DIRECT_DEPS_LIST=()
19 | count=0
20 | local _RESULT=$(otool -L $1 | grep ${BREW_DIR})
21 | if [ ! "$1" = "Emacs" ]; then
22 | _RESULT=$(echo "$_RESULT" | sed -r "s/.*dylib:(.*)/\1/")
23 | fi
24 |
25 | _IFS="$IFS"
26 | IFS=$'\n'
27 | for lib in ${_RESULT[@]}
28 | do
29 | count=$(expr $count + 1)
30 | if [ ! "$1" = "Emacs" -a "$2" -a $count = 1 ]; then
31 | continue
32 | fi
33 |
34 | # includes "/opt/.../hoge.dylib" and "/Cellar/.../hoge.dylib"
35 | # both cases should be supported for "install_name_tool -change"
36 | regexp="^.*${BREW_DIR}/(.*).dylib"
37 | if [[ $lib =~ $regexp ]]; then
38 | DYLIB=${BASH_REMATCH[1]}
39 |
40 | if [ "$2" = "copy" ]; then
41 | lib_in_list $DYLIB
42 | if [ $? = 0 ]; then
43 | continue
44 | else
45 | GLOBAL_LIB_LIST+=("$DYLIB")
46 | colloect_deps_lib "${BREW_DIR}/${DYLIB}.dylib" "copy"
47 | fi
48 | else
49 | DIRECT_DEPS_LIST+=("$DYLIB")
50 | fi
51 | fi
52 | done
53 | IFS="$_IFS"
54 |
55 | return 0
56 | }
57 |
58 | function verify_lib () {
59 | echo "-L "$1
60 | if [ "$1" = "Emacs" ]; then
61 | RESULT=$(otool -L $1 | grep ${BREW_DIR})
62 | else
63 | RESULT=$(otool -L ${EMACS_EXEC_DIR}/lib/$1.dylib | grep ${BREW_DIR})
64 | fi
65 | if [ ${#RESULT} -gt 0 ]; then
66 | STATUS="${STATUS}\n${RESULT}"
67 | fi
68 |
69 | return 0
70 | }
71 |
72 | while getopts v:b:d:ha: opt
73 | do
74 | case ${opt} in
75 | d)
76 | WORKING_DIR=${OPTARG}
77 | ;;
78 | b)
79 | BRANCH=${OPTARG}
80 | ;;
81 | v)
82 | VERSION=${OPTARG}
83 | ;;
84 | a)
85 | APP_DIR=${OPTARG}
86 | ;;
87 | h)
88 | echo ""
89 | exit
90 | ;;
91 | esac
92 | done
93 |
94 | echo "--- Integrate libraries and its dependencies into Emacs.app"
95 |
96 | if [ "$VERSION" = "" -a "$BRANCH" = "" -a "$APP_DIR" = "" ]; then
97 | echo "Please specify VERSION (-v 27.2) ov BRANCH (-b master)"
98 | exit 1
99 | fi
100 |
101 | if [ ! "${BRANCH}" = "" -a "${VERSION}" = "" ]; then
102 | APP_DIR="${WORKING_DIR}/emacs/nextstep"
103 | echo "--- Target branch: ${BRANCH}"
104 | fi
105 |
106 | if [ "${BRANCH}" = "" -a ! "${VERSION}" = "" ]; then
107 | APP_DIR="${WORKING_DIR}/emacs-${VERSION}/nextstep"
108 | echo "--- Target version: ${VERSION}"
109 | fi
110 |
111 | # EMACSVERSION=`${APP_DIR}/Emacs.app/Contents/MacOS/Emacs -Q --batch --eval="(princ emacs-version)"`
112 | NATIVEP=`${APP_DIR}/Emacs.app/Contents/MacOS/Emacs -Q --batch --eval="(princ (when (fboundp 'native-comp-available-p) (native-comp-available-p)))"`
113 |
114 | if [ "${NATIVEP}" == "t" ]; then
115 | NATIVEP=true
116 | if [ ! -f ${BREW_DIR}/opt/libgccjit/include/libgccjit.h ]; then
117 | NATIVEP=false
118 | fi
119 | else
120 | NATIVEP=false
121 | fi
122 |
123 | EMACS_EXEC_DIR="${APP_DIR}/Emacs.app/Contents/MacOS"
124 | if [ ! -d "$EMACS_EXEC_DIR" ]; then
125 | echo "$EMACS_EXEC_DIR does NOT exist"
126 | exit 1
127 | fi
128 |
129 | cd "$EMACS_EXEC_DIR"
130 | mkdir -p ${EMACS_EXEC_DIR}/lib
131 |
132 | libname_regexp=".+/(.+)"
133 |
134 | echo "--- Copying libraries, and applying modification"
135 | colloect_deps_lib "Emacs" "copy"
136 | for lib in ${GLOBAL_LIB_LIST[@]}
137 | do
138 | cp -f "${BREW_DIR}/${lib}.dylib" ${EMACS_EXEC_DIR}/lib
139 | if [[ $lib =~ $libname_regexp ]]; then
140 | # echo "install_name_tool -id "homebrew:$lib.dylib" lib/${BASH_REMATCH[1]}.dylib"
141 | install_name_tool -id "homebrew:$lib.dylib" lib/${BASH_REMATCH[1]}.dylib > /dev/null 2>&1
142 | fi
143 | done
144 |
145 | echo "--- Linking dependent libraries (${#GLOBAL_LIB_LIST[@]})"
146 | colloect_deps_lib "Emacs"
147 | for deps in ${DIRECT_DEPS_LIST[@]}
148 | do
149 | if [[ $deps =~ $libname_regexp ]]; then
150 | install_name_tool -change "${BREW_DIR}/${deps}.dylib" "@executable_path/lib/${BASH_REMATCH[1]}.dylib" Emacs> /dev/null 2>&1
151 | fi
152 | done
153 |
154 | for lib in ${GLOBAL_LIB_LIST[@]}
155 | do
156 | if [[ $lib =~ $libname_regexp ]]; then
157 | TARGET_LIB=${BASH_REMATCH[1]}
158 | # echo ">>> $TARGET_LIB.dylib"
159 |
160 | colloect_deps_lib "lib/$TARGET_LIB.dylib"
161 | for deps in ${DIRECT_DEPS_LIST[@]}
162 | do
163 | if [[ $deps =~ $libname_regexp ]]; then
164 | install_name_tool -change "${BREW_DIR}/${deps}.dylib" "@executable_path/lib/${BASH_REMATCH[1]}.dylib" "lib/${TARGET_LIB}.dylib"> /dev/null 2>&1
165 | fi
166 | done
167 | fi
168 | done
169 |
170 | chmod 644 ${EMACS_EXEC_DIR}/lib/*.dylib
171 |
172 | # Verifying - If ok then nothing will be displayed except the lib names
173 | for lib in ${GLOBAL_LIB_LIST[@]}
174 | do
175 | if [[ $lib =~ $libname_regexp ]]; then
176 | verify_lib "${BASH_REMATCH[1]}"
177 | fi
178 | done
179 | verify_lib "Emacs"
180 |
181 | # Return false for Github Actions if needed
182 | if [ "${STATUS}" ];then
183 | echo "--- ${STATUS}"
184 | exit 1
185 | fi
186 |
187 | echo "--- done"
188 |
--------------------------------------------------------------------------------
/release/upload.bat:
--------------------------------------------------------------------------------
1 | cd ns-inline-patch
2 | put *.pkg
3 | put *.md5
4 |
--------------------------------------------------------------------------------