Skip to content

Commit f5b2e04

Browse files
committed
Add meson build system
1 parent 0cc0531 commit f5b2e04

File tree

19 files changed

+905
-77
lines changed

19 files changed

+905
-77
lines changed

HACKING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This theme uses libsass to process the various .scss files. Never edit any of th
66

77
* Edit the `common/*/sass/*.scss` files.
88

9-
* Run `make` to generate all css files using `sassc`.
9+
* Rebuild to generate all css files using `sassc`.
1010

1111
#### Editing the GTK 2 themes
1212

@@ -30,7 +30,7 @@ Because this theme is heavily based on the pixmap engine, a lot of the styling c
3030

3131
* Find the object you want to edit and make your changes. **Important:** Don't change the object *id*!
3232

33-
* Save `assets.svg` and run `make` (or `make -j$(nproc)` if you're in a hurry) from a terminal in the parent directory.
33+
* Save `assets.svg` and rebuild.
3434

3535
---
3636

INSTALL.autotools.md

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
## Installing Arc from the source
2+
3+
#### Getting the source
4+
5+
To get the source, either clone the git repository with:
6+
7+
git clone https://github.com/jnsh/arc-theme --depth 1
8+
cd arc-theme/
9+
10+
Or download and extract a [snapshot](https://github.com/jnsh/arc-theme/archive/master.zip) of the master branch:
11+
12+
wget https://github.com/jnsh/arc-theme/archive/master.zip
13+
unzip master.zip
14+
cd arc-theme-master/
15+
16+
#### Build and install
17+
18+
##### Installing system wide for all users
19+
20+
Install to `/usr/share/themes` for all users by running the following with root permissions:
21+
22+
./autogen.sh --prefix=/usr
23+
make install
24+
25+
##### Installing for single user
26+
27+
Use the following commands to install the theme to `~/.local/share/themes/` for your user only:
28+
29+
./autogen.sh --prefix=$HOME/.local
30+
make install
31+
32+
**Note:** Some themes (at least GTK 2) aren't loaded from `~/.local/share/themes/`. You can work around this e.g. by symlinking the Arc theme directories in `~/.local/share/themes/` to `~/.themes/` with following commands:
33+
34+
mkdir -p ~/.themes/
35+
for d in Arc{,-Dark,-Darker,-Lighter}{,-solid}; do
36+
[ -d ~/.local/share/themes/$d ] && ln -s ~/.local/share/themes/$d ~/.themes/;
37+
done
38+
39+
## Dependencies
40+
41+
#### Build dependencies
42+
43+
To build the theme the following packages are required:
44+
* `autoconf`
45+
* `automake`
46+
* `make`
47+
* `pkgconf`
48+
49+
The following packages are only required for building certain themes:
50+
* `sassc` for GTK 3, Cinnamon, and GNOME Shell
51+
* `inkscape` for GTK 2, GTK 3, and XFWM
52+
* `glib2` for GTK 3 (needs `glib-compile-resources` binary, the exact package name varies between distributions)
53+
54+
You can avoid these dependencies by disabling support for the specific themes with build options detailed below.
55+
56+
##### Optional build dependencies
57+
58+
The following packages are optional, but used to optimize the built theme if available:
59+
* `optipng` for optimizing PNG assets for GTK 2, GTK 3, and XFWM
60+
61+
#### Runtime dependencies
62+
63+
For the GTK 2 theme to function properly, install the following:
64+
* `gnome-themes-extra`, or `gnome-themes-standard` before GNOME version 3.28
65+
* The murrine GTK 2 engine. This has different names depending on the distribution:
66+
* `gtk-engine-murrine` (Arch Linux)
67+
* `gtk2-engines-murrine` (Debian, Ubuntu, elementary OS)
68+
* `gtk-murrine-engine` (Fedora)
69+
* `gtk2-engine-murrine` (openSUSE)
70+
* `gtk-engines-murrine` (Gentoo)
71+
72+
## Versioned themes
73+
74+
The source code comes branched for different versions of GTK 3, GNOME Shell, and Cinnamon. Only one version of those themes will be installed, and using the wrong versions will result in issues of varying severity.
75+
76+
The theme versions that will be built can be set manually with build options. Otherwise the build system tries to determine correct versions using the following packages on the build environment:
77+
* `gnome-shell` for detecting GNOME Shell version
78+
* `cinnamon` for detecting Cinnamon version
79+
* the GTK 3 package, or its development files for distributions that ship those separately (e.g. `libgtk-3-dev` for Debian based distros or `gtk3-devel` for RPM based distros), for detecting GTK 3 version
80+
81+
The above packages are not required if the theme versions are defined manually (see build options below).
82+
83+
**Note:** The build will fail, if GTK 3, Cinnamon, or GNOME Shell versions can't be determined. You can work around this by either disabling the build of a specific theme, or by specifying the versions manually with build options detailed below.
84+
85+
## Build options
86+
87+
Options to pass to `autogen.sh`:
88+
89+
--disable-transparency disable transparency in the theme
90+
--disable-light disable Arc Light support
91+
--disable-darker disable Arc Darker support
92+
--disable-dark disable Arc Dark support
93+
--disable-lighter disable Arc Lighter support
94+
95+
--disable-cinnamon disable Cinnamon support
96+
--disable-gnome-shell disable GNOME Shell support
97+
--disable-gtk2 disable GTK 2 support
98+
--disable-gtk3 disable GTK 3 support
99+
--disable-metacity disable Metacity support
100+
--disable-plank disable Plank support
101+
--disable-unity disable Unity support
102+
--disable-xfwm disable XFWM support
103+
104+
--with-cinnamon=<version> build the Cinnamon theme for a specific version
105+
--with-gnome-shell=<version> build the GNOME Shell theme for a specific version
106+
--with-gtk3=<version> build the GTK 3 theme for a specific version
107+
108+
If the `--disable-transparency` option was used, the theme will be installed with `-solid` suffix.
109+
110+
## Uninstallation
111+
112+
Run the following from the source code directory:
113+
114+
make uninstall
115+
116+
Or simply remove the theme directories from your install location, e.g.
117+
118+
rm -rf ~/.local/share/themes/Arc{,-Dark,-Darker,-Lighter}{,-solid}

INSTALL.md

Lines changed: 61 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,118 +1,104 @@
11
## Installing Arc from the source
22

3+
**Note:** Arc-theme has switched to [Meson](https://mesonbuild.com/) build system. The old GNU Autotools based build system is still present, and the old build documentation is available in [INSTALL.autotools.md](https://github.com/jnsh/arc-theme/blob/master/INSTALL.autotools.md), but it will be removed in future releases. Please open [an issue](https://github.com/jnsh/arc-theme/issues/new), if you have any problems with the new build system.
4+
35
#### Getting the source
46

5-
To get the source, either clone the git repository with:
7+
To get the source, either clone the git repository with e.g.
68

79
git clone https://github.com/jnsh/arc-theme --depth 1
8-
cd arc-theme/
910

10-
Or download and extract a [snapshot](https://github.com/jnsh/arc-theme/archive/master.zip) of the master branch:
11+
Or download and extract a [snapshot](https://github.com/jnsh/arc-theme/archive/master.zip) of the master git branch, or the latest [release tarball](https://github.com/jnsh/arc-theme/releases/latest).
1112

12-
wget https://github.com/jnsh/arc-theme/archive/master.zip
13-
unzip master.zip
14-
cd arc-theme-master/
13+
#### Dependencies
1514

16-
#### Build and install
15+
##### Build dependencies
1716

18-
##### Installing system wide for all users
17+
To build the theme the following packages are required:
18+
* `meson`
1919

20-
Install to `/usr/share/themes` for all users by running the following with root permissions:
20+
The following packages are only required for building certain themes:
21+
* `sassc` for GTK 3, Cinnamon, and GNOME Shell
22+
* `inkscape` for GTK 2, GTK 3, and Xfwm
2123

22-
./autogen.sh --prefix=/usr
23-
make install
24+
You can avoid these dependencies by choosing to not build specific themes using the `themes` build option.
2425

25-
##### Installing for single user
26+
##### Runtime dependencies
2627

27-
Use the following commands to install the theme to `~/.local/share/themes/` for your user only:
28+
For the GTK 2 theme to function properly, install the following:
29+
* `gnome-themes-extra`, or `gnome-themes-standard` before GNOME version 3.28
30+
* The murrine GTK 2 engine. This has different names depending on the distribution:
31+
* `gtk-engine-murrine` (Arch Linux)
32+
* `gtk2-engines-murrine` (Debian, Ubuntu, elementary OS)
33+
* `gtk-murrine-engine` (Fedora)
34+
* `gtk2-engine-murrine` (openSUSE)
35+
* `gtk-engines-murrine` (Gentoo)
2836

29-
./autogen.sh --prefix=$HOME/.local
30-
make install
37+
#### Building and installation
3138

32-
**Note:** Some themes (at least GTK 2) aren't loaded from `~/.local/share/themes/`. You can work around this e.g. by symlinking the Arc theme directories in `~/.local/share/themes/` to `~/.themes/` with following commands:
39+
Arc-theme uses [Meson](https://mesonbuild.com/) build system, refer to its documentation for further information about the build process.
3340

34-
mkdir -p ~/.themes/
35-
for d in Arc{,-Dark,-Darker,-Lighter}{,-solid}; do
36-
[ -d ~/.local/share/themes/$d ] && ln -s ~/.local/share/themes/$d ~/.themes/;
37-
done
41+
The following instructions should work for most common cases.
3842

39-
## Dependencies
43+
##### Setup and configure a build direcortry
4044

41-
#### Build dependencies
45+
First you need to setup and configure a new build directory (e.g. `build/`) from the cloned/extracted source code directory.
4246

43-
To build the theme the following packages are required:
44-
* `autoconf`
45-
* `automake`
46-
* `make`
47-
* `pkgconf`
47+
You should at least configure the build prefix with `--prefix=` option, usually `/usr` for system wide installation, or `$HOME/.local` for installing for your user only. Additionally you may set any Arc-theme specific [build options](#build-options) according to your needs and preferences, with `-Doption=value` command line argument.
4848

49-
The following packages are only required for building certain themes:
50-
* `sassc` for GTK 3, Cinnamon, and GNOME Shell
51-
* `inkscape` for GTK 2, GTK 3, and XFWM
52-
* `glib2` for GTK 3 (needs `glib-compile-resources` binary, the exact package name varies between distributions)
49+
For example, configure to install in your home directory, and to only build the Arc-Darker variant with:
5350

54-
You can avoid these dependencies by disabling support for the specific themes with build options detailed below.
51+
meson setup --prefix=$HOME/.local -Dvariants=darker build/
5552

56-
##### Optional build dependencies
53+
The build options can later be changed with `meson configure` command, e.g.
5754

58-
The following packages are optional, but used to optimize the built theme if available:
59-
* `optipng` for optimizing PNG assets for GTK 2, GTK 3, and XFWM
55+
meson configure --prefix=/usr -Dvariants=light,darker build/
6056

61-
#### Runtime dependencies
57+
##### Build and install
6258

63-
For the GTK 2 theme to function properly, install the following:
64-
* `gnome-themes-extra`, or `gnome-themes-standard` before GNOME version 3.28
65-
* The murrine GTK 2 engine. This has different names depending on the distribution:
66-
* `gtk-engine-murrine` (Arch Linux)
67-
* `gtk2-engines-murrine` (Debian, Ubuntu, elementary OS)
68-
* `gtk-murrine-engine` (Fedora)
69-
* `gtk2-engine-murrine` (openSUSE)
70-
* `gtk-engines-murrine` (Gentoo)
59+
Build and install the theme according to your configuration by running the following:
7160

72-
## Versioned themes
61+
meson install -C build/
7362

74-
The source code comes branched for different versions of GTK 3, GNOME Shell, and Cinnamon. Only one version of those themes will be installed, and using the wrong versions will result in issues of varying severity.
63+
##### Note about installation in user's home directory
7564

76-
The theme versions that will be built can be set manually with build options. Otherwise the build system tries to determine correct versions using the following packages on the build environment:
77-
* `gnome-shell` for detecting GNOME Shell version
78-
* `cinnamon` for detecting Cinnamon version
79-
* the GTK 3 package, or its development files for distributions that ship those separately (e.g. `libgtk-3-dev` for Debian based distros or `gtk3-devel` for RPM based distros), for detecting GTK 3 version
65+
Some themes (at least GTK 2) aren't loaded from `~/.local/share/themes/`. You can work around this e.g. by symlinking the Arc theme directories in `~/.local/share/themes/` to `~/.themes/` with following commands:
8066

81-
The above packages are not required if the theme versions are defined manually (see build options below).
67+
mkdir -p ~/.themes/
68+
for d in Arc{,-Dark,-Darker,-Lighter}{,-solid}; do
69+
[ -d ~/.local/share/themes/$d ] && ln -s ~/.local/share/themes/$d ~/.themes/;
70+
done
8271

83-
**Note:** The build will fail, if GTK 3, Cinnamon, or GNOME Shell versions can't be determined. You can work around this by either disabling the build of a specific theme, or by specifying the versions manually with build options detailed below.
72+
#### Versioned themes
8473

85-
## Build options
74+
The source code comes branched for different versions of GTK 3, GNOME Shell, and Cinnamon. Only one version of those themes will be built and installed, and using the wrong versions will likely result in visual issues.
8675

87-
Options to pass to `autogen.sh`:
76+
The versions that will be built can be set manually with `cinnamon_version`, `gnome_shell_version` and `gtk3_version` build options.
8877

89-
--disable-transparency disable transparency in the theme
90-
--disable-light disable Arc Light support
91-
--disable-darker disable Arc Darker support
92-
--disable-dark disable Arc Dark support
93-
--disable-lighter disable Arc Lighter support
78+
Otherwise the build system tries to determine correct versions using the following packages on the build environment:
79+
* `gnome-shell` for detecting GNOME Shell version
80+
* `cinnamon` for detecting Cinnamon version
81+
* `pkgconf` and the GTK 3 package, or its development files for distributions that ship those separately (e.g. `libgtk-3-dev` for Debian based distros or `gtk3-devel` for RPM based distros), for detecting GTK 3 version
9482

95-
--disable-cinnamon disable Cinnamon support
96-
--disable-gnome-shell disable GNOME Shell support
97-
--disable-gtk2 disable GTK 2 support
98-
--disable-gtk3 disable GTK 3 support
99-
--disable-metacity disable Metacity support
100-
--disable-plank disable Plank support
101-
--disable-unity disable Unity support
102-
--disable-xfwm disable XFWM support
83+
**Note:** The build setup for GTK 3, Cinnamon and GNOME Shell themes will fail, if their versions can't be determined either from the build options, or from installed packages.
10384

104-
--with-cinnamon=<version> build the Cinnamon theme for a specific version
105-
--with-gnome-shell=<version> build the GNOME Shell theme for a specific version
106-
--with-gtk3=<version> build the GTK 3 theme for a specific version
85+
#### Build options
10786

108-
If the `--disable-transparency` option was used, the theme will be installed with `-solid` suffix.
87+
Arc-theme specific build options can be set or changed with `meson configure -Doption=value <build_directory>` e.g.
10988

110-
## Uninstallation
89+
meson configure -Dthemes=gtk3,plank,xfwm -Dtransparency=false -Dgtk3_version=3.24 build/
11190

112-
Run the following from the source code directory:
91+
Option | Default value | Description
92+
--- | --- | ---
93+
`themes` | `cinnamon,gnome-shell,gtk2,gtk3,metacity,plank,unity,xfwm` | List of themes to build
94+
`variants` | `light,darker,dark,lighter` | List of theme variants to build
95+
`transparency` | `true` | Enable or disable transparency
96+
`cinnamon_version` | - | Build Cinnamon theme for specific version
97+
`gnome_shell_version` | - | Build GNOME Shell theme for specific version
98+
`gtk3_version` | - | Build GTK 3 theme for specific version
11399

114-
make uninstall
100+
#### Uninstallation
115101

116-
Or simply remove the theme directories from your install location, e.g.
102+
Manually remove the theme directories from your install location, e.g.
117103

118104
rm -rf ~/.local/share/themes/Arc{,-Dark,-Darker,-Lighter}{,-solid}

common/cinnamon/meson.build

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# supported versions
2+
cinnamon_versions = ['2.8', '3.0', '3.2', '3.4', '3.6', '3.8', '4.0', '4.2', '4.4', '4.6', '4.8']
3+
4+
# cinnamon version
5+
cinnamon = find_program('cinnamon', required : false)
6+
7+
if get_option('cinnamon_version') != ''
8+
cinnamon_full_ver = get_option('cinnamon_version')
9+
elif cinnamon.found()
10+
cinnamon_full_ver = run_command(cinnamon, '--version').stdout().split()[-1]
11+
else
12+
error('Could not determine Cinnamon version')
13+
endif
14+
15+
cinnamon_ver_array = cinnamon_full_ver.split('.')
16+
if cinnamon_ver_array[1].to_int().is_even()
17+
cinnamon_ver = cinnamon_ver_array[0] + '.' + cinnamon_ver_array[1]
18+
else
19+
# evenize development versions
20+
cinnamon_ver = cinnamon_ver_array[0] + '.' + (cinnamon_ver_array[1].to_int() + 1).to_string()
21+
endif
22+
23+
if cinnamon_ver not in cinnamon_versions
24+
if cinnamon_ver.version_compare('>' + cinnamon_versions[-1])
25+
warning('Cinnamon version ' + cinnamon_ver + ' not supported yet, building theme for ' + cinnamon_versions[-1])
26+
cinnamon_ver = cinnamon_versions[-1]
27+
else
28+
error('Unsupported Cinnamon version')
29+
endif
30+
endif
31+
32+
# compile and install
33+
34+
sass_depend_files = run_command(
35+
'find', '-L',
36+
meson.current_source_dir() / cinnamon_ver / 'sass',
37+
'-name', '_*.scss',
38+
check : true
39+
).stdout().split()
40+
41+
foreach variant : get_option('variants')
42+
if variant != 'darker' and variant != 'lighter'
43+
input_scss = (variant == 'light' ? 'cinnamon.scss' : 'cinnamon-' + variant + '.scss')
44+
output_css = (variant == 'light' ? 'cinnamon.css' : 'cinnamon-' + variant + '.css')
45+
46+
cinnamon_css = custom_target(
47+
output_css,
48+
input : meson.current_source_dir() / cinnamon_ver / 'sass' / input_scss,
49+
output : output_css,
50+
command : [sassc, '@INPUT@', '@OUTPUT@'],
51+
build_by_default : true,
52+
depend_files : sass_depend_files
53+
)
54+
55+
meson.add_install_script(
56+
'sh', '-c',
57+
'install -DT' + ' ' +
58+
cinnamon_css.full_path() + ' ' +
59+
'$MESON_INSTALL_DESTDIR_PREFIX' / install_dir.get(variant) / common_dirs.get('cinnamon') / 'cinnamon.css'
60+
)
61+
62+
install_subdir(
63+
cinnamon_ver / 'common-assets',
64+
install_dir : prefix / install_dir.get(variant) / common_dirs.get('cinnamon')
65+
)
66+
67+
install_subdir(
68+
cinnamon_ver / variant + '-assets',
69+
install_dir : prefix / install_dir.get(variant) / common_dirs.get('cinnamon')
70+
)
71+
72+
install_data(
73+
variant == 'light' ? 'thumbnail.png' : 'thumbnail-dark.png',
74+
rename : 'thumbnail.png',
75+
install_dir : prefix / install_dir.get(variant) / common_dirs.get('cinnamon')
76+
)
77+
endif
78+
endforeach

0 commit comments

Comments
 (0)