diff --git a/sys-apps/dtc/dtc-1.6.1.recipe b/sys-apps/dtc/dtc-1.6.1.recipe new file mode 100644 index 000000000..b8805f5e1 --- /dev/null +++ b/sys-apps/dtc/dtc-1.6.1.recipe @@ -0,0 +1,106 @@ +SUMMARY="The Device Tree Compiler" +DESCRIPTION="The Device Tree Compiler (DTC) is the toolchain for building \ +device tree source files (*.dts) into the binary format (*.dtb)." +HOMEPAGE="https://git.kernel.org/cgit/utils/dtc/dtc.git" +COPYRIGHT="2005 David Gibson, IBM Corporation" +LICENSE="GNU GPL v2" +REVISION="1" +SOURCE_URI="https://www.kernel.org/pub/software/utils/dtc/dtc-$portVersion.tar.xz" +CHECKSUM_SHA256="65cec529893659a49a89740bb362f507a3b94fc8cd791e76a8d6a2b6f3203473" +PATCHES="dtc-$portVersion.patchset" + +ARCHITECTURES="all !x86_gcc2" +SECONDARY_ARCHITECTURES="x86" + +commandSuffix=$secondaryArchSuffix +commandBinDir=$binDir +if [ "$targetArchitecture" = x86_gcc2 ]; then + commandSuffix= + commandBinDir=$prefix/bin +fi + +libVersion=$portVersion +libVersionCompat=${libVersion%%.*} + +PROVIDES=" + dtc$secondaryArchSuffix = $portVersion + lib:libfdt$secondaryArchSuffix = 1 + lib:libfdt_$portVersion$secondaryArchSuffix + " +REQUIRES=" + haiku$secondaryArchSuffix + lib:libyaml_0$secondaryArchSuffix + " + +PROVIDES_tools=" + dtc${secondaryArchSuffix}_tools + cmd:convert_dtsv0$commandSuffix = $portVersion + cmd:dtc$commandSuffix = $portVersion + cmd:dtdiff$commandSuffix = $portVersion + cmd:fdtdump$commandSuffix = $portVersion + cmd:fdtget$commandSuffix = $portVersion + cmd:fdtoverlay$commandSuffix = $portVersion + cmd:fdtput$commandSuffix = $portVersion + " +REQUIRES_tools=" + dtc$secondaryArchSuffix == $portVersion base + haiku$secondaryArchSuffix + lib:libyaml_0$secondaryArchSuffix + " + +PROVIDES_devel=" + dtc${secondaryArchSuffix}_devel = $portVersion + devel:libfdt$secondaryArchSuffix =1 + devel:libfdt_$portVersion$secondaryArchSuffix + " +REQUIRES_devel=" + dtc$secondaryArchSuffix == $portVersion base + " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + devel:libyaml_0$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + cmd:bison + cmd:cmp + cmd:flex + cmd:gcc$secondaryArchSuffix + cmd:make + cmd:pkg_config$secondaryArchSuffix + " + +defineDebugInfoPackage dtc$secondaryArchSuffix \ + "$(getPackagePrefix tools)"/bin/convert-dtsv0 \ + "$(getPackagePrefix tools)"/bin/dtc \ + "$(getPackagePrefix tools)"/bin/fdtdump \ + "$(getPackagePrefix tools)"/bin/fdtget \ + "$(getPackagePrefix tools)"/bin/fdtoverlay \ + "$(getPackagePrefix tools)"/bin/fdtput \ + $libDir/libfdt-$portVersion.so + +BUILD() +{ + make PREFIX=$prefix $jobArgs NO_PYTHON=TRUE +} + +INSTALL() +{ + make install \ + PREFIX=$prefix \ + BINDIR=$commandBinDir \ + INCLUDEDIR=$includeDir \ + LIBDIR=$libDir \ + NO_PYTHON=1 + + prepareInstalledDevelLibs libfdt libfdt-$portVersion + + packageEntries devel $developDir + + packageEntries tools $commandBinDir +} + +TEST() +{ + make check +} diff --git a/sys-apps/dtc/patches/dtc-1.6.1.patchset b/sys-apps/dtc/patches/dtc-1.6.1.patchset new file mode 100644 index 000000000..0356f778d --- /dev/null +++ b/sys-apps/dtc/patches/dtc-1.6.1.patchset @@ -0,0 +1,62 @@ +From b7dcc2d3e058c0aa9e84ce94177c2e86a69d5ce6 Mon Sep 17 00:00:00 2001 +From: Jerome Duval +Date: Thu, 12 Oct 2017 21:07:34 +0200 +Subject: Apply patch from 1.3.0. + + +diff --git a/Makefile b/Makefile +index d8ebc4f..4333411 100644 +--- a/Makefile ++++ b/Makefile +@@ -53,6 +53,15 @@ SHAREDLIB_CFLAGS = -fPIC + SHAREDLIB_LDFLAGS = -fPIC -shared -Wl,--version-script=$(LIBFDT_version) -Wl,-soname, + endif + ++ifeq ($(HOSTOS),haiku) ++INSTALL = /bin/install ++endif ++ ++ifneq ($(HOSTOS),haiku) ++LIBDL = -ldl ++endif ++ ++ + # + # Overall rules + # +diff --git a/tests/testutils.c b/tests/testutils.c +index 75e3e20..bc2b539 100644 +--- a/tests/testutils.c ++++ b/tests/testutils.c +@@ -50,16 +50,15 @@ static void sigint_handler(int signum, siginfo_t *si, void *uc) + { + cleanup(); + fprintf(stderr, "%s: %s (pid=%d)\n", test_name, +- strsignal(signum), getpid()); ++ strsignal(signum), (int)getpid()); + exit(RC_BUG); + } + + void test_init(int argc, char *argv[]) + { + int err; +- struct sigaction sa_int = { +- .sa_sigaction = sigint_handler, +- }; ++ struct sigaction sa_int = { }; ++ sa_int.sa_sigaction = sigint_handler; + + test_name = argv[0]; + +@@ -71,7 +70,7 @@ void test_init(int argc, char *argv[]) + verbose_test = 0; + + verbose_printf("Starting testcase \"%s\", pid %d\n", +- test_name, getpid()); ++ test_name, (int)getpid()); + } + + void check_mem_rsv(void *fdt, int n, uint64_t addr, uint64_t size) +-- +2.19.0 +