Port of libarchive

Fixes #2528
This commit is contained in:
Norman Feske 2017-09-26 14:39:48 +02:00 committed by Christian Helmuth
parent ec6b23897f
commit 5574dd3465
7 changed files with 116 additions and 0 deletions

View File

@ -0,0 +1 @@
INC_DIR += $(call select_from_ports,libarchive)/include/libarchive

View File

@ -0,0 +1,27 @@
LIBARCHIVE_DIR = $(call select_from_ports,libarchive)/src/lib/libarchive
LIBS += libc zlib
INC_DIR += $(REP_DIR)/src/lib/libarchive $(LIBARCHIVE_DIR)
ALL_SRC_C := $(notdir $(wildcard $(LIBARCHIVE_DIR)/libarchive/*.c))
FILTER_OUT_SRC_C := archive_disk_acl_darwin.c \
archive_disk_acl_freebsd.c \
archive_disk_acl_linux.c \
archive_disk_acl_sunos.c \
archive_entry_copy_bhfi.c \
archive_read_disk_windows.c \
archive_windows.c \
archive_write_disk_windows.c \
filter_fork_posix.c
SRC_C := $(filter-out $(FILTER_OUT_SRC_C),$(ALL_SRC_C)) no_fork.c
vpath %.c $(LIBARCHIVE_DIR)/libarchive
vpath no_fork.c $(REP_DIR)/src/lib/libarchive
CC_OPT += -DPLATFORM_CONFIG_H=\"genode_config.h\"
CC_WARN += -Wno-unused-variable -Wno-int-conversion
SHARED_LIB = yes

View File

@ -0,0 +1 @@
1ae6249331057cf3c43664351644315ca399de6e

View File

@ -0,0 +1,11 @@
LICENSE := BSD
VERSION := 3.3.2
DOWNLOADS := libarchive.archive
URL(libarchive) := https://www.libarchive.org/downloads/libarchive-$(VERSION).tar.gz
SHA(libarchive) := 580064227105e30322caa6c67b59e8c8e6060027
DIR(libarchive) := src/lib/libarchive
DIRS := include/libarchive
DIR_CONTENT(include/libarchive) := $(addprefix src/lib/libarchive/libarchive/,\
archive.h archive_entry.h)

View File

@ -0,0 +1,8 @@
TARGET = untar
SRC_C = untar.c
LIBS += libarchive posix
CC_WARN += -Wno-unused-but-set-variable
LIBARCHIVE_DIR := $(call select_from_ports,libarchive)/src/lib/libarchive
vpath untar.c $(LIBARCHIVE_DIR)/examples

View File

@ -0,0 +1,39 @@
#ifndef _LIBARCHIVE__GENODE_CONFIG_H_
#define _LIBARCHIVE__GENODE_CONFIG_H_
#define HAVE_ZLIB_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRING_H 1
#define HAVE_ERRNO_H 1
#define HAVE_WCHAR_H 1
#define HAVE_STDINT_H 1
#define HAVE_UNISTD_H 1
#define HAVE_LIMITS_H 1
#define HAVE_FCNTL_H 1
#define HAVE_PWD_H 1
#define HAVE_GRP_H 1
#define HAVE_DIRENT_H 1
#define HAVE_SYS_WAIT_H 1
#define HAVE_CTYPE_H 1
#define HAVE_DECL_SIZE_MAX 1
#define HAVE_DECL_SSIZE_MAX 1
#define HAVE_DECL_UINT32_MAX 1
#define HAVE_DECL_INT32_MAX 1
#define HAVE_DECL_INT32_MIN 1
#define HAVE_DECL_UINT64_MAX 1
#define HAVE_DECL_INT64_MAX 1
#define HAVE_DECL_INT64_MIN 1
#define HAVE_DECL_UINTMAX_MAX 1
#define HAVE_DECL_INTMAX_MAX 1
#define HAVE_DECL_INTMAX_MIN 1
#define HAVE_WCSCPY 1
#define HAVE_WCSLEN 1
#define HAVE_ARC4RANDOM_BUF 1
#define HAVE_FCHDIR 1
#define HAVE_LSTAT 1
#define HAVE_SYS_UTSNAME_H 1
#endif /* _LIBARCHIVE__GENODE_CONFIG_H_ */

View File

@ -0,0 +1,29 @@
/*
* \brief Dummy stubs to satisfy the linking of libarchive
* \author Norman Feske
* \date 2017-09-26
*/
/*
* Copyright (C) 2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
pid_t __archive_create_child(const char *cmd, int *stdin, int *stdout)
{
printf("libarchive: __archive_create_child called but not implemented\n");
abort();
}
void __archive_check_child(int in, int out)
{
printf("libarchive: __archive_check_child called but not implemented\n");
abort();
}