summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2014-03-31 08:34:10 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2014-03-31 08:34:10 +0200
commitcb9fe14b5d677e89ed10ed70f1241932219f1fc6 (patch)
tree9b86656b2ebcb8e204891fd7ede0ba39e0ce9bdf /package
parent77dd9c466922fad94a8514f071a4bc87fc2ed0a9 (diff)
parent5ef2d4473e58df0f12f804a691094d70c3f13ad1 (diff)
Merge branch 'master' of git+ssh://openadk.org/git/openadk
Diffstat (limited to 'package')
-rw-r--r--package/adk-helper/Makefile (renamed from package/mkcrypt/Makefile)10
-rw-r--r--package/adk-helper/src/dkgetsz.c95
-rw-r--r--package/adk-helper/src/mkcrypt.c (renamed from package/mkcrypt/src/mkcrypt.c)0
-rw-r--r--package/pixman/Makefile8
-rw-r--r--package/pixman/patches/patch-Makefile_in11
5 files changed, 116 insertions, 8 deletions
diff --git a/package/mkcrypt/Makefile b/package/adk-helper/Makefile
index 6f8f873a7..7d0ccb202 100644
--- a/package/mkcrypt/Makefile
+++ b/package/adk-helper/Makefile
@@ -3,10 +3,10 @@
include ${TOPDIR}/rules.mk
-PKG_NAME:= mkcrypt
+PKG_NAME:= adk-helper
PKG_VERSION:= 1.0
PKG_RELEASE:= 1
-PKG_DESCR:= mkcrypt utility
+PKG_DESCR:= adk helper utilities
PKG_SECTION:= misc
PKG_CFLINE_MKCRYPT:= depends on ADK_HOST_ONLY
@@ -16,16 +16,18 @@ NO_DISTFILES:= 1
include ${TOPDIR}/mk/host.mk
include ${TOPDIR}/mk/package.mk
-$(eval $(call HOST_template,MKCRYPT,mkcrypt,${PKG_VERSION}-${PKG_RELEASE}))
+$(eval $(call HOST_template,ADK_HELPER,adk-helper,${PKG_VERSION}-${PKG_RELEASE}))
HOST_STYLE:= manual
host-build:
$(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) -o ${WRKBUILD}/mkcrypt ${WRKBUILD}/mkcrypt.c
+ $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) -o ${WRKBUILD}/dkgetsz ${WRKBUILD}/dkgetsz.c
-mkcrypt-hostinstall:
+adk-helper-hostinstall:
${INSTALL_DIR} ${STAGING_HOST_DIR}/usr/bin
${INSTALL_BIN} ${WRKBUILD}/mkcrypt ${STAGING_HOST_DIR}/usr/bin
+ ${INSTALL_BIN} ${WRKBUILD}/dkgetsz ${STAGING_HOST_DIR}/usr/bin
include ${TOPDIR}/mk/host-bottom.mk
include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/adk-helper/src/dkgetsz.c b/package/adk-helper/src/dkgetsz.c
new file mode 100644
index 000000000..b8315be70
--- /dev/null
+++ b/package/adk-helper/src/dkgetsz.c
@@ -0,0 +1,95 @@
+/*-
+ * Copyright © 2010
+ * Waldemar Brodkorb <wbx@openadk.org>
+ * Thorsten Glaser <tg@mirbsd.org>
+ *
+ * Provided that these terms and disclaimer and all copyright notices
+ * are retained or reproduced in an accompanying document, permission
+ * is granted to deal in this work without restriction, including un‐
+ * limited rights to use, publicly perform, distribute, sell, modify,
+ * merge, give away, or sublicence.
+ *
+ * This work is provided “AS IS” and WITHOUT WARRANTY of any kind, to
+ * the utmost extent permitted by applicable law, neither express nor
+ * implied; without malicious intent or gross negligence. In no event
+ * may a licensor, author or contributor be held liable for indirect,
+ * direct, other damage, loss, or other issues arising in any way out
+ * of dealing in the work, even if advised of the possibility of such
+ * damage or existence of a defect, except proven that it results out
+ * of said person’s immediate fault when using the work as intended.
+ *
+ * Alternatively, this work may be distributed under the terms of the
+ * General Public License, any version, as published by the Free Soft-
+ * ware Foundation.
+ *-
+ * Display the size of a block device (e.g. USB stick, CF/SF/MMC card
+ * or hard disc) in 512-byte sectors.
+ */
+
+#define _FILE_OFFSET_BITS 64
+
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/mount.h>
+
+#if defined(__APPLE__)
+#include <sys/disk.h>
+#endif
+
+#if defined(DIOCGDINFO)
+#include <sys/disklabel.h>
+#endif
+
+#include <err.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <unistd.h>
+
+unsigned long long numsecs(int);
+
+int
+main(int argc, char *argv[]) {
+ int fd;
+
+ if (argc != 2)
+ errx(255, "Syntax: dkgetsz /dev/sda");
+
+ if ((fd = open(argv[1], O_RDONLY)) == -1)
+ err(1, "open");
+ printf("%llu\n", numsecs(fd));
+ close(fd);
+ return (0);
+}
+
+unsigned long long
+numsecs(int fd)
+{
+#if defined(BLKGETSIZE) || defined(DKIOCGETBLOCKCOUNT)
+/*
+ * note: BLKGETSIZE64 returns bytes, not sectors, but the return
+ * type is size_t which is 32 bits on an ILP32 platform, so it
+ * fails interestingly here… thus we use BLKGETSIZE instead.
+ */
+#if defined(DKIOCGETBLOCKCOUNT)
+ uint64_t nsecs;
+#define THEIOCTL DKIOCGETBLOCKCOUNT
+#define STRIOCTL "DKIOCGETBLOCKCOUNT"
+#else
+ unsigned long nsecs;
+#define THEIOCTL BLKGETSIZE
+#define STRIOCTL "BLKGETSIZE"
+#endif
+ if (ioctl(fd, THEIOCTL, &nsecs) == -1)
+ err(1, "ioctl %s", STRIOCTL);
+ return ((unsigned long long)nsecs);
+#elif defined(DIOCGDINFO)
+ struct disklabel dl;
+
+ if (ioctl(fd, DIOCGDINFO, &dl) == -1)
+ err(1, "ioctl DIOCGDINFO");
+ return ((unsigned long long)dl.d_secperunit);
+#else
+#warning PLEASE DO IMPLEMENT numsecs FOR THIS PLATFORM.
+#endif
+}
diff --git a/package/mkcrypt/src/mkcrypt.c b/package/adk-helper/src/mkcrypt.c
index a856759df..a856759df 100644
--- a/package/mkcrypt/src/mkcrypt.c
+++ b/package/adk-helper/src/mkcrypt.c
diff --git a/package/pixman/Makefile b/package/pixman/Makefile
index 5cb1821d9..6d5cd5aec 100644
--- a/package/pixman/Makefile
+++ b/package/pixman/Makefile
@@ -4,10 +4,10 @@
include $(TOPDIR)/rules.mk
PKG_NAME:= pixman
-PKG_VERSION:= 0.30.0
-PKG_RELEASE:= 2
-PKG_MD5SUM:= ae7ac97921dfa59086ca2231621a79c7
-PKG_DESCR:= Pixel manipulation library
+PKG_VERSION:= 0.32.4
+PKG_RELEASE:= 1
+PKG_MD5SUM:= eba449138b972fbf4547a8c152fea162
+PKG_DESCR:= pixel manipulation library
PKG_SECTION:= x11/libs
PKG_BUILDDEP:= libpng
PKG_SITES:= http://www.cairographics.org/releases/
diff --git a/package/pixman/patches/patch-Makefile_in b/package/pixman/patches/patch-Makefile_in
new file mode 100644
index 000000000..cebc19113
--- /dev/null
+++ b/package/pixman/patches/patch-Makefile_in
@@ -0,0 +1,11 @@
+--- pixman-0.32.4.orig/Makefile.in 2013-11-18 03:11:20.000000000 +0100
++++ pixman-0.32.4/Makefile.in 2014-03-30 21:54:18.000000000 +0200
+@@ -369,7 +369,7 @@ target_alias = @target_alias@
+ top_build_prefix = @top_build_prefix@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
+-SUBDIRS = pixman demos test
++SUBDIRS = pixman
+ pkgconfigdir = $(libdir)/pkgconfig
+ pkgconfig_DATA = pixman-1.pc
+ GPGKEY = 3892336E