Skip to content

Instantly share code, notes, and snippets.

@jbergstroem
Created March 21, 2014 10:17
Show Gist options
  • Select an option

  • Save jbergstroem/9683224 to your computer and use it in GitHub Desktop.

Select an option

Save jbergstroem/9683224 to your computer and use it in GitHub Desktop.
lua-cmsgpack-9999.ebuild
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=5
inherit toolchain-funcs multilib git-2
DESCRIPTION="A self contained Lua MessagePack C implementation"
HOMEPAGE="https://github.com/antirez/lua-cmsgpack"
EGIT_REPO_URI="git://github.com/antirez/lua-cmsgpack.git"
MY_PN="${PN/-/_}"
MY_MODULE="${MY_PN#*_}"
LICENSE="BSD-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="test"
RDEPEND=">=dev-lang/lua-5.1"
DEPEND="${RDEPEND}"
DOCS=( README.md )
src_compile() {
$(tc-getCC) -fPIC -I/usr/include ${CFLAGS} -c -o ${MY_PN}.o ${MY_PN}.c || die
$(tc-getCC) ${LDFLAGS} -L/usr/$(get_libdir) -shared -o ${MY_MODULE}.so ${MY_PN}.o || die
}
src_test() {
lua test.lua
}
src_install() {
insinto $($(tc-getPKG_CONFIG) --variable INSTALL_CMOD lua)
doins ${MY_MODULE}.so
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment