]> git.draconx.ca Git - gentoo-draconx.git/blobdiff - sys-libs/flashmap/flashmap-20160808.ebuild
Add mosys ebuild.
[gentoo-draconx.git] / sys-libs / flashmap / flashmap-20160808.ebuild
diff --git a/sys-libs/flashmap/flashmap-20160808.ebuild b/sys-libs/flashmap/flashmap-20160808.ebuild
new file mode 100644 (file)
index 0000000..875200a
--- /dev/null
@@ -0,0 +1,45 @@
+# Copyright © 2017 Nick Bowler
+# License GPLv3+: GNU General Public License version 3 or later.
+# There is NO WARRANTY, to the extent permitted by law.
+
+EAPI=6
+
+inherit toolchain-funcs multilib-minimal
+
+# Github repo has no release tags, and chromium repo has no stable
+# download archives.  Fun times.
+SHA1=976420e9ecae3c3933d5e59e67a4debad751d003
+MY_P=$PN-$SHA1
+
+DESCRIPTION="library for manipulating flashmap data structure used in ChromiumOS"
+HOMEPAGE="https://github.com/dhendrix/flashmap"
+SRC_URI="https://github.com/dhendrix/$PN/archive/$SHA1.tar.gz -> $MY_P.tar.gz"
+
+LICENSE="|| ( BSD GPL-2 )"
+SLOT=0
+KEYWORDS="~amd64 ~arm"
+
+PATCHES=(
+       "$FILESDIR/$PN-respect-CFLAGS-LDFLAGS.patch"
+       "$FILESDIR/$PN-respect-AR.patch"
+       "$FILESDIR/$PN-dont-set-make.patch"
+       "$FILESDIR/$PN-no-static-libs.patch"
+       "$FILESDIR/$PN-split-install.patch"
+)
+
+S=$WORKDIR/$MY_P
+
+src_prepare () {
+       default_src_prepare
+       multilib_copy_sources
+}
+
+multilib_src_compile () {
+       local progs=$(multilib_is_native_abi || echo PROGRAMS=)
+       emake CC="$(tc-getCC)" AR="$(tc-getAR)" $progs || die
+}
+
+multilib_src_install () {
+       local target=$(multilib_is_native_abi || echo _lib)
+       emake DESTDIR="$D" LIBDIR="$(get_libdir)" install$target || die
+}