Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
*.depend
*.o
*.a
*.d
*.so
*.orig
*.rej
*.bak
*.swp
*~
,*
\#*\#
.\#*
\#_*\#
.\#_*
!.gitignore
.*

# gnu global files
GPATH
GRTAGS
GSYMS
GTAGS

# cscope files
cscope.*
ncscope.*
4 changes: 4 additions & 0 deletions CODING_STYLE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Coding Style
============

Please refer to the `CODING_STYLE.md` file in the main Unikraft repository.
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Contributing to Unikraft
========================

Please refer to the `CONTRIBUTING.md` file in the main Unikraft repository.
38 changes: 38 additions & 0 deletions COPYING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
License
=======

Unikraft lcms wrappers
------------------------

This repository contains wrapper code to build openjpeg with Unikraft. The code
is published as a mixture of BSD and MIT licences; each C code file in
this repository should declare who is the copyright owner and under which terms
and conditions the code is licensed. If such a licence note is missing, the
following copyright notice will apply:

Copyright (c) 2020, Consorci de Serveis Universitaris de Catalunya (CSUC). All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
11 changes: 11 additions & 0 deletions Config.uk
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
config LIBOPENJPEG
bool "libopenjpeg - image compression standard"
default n
Comment on lines +2 to +3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- bool "libopenjpeg - image compression standard"
+ bool "libopenjpeg: Image compression standard"

select LIBNOLIBC if !HAVE_LIBC
select LIBUKDEBUG
select LIBUKALLOC
select LIBPTHREAD_EMBEDDED
select LIBNEWLIBC

if LIBOPENJPEG
endif
11 changes: 11 additions & 0 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Maintainers List
================

For notes on how to read this information, please refer to `MAINTAINERS.md` in
the main Unikraft repository.

LCMS-UNIKRAFT
M: Esteban Martinez <[email protected]>
M: Xavier Peralra <[email protected]>
L: [email protected]
F: *
Comment on lines +1 to +11
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this file, it is now deprecated. :) We will add names to our governance repository instead.

125 changes: 125 additions & 0 deletions Makefile.uk
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# SPDX-License-Identifier: BSD-3-Clause
#
# openjpeg Makefile.uk
#
# Authors: Esteban Martinez <[email protected]>
#
# Copyright (c) 2019, Consorci de Serveis Universitaris de Catalunya (CSUC). All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY.
#
Comment on lines +33 to +35
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove these lines. Please see this explanation as to why.


################################################################################
# Library registration
################################################################################
$(eval $(call addlib_s,libopenjpeg,$(CONFIG_LIBOPENJPEG)))

################################################################################
# Original sources
################################################################################
LIBOPENJPEG_VERSION=2.3.1
LIBOPENJPEG_URL=https://github.com/python-pillow/pillow-depends/raw/master/openjpeg-$(LIBOPENJPEG_VERSION).tar.gz
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a weird place to get the archive from. IS there anything else more official?

Maybe https://github.com/uclouvain/openjpeg?

Also, it does not resolve and the fetch stage fails:

tar (child): /usr/src/unikraft/apps/helloworld/build/libopenjpeg/openjpeg-2.3.1.tar.gz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now

LIBOPENJPEG_PATCHDIR=$(LIBOPENJPEG_BASE)/patches
LIBOPENJPEG_SUBDIR=openjpeg-$(LIBOPENJPEG_VERSION)
$(eval $(call fetch,libopenjpeg,$(LIBOPENJPEG_URL)))
$(eval $(call patch,libopenjpeg,$(LIBOPENJPEG_PATCHDIR),$(LIBOPENJPEG_SUBDIR)))

################################################################################
# Helpers
################################################################################
LIBOPENJPEG_EXTRACTED = $(LIBOPENJPEG_ORIGIN)/$(LIBOPENJPEG_SUBDIR)

################################################################################
# Library includes
################################################################################
LIBOPENJPEG_COMMON_INCLUDES-y += -I$(LIBOPENJPEG_EXTRACTED)/src/lib
LIBOPENJPEG_COMMON_INCLUDES-y += -I$(LIBOPENJPEG_EXTRACTED)/src/lib/openjp2
LIBOPENJPEG_COMMON_INCLUDES-y += -I$(LIBOPENJPEG_EXTRACTED)/src/bin/common
LIBOPENJPEG_COMMON_INCLUDES-y += -I$(LIBOPENJPEG_EXTRACTED)/build/src/lib
LIBOPENJPEG_COMMON_INCLUDES-y += -I$(LIBOPENJPEG_EXTRACTED)/build/src/lib/openjp2
LIBOPENJPEG_COMMON_INCLUDES-y += -I$(LIBOPENJPEG_EXTRACTED)/build/src/bin/common
LIBOPENJPEG_COMMON_INCLUDES-y += -I$(LIBOPENJPEG_BASE)/include

CINCLUDES-$(CONFIG_LIBOPENJPEG) += $(LIBOPENJPEG_COMMON_INCLUDES-y)
CXXINCLUDES-$(CONFIG_LIBOPENJPEG) += $(LIBOPENJPEG_COMMON_INCLUDES-y)

LIBOPENJPEG_CINCLUDES += -I$(LIBOPENJPEG_EXTRACTED)

################################################################################
# Global flags
################################################################################
# Suppressed flags
LIBOPENJPEG_SUPPRESS_FLAGS += -Wno-unused-parameter \
-Wno-unused-variable -Wno-unused-value -Wno-unused-function \
-Wno-missing-field-initializers -Wno-implicit-fallthrough \
-Wno-misleading-indentation -Wno-stringop-truncation \
-Wno-strict-aliasing
LIBOPENJPEG_CFLAGS-y += $(LIBOPENJPEG_SUPPRESS_FLAGS) \
-Wno-pointer-to-int-cast -Wno-int-to-pointer-cast \
-Wno-misleading-indentation -Wno-stringop-truncation \
-Wno-strict-aliasing

################################################################################
# OPENJPEG src
################################################################################
LIBOPENJPEG_SRCS-y += $(LIBOPENJPEG_EXTRACTED)/src/lib/openjp2/thread.c
LIBOPENJPEG_SRCS-y += $(LIBOPENJPEG_EXTRACTED)/src/lib/openjp2/bio.c
LIBOPENJPEG_SRCS-y += $(LIBOPENJPEG_EXTRACTED)/src/lib/openjp2/cio.c
LIBOPENJPEG_SRCS-y += $(LIBOPENJPEG_EXTRACTED)/src/lib/openjp2/dwt.c
LIBOPENJPEG_SRCS-y += $(LIBOPENJPEG_EXTRACTED)/src/lib/openjp2/event.c
LIBOPENJPEG_SRCS-y += $(LIBOPENJPEG_EXTRACTED)/src/lib/openjp2/image.c
LIBOPENJPEG_SRCS-y += $(LIBOPENJPEG_EXTRACTED)/src/lib/openjp2/invert.c
LIBOPENJPEG_SRCS-y += $(LIBOPENJPEG_EXTRACTED)/src/lib/openjp2/j2k.c
LIBOPENJPEG_SRCS-y += $(LIBOPENJPEG_EXTRACTED)/src/lib/openjp2/jp2.c
LIBOPENJPEG_SRCS-y += $(LIBOPENJPEG_EXTRACTED)/src/lib/openjp2/mct.c
LIBOPENJPEG_SRCS-y += $(LIBOPENJPEG_EXTRACTED)/src/lib/openjp2/mqc.c
LIBOPENJPEG_SRCS-y += $(LIBOPENJPEG_EXTRACTED)/src/lib/openjp2/openjpeg.c
LIBOPENJPEG_SRCS-y += $(LIBOPENJPEG_EXTRACTED)/src/lib/openjp2/opj_clock.c
LIBOPENJPEG_SRCS-y += $(LIBOPENJPEG_EXTRACTED)/src/lib/openjp2/pi.c
LIBOPENJPEG_SRCS-y += $(LIBOPENJPEG_EXTRACTED)/src/lib/openjp2/t1.c
LIBOPENJPEG_SRCS-y += $(LIBOPENJPEG_EXTRACTED)/src/lib/openjp2/t2.c
LIBOPENJPEG_SRCS-y += $(LIBOPENJPEG_EXTRACTED)/src/lib/openjp2/tcd.c
LIBOPENJPEG_SRCS-y += $(LIBOPENJPEG_EXTRACTED)/src/lib/openjp2/tgt.c
LIBOPENJPEG_SRCS-y += $(LIBOPENJPEG_EXTRACTED)/src/lib/openjp2/function_list.c
LIBOPENJPEG_SRCS-y += $(LIBOPENJPEG_EXTRACTED)/src/lib/openjp2/opj_malloc.c
LIBOPENJPEG_SRCS-y += $(LIBOPENJPEG_EXTRACTED)/src/lib/openjp2/sparse_array.c

################################################################################
# OPENJPEG prepare
################################################################################
# Run ./configure
$(LIBOPENJPEG_EXTRACTED)/config.status: $(LIBOPENJPEG_BUILD)/.origin
$(call verbose_cmd,CONFIG,libopenjpeg: $(notdir $@), \
cd $(LIBOPENJPEG_EXTRACTED) && mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release)

LIBOPENJPEG_PREPARED_DEPS = \
$(LIBOPENJPEG_EXTRACTED)/config.status \

$(LIBOPENJPEG_BUILD)/.prepared: $(LIBOPENJPEG_PREPARED_DEPS)
Comment on lines +115 to +123
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These step needs to be removed. What is required from the configure step are the any configuration header files which need to be explicitly created and placed within a top-level include/ directory of this repo. The directory and corresponding header file should be referenced via LIBOPENJPEG_COMMON_INCLUDES. It's options need be checked and must correspond with what is compatible with Unikraft.

Also this step fails for me entirely.


UK_PREPARE += $(LIBOPENJPEG_BUILD)/.prepared
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
# lib-openjpeg
Unikraft port of openjpeg, a library for encoding and decoding JPEG image files
lcms for Unikraft
=============================

This is the port of openjpeg for Unikraft as external library.

Please refer to the `README.md` as well as the documentation in the `doc/`
subdirectory of the main unikraft repository.
Loading