Skip to content

Instantly share code, notes, and snippets.

@yan12125 yan12125/Makefile
Created Apr 30, 2017

Embed
What would you like to do?
simg2img-git
diff --git a/libsparse/sparse_read.cpp b/libsparse/sparse_read.cpp
index bd668735a..6168f2e24 100644
--- a/libsparse/sparse_read.cpp
+++ b/libsparse/sparse_read.cpp
@@ -26,6 +26,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string>
+#include <string.h>
#include <unistd.h>
#include <sparse/sparse.h>
COMMON_OBJECTS=sparse_crc32.o \
backed_block.o \
output_file.o \
sparse.o \
sparse_err.o \
sparse_read.o \
stringprintf.o
TARGETS=simg2img \
append2simg \
img2simg \
simg2simg
CFLAGS=-Iinclude -I../base/include
CXXFLAGS=$(CFLAGS)
.PHONY: all
all: $(TARGETS)
%: %.o $(COMMON_OBJECTS)
g++ -o $@ $^ -lz
%.o: %.c
gcc -o $@ $(CFLAGS) -c $<
stringprintf.o: ../base/stringprintf.cpp
g++ -o $@ $(CXXFLAGS) -c $<
%.o: %.cpp
g++ -o $@ $(CXXFLAGS) -c $<
# Maintainer: Christoph Scholz <christoph.scholz@gmail.com>
pkgname=simg2img-git
pkgver=r29490.4c8acafa2
pkgrel=1
pkgdesc="Tools to handle/convert Android sparse image file"
arch=('i686' 'x86_64')
url="https://android.googlesource.com/platform/system/core"
license=('Apache')
depends=('zlib')
makedepends=('git')
source=("git+https://android.googlesource.com/platform/system/core"
Makefile
fix-missing-memset.patch)
md5sums=('SKIP'
'b817669fdfc1fbcce0756bcbd0b3a6ee'
'93b67200bdd2fde3c0a2ef32351417be')
pkgver() {
cd "${srcdir}/core/libsparse"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
prepare() {
cd "${srcdir}/core"
patch -Np1 -i ../fix-missing-memset.patch
}
build() {
cd "${srcdir}/core/libsparse"
make -f "${srcdir}/Makefile" --no-builtin-rules
}
package() {
cd "${srcdir}/core/libsparse"
install -D -m 755 -t "${pkgdir}/usr/bin/" simg2img append2simg img2simg simg2simg
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.