|
| 1 | +# Prerequisites |
| 2 | + |
| 3 | +## Build system |
| 4 | + |
| 5 | +This project uses Meson, Ninja, and Cargo. |
| 6 | + |
| 7 | +We use Meson 1.5.0+. If your package manager has an older version, you can |
| 8 | +install a new version [using the pip module][meson-pip-install]. |
| 9 | + |
| 10 | +There is currently no documented minimum support Rust version (MSRV), but 1.85+ |
| 11 | +should work. |
| 12 | + |
| 13 | +[meson-pip-install]: https://mesonbuild.com/Quick-guide.html#installation-using-python |
| 14 | + |
| 15 | +## Package requirements |
| 16 | + |
| 17 | +- GTK4 |
| 18 | +- gettext |
| 19 | +- libdbus-1 |
| 20 | +- libssl/openssl |
| 21 | +- libudev |
| 22 | +- desktop-file-utils |
| 23 | + |
| 24 | +Using the web extension also requires `python3-dbus-next`. |
| 25 | + |
| 26 | +## Examples |
| 27 | + |
| 28 | +### Debian/Ubuntu |
| 29 | + |
| 30 | +```shell |
| 31 | +sudo apt update && sudo apt install \ |
| 32 | + # Build dependencies |
| 33 | + curl git build-essential \ |
| 34 | + # Meson/Ninja dependencies |
| 35 | + meson ninja-build \ |
| 36 | + # project dependencies |
| 37 | + libgtk-4-dev gettext libdbus-1-dev libssl-dev libudev-dev \ |
| 38 | + # packaging dependencies |
| 39 | + desktop-file-utils \ |
| 40 | + # web extension dependencies |
| 41 | + python3-dbus-next |
| 42 | +``` |
| 43 | + |
| 44 | +### Fedora |
| 45 | + |
| 46 | +```shell |
| 47 | +# Build dependencies |
| 48 | +sudo dnf groupinstall "Development Tools" |
| 49 | +sudo dnf install \ |
| 50 | + curl git \ |
| 51 | + # Meson/Ninja dependencies |
| 52 | + meson ninja-build \ |
| 53 | + # project dependencies |
| 54 | + gtk4-devel gettext dbus-devel openssl-devel systemd-udev \ |
| 55 | + # packaging dependencies |
| 56 | + desktop-file-utils \ |
| 57 | + # web extension dependencies |
| 58 | + python3-dbus-next |
| 59 | +``` |
| 60 | + |
| 61 | +# For Installing/Testing |
| 62 | + |
| 63 | +If you are interested in installing the program, you can use `meson install` to |
| 64 | +install the details. (If you would like to test without installing, you can |
| 65 | +follow the [build instructions for development](#for-development) below.) |
| 66 | + |
| 67 | +```shell |
| 68 | +git clone https://github.com/linux-credentials/credentialsd |
| 69 | +cd credentialsd |
| 70 | +meson setup -Dprefix=/usr/local build-release |
| 71 | +cd build-release |
| 72 | +meson install |
| 73 | +``` |
| 74 | + |
| 75 | +Note that since Meson is installing to `/usr/local`, it will ask you to use |
| 76 | +`sudo` to elevate privileges to install. |
| 77 | + |
| 78 | +## Running the installed server |
| 79 | + |
| 80 | +When using the installed server, systemd or D-Bus should take care of starting |
| 81 | +the services on demand, so you don't need to start it manually. |
| 82 | + |
| 83 | +The first time you install this, though, you must log out and log back in again |
| 84 | +for the service activation files to take effect. |
| 85 | + |
| 86 | +## Testing installed builds with Firefox Web Add-On |
| 87 | + |
| 88 | +Note: If you are testing the Firefox web extension, you will need to link the |
| 89 | +native messaging manifest to your home directory, since Firefox does not read |
| 90 | +from `/usr/local`: |
| 91 | + |
| 92 | +```shell |
| 93 | +mkdir -p ~/.mozilla/native-messaging-hosts/ |
| 94 | +ln -s /usr/local/lib64/mozilla/native-messaging-hosts/xyz.iinuwa.credentialsd_helper.json ~/.mozilla/native-messaging-hosts/ |
| 95 | +``` |
| 96 | + |
| 97 | +# For Development |
| 98 | + |
| 99 | +``` |
| 100 | +git clone https://github.com/linux-credentials/credentialsd |
| 101 | +cd credentialsd |
| 102 | +meson setup -Dprofile=development build |
| 103 | +ninja -C build |
| 104 | +``` |
| 105 | + |
| 106 | +## Running the server for development |
| 107 | + |
| 108 | +To run the required services during development, you need to add some |
| 109 | +environment variables. |
| 110 | + |
| 111 | +```shell |
| 112 | +# Run the server, with debug logging enabled |
| 113 | +export GSETTINGS_SCHEMA_DIR=build/credentialsd-ui/data |
| 114 | +export RUST_LOG=credentialsd=debug,credentials_ui=debug |
| 115 | +./build/credentialsd/target/debug/credentialsd & |
| 116 | +./build/credentialsd-ui/target/debug/credentialsd-ui |
| 117 | +``` |
| 118 | + |
| 119 | +## Testing development builds with Firefox Web Add-On |
| 120 | + |
| 121 | +If you are using the Firefox add-on to build, follow the instructions for |
| 122 | +development in [`webext/README.md`](/webext/README.md#for-development). |
| 123 | + |
| 124 | +# For Packaging |
| 125 | + |
| 126 | +There are a few Meson options to control the build that may be useful for packagers. |
| 127 | + |
| 128 | +``` |
| 129 | +# list available options |
| 130 | +
|
| 131 | +> meson configure |
| 132 | +# ... |
| 133 | +Project options Default Value Possible Values Description |
| 134 | +----------------- ------------- --------------- ----------- |
| 135 | +cargo_home The directory to |
| 136 | + store files |
| 137 | + downloaded by |
| 138 | + Cargo |
| 139 | +cargo_offline false [true, false] Whether to |
| 140 | + perform an |
| 141 | + offline build |
| 142 | + with Cargo. |
| 143 | + Defaults to false |
| 144 | + to download |
| 145 | + crates from |
| 146 | + registries. |
| 147 | +profile default [default, The build profile |
| 148 | + development] for Credential |
| 149 | + Manager. One of |
| 150 | + "default" or |
| 151 | + "development". |
| 152 | +``` |
| 153 | + |
| 154 | +> TODO: rename `default` profile to `release` to reduce confusion. |
| 155 | +
|
| 156 | +# Running Tests |
| 157 | + |
| 158 | +Due to some unknown reason, tests hang unless you pass the `--interactive` flag to Meson, available since 1.5.0. |
| 159 | + |
| 160 | +``` |
| 161 | +cd build |
| 162 | +meson test --interactive |
| 163 | +``` |
0 commit comments