Skip to content

Instantly share code, notes, and snippets.

@michal-h21
Created November 16, 2015 18:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michal-h21/26fdc64f86b5cb54977f to your computer and use it in GitHub Desktop.
Save michal-h21/26fdc64f86b5cb54977f to your computer and use it in GitHub Desktop.
Luarock for justeneoughharfbuzz compilation
Copy justenoughharfbuzz.c to the directory with these files. Compile it with
luarocks make justenoughharfbuzz-0-1.rockspec HARFBUZZ_INCDIR=/usr/include/harfbuzz/ FREETYPE_INCDIR=/usr/include/freetype2/
use real directories with headers for Harfbuzz and Freetype, these above work on Fedora.
package = "JustEnoughHarfbuzz"
version = "0-1"
source = {
url = "..." -- We don't have one yet
}
description = {
summary = "An example for the LuaRocks tutorial.",
detailed = [[
This is an example for the LuaRocks tutorial.
Here we would put a detailed, typically
paragraph-long description.
]],
homepage = "http://...", -- We don't have one yet
license = "MIT/X11" -- or whatever you like
}
dependencies = {
"lua ~> 5.2"
-- If you depend on other rocks, add them here
}
build = {
type="make",
build_variables = {
CFLAGS="$(CFLAGS)",
LIBFLAG="$(LIBFLAG)",
LUA_LIBDIR="$(LUA_LIBDIR)",
LUA_BINDIR="$(LUA_BINDIR)",
LUA_INCDIR="$(LUA_INCDIR)",
HARFBUZZ_INCDIR = "$(HARFBUZZ_INCDIR)",
FREETYPE_INCDIR = "$(FREETYPE_INCDIR)",
LUA="$(LUA)",
},
install_variables = {
INST_PREFIX="$(PREFIX)",
INST_BINDIR="$(BINDIR)",
INST_LIBDIR="$(LIBDIR)",
INST_LUADIR="$(LUADIR)",
INST_CONFDIR="$(CONFDIR)",
},
}
-- external_dependencies = {
-- HARFBUZZ = {
-- library = "harfbuzz",
-- header = "hb.h"
-- },
-- FREETYPE = {
-- library = "freetype"
-- }
-- }
all: justenoughharfbuzz.so
justenoughharfbuzz.so: justenoughharfbuzz.o
$(CC) $(LIBFLAG) -lharfbuzz $< -o $@
justenoughharfbuzz.o: justenoughharfbuzz.c
$(CC) -c $(CFLAGS) -I$(HARFBUZZ_INCDIR) -I$(FREETYPE_INCDIR) $< -o $@
install:
@echo Install justenoughharfbuzz
@cp justenoughharfbuzz.so $(INST_LIBDIR)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment