summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorHartmut Goebel <h.goebel@crazy-compilers.com>2017-05-08 16:09:23 +0200
committerHartmut Goebel <h.goebel@crazy-compilers.com>2022-01-15 21:20:15 +0100
commit29cacf984201df71ba0b742f3d804fd56a11a8ff (patch)
tree5b351e5f3b269efeea01c91c4bd315c5e87be0a2 /gnu
parent2c3ac9f7221849da89b4e00085d138d3ea28b735 (diff)
gnu: Add libetc1.
* gnu/packages/android.scm (libetc1): New variable.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/android.scm48
1 files changed, 48 insertions, 0 deletions
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")