Merge pull request #118 from tfuxu/next

Allow users to compile builds without flatpak
This commit is contained in:
0xMRTT 2022-08-13 15:03:24 +02:00 committed by GitHub
commit dd1064dfae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 75 additions and 1 deletions

View file

@ -20,7 +20,46 @@ Gradience, originally Adwaita Manager (AdwCustomizer) is a tool for customizing
## Building and Installing
See `next` branch for UI rework and latest commit.
**[NOTE]** See `next` branch for UI rework and latest commits.
## Requirements:
- Python 3 `python`
- PyGObject `python-gobject`
- Blueprint <code>[blueprint-compiler](https://jwestman.pages.gitlab.gnome.org/blueprint-compiler/setup.html)</code>
- GTK4 `gtk4`
- libadwaita (>= 1.2.alpha) `libadwaita`
- Meson `meson`
- Ninja `ninja`
## Building from source:
Install required Python libraries:
```sh
pip install -r requirements.txt
pip3 install $(pwd)/monet/material_color_utilities_python-0.1.0-py3-none-any.whl
```
### Global installation:
```sh
git clone https://github.com/AdwCustomizerTeam/AdwCustomizer.git
cd AdwCustomizer
meson builddir --prefix=/usr/local
sudo ninja -C builddir install
```
### Local build (for testing and development purposes):
```sh
git clone https://github.com/AdwCustomizerTeam/AdwCustomizer.git
cd AdwCustomizer
meson builddir
meson configure builddir -Dprefix="$(pwd)/builddir/testdir"
ninja -C builddir install
ninja -C builddir run
```
**[NOTE]** During testing and developement, as a convenience, you can use the `local.sh` script to quickly rebuild local builds.
### Building using flatpak-builder:
1. Open Terminal
2. Run `git clone https://github.com/AdwCustomizerTeam/AdwCustomizer.git && cd AdwCustomizer`

21
local.sh Executable file
View file

@ -0,0 +1,21 @@
#!/usr/bin/bash
read -p "Do you want to install Python requirements? (yes, no): " answer
if [[ "$answer" == "yes" ]]; then
pip3 install --user -r requirements.txt
pip3 install $(pwd)/monet/material_color_utilities_python-0.1.0-py3-none-any.whl
elif [[ "$answer" == "no" ]]; then
echo "Skipping requirements installation"
fi
echo "Cleaning builddir directory"
rm -r builddir
echo "Rebuilding"
meson builddir
meson configure builddir -Dprefix="$(pwd)/builddir/testdir"
ninja -C builddir install
echo "Running"
ninja -C builddir run

View file

@ -28,6 +28,14 @@ pkgdatadir = '@PKGDATA_DIR@'
localedir = '@LOCALE_DIR@'
version = '@VERSION@'
builddir = os.environ.get('MESON_BUILD_ROOT')
if builddir:
sys.dont_write_bytecode = True
sys.path.insert(1, os.environ['MESON_SOURCE_ROOT'])
data_dir = os.path.join(builddir, '@DATA_DIR@')
os.putenv('XDG_DATA_DIRS', '%s:%s' % (data_dir, os.getenv('XDG_DATA_DIRS', '/usr/local/share/:/usr/share/')))
sys.path.insert(1, pkgdatadir)
signal.signal(signal.SIGINT, signal.SIG_DFL)
gettext.install('adwcustomizer', localedir)

View file

@ -37,6 +37,12 @@ configure_file(
install_dir: MODULE_DIR
)
launcher = join_paths(meson.project_build_root(), 'src', meson.project_name())
run_target('run',
command: [launcher]
)
# Install sources
adwcustomizer_sources = [
'__init__.py',