diff options
author | Hans Hagen <pragma@wxs.nl> | 2021-05-06 23:50:45 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2021-05-06 23:50:45 +0200 |
commit | a2ebcf294b4f2b10a3ecef1d1d3c7de7694c498c (patch) | |
tree | e8ab07688ae40a3999caa3a9ca75beba1c827449 /tex/context/base/mkxl/libs-imp-lzo.lmt | |
parent | 52c91dd191d7bd30d41aaf259480ee862160a251 (diff) | |
download | context-a2ebcf294b4f2b10a3ecef1d1d3c7de7694c498c.tar.gz |
2021-05-06 23:34:00
Diffstat (limited to 'tex/context/base/mkxl/libs-imp-lzo.lmt')
-rw-r--r-- | tex/context/base/mkxl/libs-imp-lzo.lmt | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tex/context/base/mkxl/libs-imp-lzo.lmt b/tex/context/base/mkxl/libs-imp-lzo.lmt new file mode 100644 index 000000000..1cc84a9e3 --- /dev/null +++ b/tex/context/base/mkxl/libs-imp-lzo.lmt @@ -0,0 +1,37 @@ +if not modules then modules = { } end modules ['libs-imp-lzo'] = { + version = 1.001, + comment = "companion to luat-lib.mkxl", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +-- https://packages.msys2.org/package/mingw-w64-x86_64-lzo2?repo=mingw64 + +local libname = "lzo" +local libfile = "liblzo" + +local lzolib = resolvers.libraries.validoptional(libname) + +if not lzolib then return end + +local lzo_compress = lzolib.compress +local lzo_decompresssize = lzolib.decompresssize + +local function okay() + if resolvers.libraries.optionalloaded(libname,libfile) then + okay = function() return true end + else + okay = function() return false end + end + return okay() +end + +local lzo = { + compress = function (...) return okay() and lzo_compress (...) end, + decompresssize = function (...) return okay() and lzo_decompresssize(...) end, +} + +package.loaded[libname] = lzo + +return lzo |