Skip to content

Commit

Permalink
Merge pull request gentoo#371 from gentoo90/xi
Browse files Browse the repository at this point in the history
Add app-editor/xi-core and app-editor/xi-gtk live ebuilds
  • Loading branch information
cnd authored Oct 2, 2018
2 parents 360e088 + c74ae23 commit 466f6f4
Show file tree
Hide file tree
Showing 5 changed files with 134 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app-editors/xi-core/metadata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>[email protected]</email>
</maintainer>
<longdescription>A modern editor with a backend written in Rust</longdescription>
<use>
<flag name="syntect">Enable syntax highlighting plugin</flag>
</use>
</pkgmetadata>
52 changes: 52 additions & 0 deletions app-editors/xi-core/xi-core-9999.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit cargo git-r3

DESCRIPTION="A modern editor with a backend written in Rust"
HOMEPAGE="https://xi-editor.github.io/xi-editor/"

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS=""
IUSE="+syntect"
RESTRICT="network-sandbox"

EGIT_REPO_URI="https://github.com/xi-editor/xi-editor.git"

DEPEND=""
RDEPEND=""

S=${WORKDIR}/${P}/rust

src_compile() {
debug-print-function ${FUNCNAME} "$@"

export CARGO_HOME="${ECARGO_HOME}"

cargo build -v -j $(makeopts_jobs) $(usex debug "" --release) \
|| die "cargo build failed"

if use syntect; then
cargo build -v -j $(makeopts_jobs) $(usex debug "" --release) --manifest-path syntect-plugin/Cargo.toml \
|| die "cargo build failed"
fi
}

src_install() {
einfo "PWD = $(pwd)"
debug-print-function ${FUNCNAME} "$@"

cargo install -j $(makeopts_jobs) --root="${D}/usr" $(usex debug --debug "") \
|| die "cargo install failed"
rm -f "${D}/usr/.crates.toml"

if use syntect; then
insinto /usr/share/xi/plugins/syntect
doins syntect-plugin/manifest.toml
exeinto /usr/share/xi/plugins/syntect/bin
doexe target/release/xi-syntect-plugin
fi
}
24 changes: 24 additions & 0 deletions app-editors/xi-gtk/files/xi-gtk-9999-datasubdir.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
diff --git a/meson.build b/meson.build
index d55c4c7..c0ef38e 100644
--- a/meson.build
+++ b/meson.build
@@ -25,7 +25,7 @@ dependencies = [
]

config = configuration_data()
-config.set_quoted('PLUGIN_DIR', join_paths(get_option('prefix'), get_option('datadir'), 'xi-gtk', 'plugins'))
+config.set_quoted('PLUGIN_DIR', join_paths(get_option('prefix'), get_option('datadir'), get_option('datasubdir'), 'plugins'))
configure_file(configuration: config, output: 'config.h')
dependencies += meson.get_compiler('vala').find_library('config', dirs: meson.current_source_dir())

diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..0382e40
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,2 @@
+option('datasubdir', type : 'string', value : 'xi-gtk',
+ description: 'Name of the directory in datadir where plugins should be installed')
--
2.16.4

8 changes: 8 additions & 0 deletions app-editors/xi-gtk/metadata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>[email protected]</email>
</maintainer>
<longdescription>A GTK+ front-end for the Xi editor</longdescription>
</pkgmetadata>
39 changes: 39 additions & 0 deletions app-editors/xi-gtk/xi-gtk-9999.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit meson vala git-r3

DESCRIPTION="A GTK+ front-end for the Xi editor"
HOMEPAGE="https://github.com/eyelash/xi-gtk"

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS=""
IUSE=""
RESTRICT="network-sandbox"

EGIT_REPO_URI="https://github.com/eyelash/xi-gtk.git"

DEPEND="$(vala_depend)
>=x11-libs/gtk+-3.20.0
dev-libs/json-glib"
RDEPEND="${DEPEND}
=app-editors/xi-core-9999"

PATCHES=(
"${FILESDIR}/xi-gtk-9999-datasubdir.patch"
)

src_prepare() {
default
vala_src_prepare
}

src_configure() {
local emesonargs=(
-Ddatasubdir="xi"
)
meson_src_configure
}

0 comments on commit 466f6f4

Please sign in to comment.