diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..2ff0dfd --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "submodules/cinnamon-desktop"] + path = submodules/cinnamon-desktop + url = https://github.com/linuxmint/cinnamon-desktop diff --git a/PKGBUILD b/PKGBUILD index 7a9961c..558fe4e 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -26,6 +26,9 @@ depends=( ) makedepends=( python-setuptools + meson-python + ninja + meson git ) optdepends=( @@ -39,14 +42,21 @@ conflicts=( ) source=(git+http://github.com/Fabric-Development/$reponame.git) + sha256sums=("SKIP") +prepare() { + cd "$srcdir/$reponame" + git submodule update --init +} + build() { cd "$srcdir/$reponame" - python setup.py build + meson --prefix=/usr build + ninja -C build } package() { cd "$srcdir/$reponame" - python setup.py install --root="$pkgdir/" --optimize=1 + DESTDIR="$pkgdir" meson install -C build } diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..63d2756 --- /dev/null +++ b/meson.build @@ -0,0 +1,37 @@ +project('fabric', 'c', version: '0.0.1') + +if build_machine.system() == 'windows' + error('fabric is not meant for windows users, consider moving to linux.') +endif + +pymod = import('python') +python = pymod.find_installation( + 'python3', + modules: [ + 'gi', + 'cairo', + 'loguru', + 'click', + ], +) + +if python.language_version().version_compare('<3.8') + error('at least Python 3.8 is required, Python 3.11 is recommended though.') +endif + +dependency('cairo') +dependency('gtk+-3.0') +dependency('py3cairo') +dependency('pygobject-3.0') +dependency('cairo-gobject') +dependency('gtk-layer-shell-0') +dependency('gobject-introspection-1.0') + +patch = find_program('patch', required: true) +run_command(patch, 'submodules/cinnamon-desktop/libcvc/meson.build', 'submodules/libcvc.patch') + +install_subdir( + meson.project_name(), + install_dir: python.get_install_dir() +) +subdir('submodules/cinnamon-desktop/libcvc') diff --git a/scripts/install_libcvc/install_libcvc.sh b/scripts/install_libcvc/install_libcvc.sh index fedcfee..a0315be 100755 --- a/scripts/install_libcvc/install_libcvc.sh +++ b/scripts/install_libcvc/install_libcvc.sh @@ -1,11 +1,12 @@ # !/usr/bin/env bash +# a script to install libcvc manually + cinnamon_git="https://github.com/linuxmint/cinnamon-desktop" cinnamon_git_name="cinnamon-desktop" cwd="$(pwd)" pre_check_exists() { - # check if Cvc typelibs are installed echo "checking if libcvc is already installed..." if ls /usr/lib/girepository-1.0/Cvc-1.0.typelib 1> /dev/null 2>&1; then diff --git a/submodules/cinnamon-desktop b/submodules/cinnamon-desktop new file mode 160000 index 0000000..b554c49 --- /dev/null +++ b/submodules/cinnamon-desktop @@ -0,0 +1 @@ +Subproject commit b554c49ba646b53548d3d43d4e7e6aeb5db87bc6 diff --git a/submodules/libcvc.patch b/submodules/libcvc.patch new file mode 100644 index 0000000..34e4672 --- /dev/null +++ b/submodules/libcvc.patch @@ -0,0 +1,41 @@ +0a1,36 +> use_alsa = false +> conf = configuration_data() +> systemd = dependency('libsystemd', required: false) +> pkgconfig = import('pkgconfig') +> gnome = import('gnome') +> cc = meson.get_compiler('c') +> +> timerfd_check = cc.compiles(''' +> #include +> #include +> int main () { +> timerfd_create (CLOCK_MONOTONIC, TFD_CLOEXEC); +> return 0; +> } +> ''') +> +> gettext_package = meson.project_name() +> conf.set_quoted('GETTEXT_PACKAGE', gettext_package) +> conf.set_quoted('GNOMELOCALEDIR', join_paths(get_option('prefix'), get_option('localedir'))) +> conf.set_quoted('PACKAGE_VERSION', meson.project_version()) +> +> conf.set('HAVE_BIND_TEXTDOMAIN_CODESET', cc.has_function('bind_textdomain_codeset')) +> conf.set('datadir', get_option('datadir')) +> conf.set('ENABLE_NLS', cc.has_header('libintl.h')) +> conf.set('HAVE_ALSA', use_alsa) +> conf.set('HAVE_GETTEXT', true) +> conf.set('HAVE_INTROSPECTION', true) +> conf.set('HAVE_SYSTEMD', systemd.found()) +> conf.set('HAVE_TIMERFD', timerfd_check) +> +> configure_file( +> output: 'config.h', +> configuration: conf +> ) +> +> +52c88 +< include_directories: rootInclude, +--- +> include_directories: include_directories('.'),