From 29cacf984201df71ba0b742f3d804fd56a11a8ff Mon Sep 17 00:00:00 2001 From: Hartmut Goebel Date: Mon, 8 May 2017 16:09:23 +0200 Subject: gnu: Add libetc1. * gnu/packages/android.scm (libetc1): New variable. --- gnu/packages/android.scm | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm index 365353abfa..8e37b51d2c 100644 --- a/gnu/packages/android.scm +++ b/gnu/packages/android.scm @@ -767,6 +767,54 @@ for Android. More precicely the headers from include/android in platform/frameworks/native.") (license license:asl2.0))) +(define-public libetc1 + (package + (name "libetc1") + (version (android-platform-version)) + (source (android-platform-frameworks-native version)) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ; no tests + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'create-Makefile + (lambda _ + ;; No useful makefile is shipped, so we create one. + (with-output-to-file "Makefile" + (lambda _ + (display + (string-append + "NAME = libETC1\n" + "SOURCES = opengl/libs/ETC1/etc1.cpp\n" + "CXXFLAGS += -fPIC\n" + "CPPFLAGS += -Iopengl/include\n" + "LDFLAGS += -shared -Wl,-soname,$(NAME).so.0\n" + "$(NAME).so.0: $(SOURCES)\n" + " $(CXX) $^ -o $@ $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS)\n" + "build: $(NAME).so.0")) + #t)))) + (add-after 'unpack 'remove-unused-stuff-to-reduce-warnings + (lambda _ + (delete-file-recursively "opengl/libs/tools"))) + (delete 'configure) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (lib (string-append out "/lib")) + (include (string-append out "/include"))) + (install-file "libETC1.so.0" lib) + (with-directory-excursion lib + (symlink "libETC1.so.0" "libETC1.so")) + (copy-recursively "opengl/include/ETC1" + (string-append include "/ETC1")))))))) + (home-page "https://android.googlesource.com/platform/frameworks/native/") + (synopsis "ETC1 compression library") + (description "Ericsson Texture Compression (ETC) is a lossy texture +compression technique developed in collaboration with Ericsson Research in +early 2005. libETC1 provides the encoding and decoding of ETC1 compression +algorithm.") + (license license:asl2.0))) + (define-public git-repo (package (name "git-repo") -- cgit v1.2.3