xref: /aosp_15_r20/external/wayland/README.android.md (revision 84e872a0dc482bffdb63672969dd03a827d67c73)
1*84e872a0SLloyd Pique# About `external/wayland`
2*84e872a0SLloyd Pique
3*84e872a0SLloyd Pique## What this is.
4*84e872a0SLloyd Pique
5*84e872a0SLloyd PiqueThis Android repository contains minimally modified snapshots of official
6*84e872a0SLloyd Piquerelease of the core Wayland system code, and its core protocol. It is
7*84e872a0SLloyd Piqueconfigured to easily build for use in Android projects.
8*84e872a0SLloyd Pique
9*84e872a0SLloyd PiqueOfficial home page: <https://wayland.freedesktop.org>
10*84e872a0SLloyd Pique
11*84e872a0SLloyd PiqueOfficial source code home: <https://gitlab.freedesktop.org/wayland/wayland.git>
12*84e872a0SLloyd Pique
13*84e872a0SLloyd Pique## Changes from the official version
14*84e872a0SLloyd Pique
15*84e872a0SLloyd Pique### Android Open Source Metadata
16*84e872a0SLloyd Pique
17*84e872a0SLloyd PiqueThese files should always be present.
18*84e872a0SLloyd Pique
19*84e872a0SLloyd Pique- `./LICENSE` (symlinks to COPYING)
20*84e872a0SLloyd Pique- `./METADATA`
21*84e872a0SLloyd Pique- `./MODULE_LICENSE_MIT`
22*84e872a0SLloyd Pique
23*84e872a0SLloyd PiqueNote that `./METADATA` should be updated with the latest version and time
24*84e872a0SLloyd Piqueimported. If using `import_official_snapshot.py`, this will be updated by the
25*84e872a0SLloyd Piquescript automatically.
26*84e872a0SLloyd Pique
27*84e872a0SLloyd PiqueFor further details about these files, refer to
28*84e872a0SLloyd Pique<https://opensource.google/docs/thirdparty/android#how-to-add-new-third-party-code-to-android>
29*84e872a0SLloyd Pique
30*84e872a0SLloyd Pique### Android Build Files
31*84e872a0SLloyd Pique
32*84e872a0SLloyd PiqueThese files are NOT in the official source code, and have been added to make it
33*84e872a0SLloyd Piqueusable in Android. These should always be present, according to the current
34*84e872a0SLloyd Piqueopen source rules, and are not really functional changes.
35*84e872a0SLloyd Pique
36*84e872a0SLloyd Pique- `./Android.bp`
37*84e872a0SLloyd Pique
38*84e872a0SLloyd Pique  The Android Soong blueprint file which builds the libraries.
39*84e872a0SLloyd Pique
40*84e872a0SLloyd Pique- `./config.h`
41*84e872a0SLloyd Pique
42*84e872a0SLloyd Pique  A fixed `config.h` to use in all Android builds, defining C preprocessor
43*84e872a0SLloyd Pique  macros for features generally available on the Android platform.
44*84e872a0SLloyd Pique
45*84e872a0SLloyd Pique- `./import_official_snapshot.py`
46*84e872a0SLloyd Pique
47*84e872a0SLloyd Pique  A helper Python script useful to import updated official versions of the
48*84e872a0SLloyd Pique  source code, while still preserving all needed Android changes. See below
49*84e872a0SLloyd Pique  for usage.
50*84e872a0SLloyd Pique
51*84e872a0SLloyd Pique- `./wayland-version.h`
52*84e872a0SLloyd Pique
53*84e872a0SLloyd Pique  A static expansion of `src/wayland-version.h.in` for the current Wayland
54*84e872a0SLloyd Pique  version here. If using `./import_official_snapshot.py`, this will be updated
55*84e872a0SLloyd Pique  by the script automatically.
56*84e872a0SLloyd Pique
57*84e872a0SLloyd Pique- `./OWNERS`
58*84e872a0SLloyd Pique
59*84e872a0SLloyd Pique  The list of OWNERS for the code here.
60*84e872a0SLloyd Pique
61*84e872a0SLloyd Pique- `./PREUPLOAD.cfg`
62*84e872a0SLloyd Pique
63*84e872a0SLloyd Pique  A `repo` preupload hook. Mostly just exists to strongly recommend making
64*84e872a0SLloyd Pique  changes in the AOSP master branch.
65*84e872a0SLloyd Pique
66*84e872a0SLloyd Pique- `./README.android.md`
67*84e872a0SLloyd Pique
68*84e872a0SLloyd Pique  This document, describing the differences from the official sources, and
69*84e872a0SLloyd Pique  giving instructions for upgrading.
70*84e872a0SLloyd Pique
71*84e872a0SLloyd Pique### Additional patches for Android
72*84e872a0SLloyd Pique
73*84e872a0SLloyd PiqueThese are any additional changes to the Wayland core sources that might be
74*84e872a0SLloyd Piquehelpful for use with the Android platform.
75*84e872a0SLloyd Pique
76*84e872a0SLloyd PiqueThese differences are stored in `./patches/`, and are expected to cleanly apply
77*84e872a0SLloyd Piqueto the current version of Wayland used here.
78*84e872a0SLloyd Pique
79*84e872a0SLloyd Pique## Importing a new snapshot
80*84e872a0SLloyd Pique
81*84e872a0SLloyd Pique`./import_official_snapshot.py` can be used to automate the work of pulling in
82*84e872a0SLloyd Piquean updated snapshot. Its only dependencies are a standard Python3 installation,
83*84e872a0SLloyd Piquealong with command-line git.
84*84e872a0SLloyd Pique
85*84e872a0SLloyd PiqueUsage:
86*84e872a0SLloyd Pique
87*84e872a0SLloyd Pique```
88*84e872a0SLloyd Pique./import_official_snapshot.py <version-tag>
89*84e872a0SLloyd Pique```
90*84e872a0SLloyd Pique
91*84e872a0SLloyd PiqueFor example, to import the "1.18.0" version tag from the official sources:
92*84e872a0SLloyd Pique
93*84e872a0SLloyd Pique```
94*84e872a0SLloyd Pique./import_official_snapshot.py 1.18.0
95*84e872a0SLloyd Pique```
96*84e872a0SLloyd Pique
97*84e872a0SLloyd PiqueThe script will create a new branch based on your current checkout, and commit
98*84e872a0SLloyd Piquea series of changes to it:
99*84e872a0SLloyd Pique
100*84e872a0SLloyd Pique- An inital empty commit with a simple import message.
101*84e872a0SLloyd Pique
102*84e872a0SLloyd Pique- A commit removing all existing files, and adding in a clean import of the
103*84e872a0SLloyd Pique  **CURRENT** version from the official sources.
104*84e872a0SLloyd Pique
105*84e872a0SLloyd Pique- A commit adding (back) the various required Android files
106*84e872a0SLloyd Pique
107*84e872a0SLloyd Pique- Additional commits for each patch in `./patches/`
108*84e872a0SLloyd Pique
109*84e872a0SLloyd PiqueThe script will then validate that there are no differences between the branch
110*84e872a0SLloyd Piquestart (committed code) and a cleanly-patched import of the current version. If
111*84e872a0SLloyd Piquethere is a difference, it should mean that there is some patch to the code not
112*84e872a0SLloyd Piquein `./patches`.
113*84e872a0SLloyd Pique
114*84e872a0SLloyd PiqueAssuming success, the script will continue commiting to the branch:
115*84e872a0SLloyd Pique
116*84e872a0SLloyd Pique- A commit removing all existing files, and adding in a clean import of
117*84e872a0SLloyd Pique  the **NEW** version from the official sources.
118*84e872a0SLloyd Pique
119*84e872a0SLloyd Pique- A commit adding (back) the various required Android files, including
120*84e872a0SLloyd Pique  updating `./METADATA` and `./wayland-version.h`.
121*84e872a0SLloyd Pique
122*84e872a0SLloyd Pique- A commit for each patch in `./patches/`, if there are any.
123*84e872a0SLloyd Pique
124*84e872a0SLloyd PiqueIf there were no problems needing manual intervention, the script will then
125*84e872a0SLloyd Piqueexecute a final `git rebase -i --autosquash` to squash the CL into a single
126*84e872a0SLloyd Piquecommit for upload review. Otherwise, you should do that squash it to a single
127*84e872a0SLloyd Piquecommit yourself.
128*84e872a0SLloyd Pique
129*84e872a0SLloyd PiqueThere may be failures in applying the patches if there are conflicts, in
130*84e872a0SLloyd Piquewhich case they need to be resolved before squashing. Please update the files
131*84e872a0SLloyd Piquein `./patches/` with the new patches.
132*84e872a0SLloyd Pique
133*84e872a0SLloyd PiqueAdditionally, there may be additional changes needed to `./Android.bp` for
134*84e872a0SLloyd Piquethe client and server libraries to build.
135*84e872a0SLloyd Pique
136*84e872a0SLloyd Pique## Adding new patches
137*84e872a0SLloyd Pique
138*84e872a0SLloyd PiquePlease maintain the list of patch files in `./patches` against the current
139*84e872a0SLloyd Piqueversion of Wayland if you make any changes to the official sources.
140*84e872a0SLloyd Pique
141*84e872a0SLloyd PiqueWith no arguments, `./import_official_snapshot.py` will do a clean import of the
142*84e872a0SLloyd Piquecurrent version, and apply the current list of patches WITHOUT squashing the
143*84e872a0SLloyd Piquecommits involved.
144*84e872a0SLloyd Pique
145*84e872a0SLloyd PiqueYou can then make the changes to the sources, and do a clean reexport of the
146*84e872a0SLloyd Piquepatch files for the last N commits.
147*84e872a0SLloyd Pique
148*84e872a0SLloyd Pique```
149*84e872a0SLloyd Pique# Remove the current patch files
150*84e872a0SLloyd Piquegit rm patches/*
151*84e872a0SLloyd Pique
152*84e872a0SLloyd Pique# Export the last five commits as patches. You should adjust this number.
153*84e872a0SLloyd Piquegit format-patch HEAD~5 --no-stat --numbered --zero-commit --no-signature \
154*84e872a0SLloyd Pique    --suffix=.diff --output-directory patches/
155*84e872a0SLloyd Pique```
156*84e872a0SLloyd Pique
157*84e872a0SLloyd PiqueCreate a new commit that adds those same patches, and squash all the commits
158*84e872a0SLloyd Piquetogether. You should end up with a commit that makes the changes as well as adds
159*84e872a0SLloyd Piquethe patch file.
160*84e872a0SLloyd Pique
161*84e872a0SLloyd PiqueIf you want, you can then run `./import_official_snapshot.py` again to validate
162*84e872a0SLloyd Piquethat your patch will be applied. If there is a difference, it will be reported.
163*84e872a0SLloyd Pique
164