[libadwaita/wip/exalm/flatpak-docs: 708/708] doc: Update build-howto




commit 32f4f5f6063a977f46aabeb7ed7332f83df74232
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Tue Dec 21 14:15:53 2021 +0500

    doc: Update build-howto
    
    Add libsass and sassc for Flatpak, update subproject, suggest Flatpak over
    subproject and mention that it's in the SDK.

 doc/build-howto.md | 112 ++++++++++++++++++++++++++++++++++++-----------------
 1 file changed, 77 insertions(+), 35 deletions(-)
---
diff --git a/doc/build-howto.md b/doc/build-howto.md
index f572336f..c3beb52f 100644
--- a/doc/build-howto.md
+++ b/doc/build-howto.md
@@ -23,51 +23,93 @@ of the package name.
 
 ## Bundling the Library
 
-As Libadwaita uses the Meson build system, bundling it as a subproject when it
-is not installed is easy. Add this to your `meson.build`:
+### Using Flatpak
 
-```meson
-libadwaita_dep = dependency('libadwaita-1', version: '>= 1.0.0', required: false)
-if not libadwaita_dep.found()
-libadwaita = subproject(
-  'libadwaita',
-  default_options: [
-    'examples=false',
-    'package_subdir=my-project-name',
-    'tests=false',
-  ]
-)
-libadwaita_dep = libadwaita.get_variable('libadwaita_dep')
-endif
+If you're using the GNOME SDK of the version 42 or later, Libadwaita is already
+included and there's no need to do anything.
+
+If you're using an older version of a different SDK, add the following modules
+to your manifest:
+
+```json
+{
+    "name" : "libadwaita",
+    "buildsystem" : "meson",
+    "config-opts" : [
+        "-Dexamples=false",
+        "-Dtests=false"
+    ],
+    "sources" : [
+        {
+            "type" : "git",
+            "url" : "https://gitlab.gnome.org/GNOME/libadwaita.git";,
+            "branch" : "main"
+        }
+    ],
+    "modules" : [
+        {
+            "name" : "libsass",
+            "buildsystem" : "meson",
+            "cleanup" : [
+                "*"
+            ],
+            "sources" : [
+                {
+                    "type" : "git",
+                    "url" : "https://github.com/lazka/libsass.git";,
+                    "branch" : "meson"
+                }
+            ]
+        },
+        {
+            "name" : "sassc",
+            "buildsystem" : "meson",
+            "cleanup" : [
+                "*"
+            ],
+            "sources" : [
+                {
+                    "type" : "git",
+                    "url" : "https://github.com/lazka/sassc.git";,
+                    "branch" : "meson"
+                }
+            ]
+        }
+    ]
+}
 ```
 
-Then add Libadwaita as a git submodule:
+### Using a Subproject
 
-```bash
-git submodule add https://gitlab.gnome.org/GNOME/libadwaita.git subprojects/libadwaita
+If you're not using Flatpak, Libadwaita can be used as a Meson subproject.
+Create a `subprojects/libadwaita.wrap` file with the following contents:
+
+```ini
+[wrap-git]
+directory=libadwaita
+url=https://gitlab.gnome.org/GNOME/libadwaita.git
+revision=main
+depth=1
 ```
 
-To bundle the library with your Flatpak application, add the following module to
-your manifest:
+Add this to your `meson.build`:
 
-```json
-{
-  "name" : "libadwaita",
-  "buildsystem" : "meson",
-  "config-opts": [
-    "-Dexamples=false",
-    "-Dtests=false"
-  ],
-  "sources" : [
-    {
-      "type" : "git",
-      "url" : "https://gitlab.gnome.org/GNOME/libadwaita.git";,
-      "branch" : "main"
-    }
+```meson
+libadwaita = dependency(
+  'libadwaita-1',
+  version: '>= 1.0.0',
+  fallback: ['libadwaita', 'libadwaita_dep'],
+  default_options: [
+    'examples=false',
+    'introspection=disabled',
+    'tests=false',
+    'vapi=false',
   ]
-}
+)
 ```
 
+Then the `libadwaita` variable can be used as a dependency.
+
 ## Building on macOS
 
 To build on macOS you need to install the build-dependencies first. This can


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]