From 0642d9b89b9cd409727b521fc9be21f80577b1a9 Mon Sep 17 00:00:00 2001 From: alaviss Date: Sun, 7 Jan 2018 15:51:24 +0700 Subject: [PATCH] app-arch/unshield: new recipe (#2076) --- .../unshield/patches/unshield-1.4.2.patchset | 37 ++++++++ app-arch/unshield/unshield-1.4.2.recipe | 94 +++++++++++++++++++ 2 files changed, 131 insertions(+) create mode 100644 app-arch/unshield/patches/unshield-1.4.2.patchset create mode 100644 app-arch/unshield/unshield-1.4.2.recipe diff --git a/app-arch/unshield/patches/unshield-1.4.2.patchset b/app-arch/unshield/patches/unshield-1.4.2.patchset new file mode 100644 index 000000000..ad11848fa --- /dev/null +++ b/app-arch/unshield/patches/unshield-1.4.2.patchset @@ -0,0 +1,37 @@ +From 1fdb6bf8ba28f66409fbcae78e15556f45d43623 Mon Sep 17 00:00:00 2001 +From: Leorize +Date: Sun, 7 Jan 2018 09:22:55 +0700 +Subject: CMakeLists: use check_symbol_exists() + +CMake manual suggests using this module instead of CheckFunctionExists. +Also, this fixes iconv detection on OSes that use an external iconv +implementation (libiconv) as iconv is defined as a macro, which +CheckFunctionExists can't detect. + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 39ae378..85915d0 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -9,7 +9,7 @@ set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}") + option(BUILD_STATIC "Build static version of libunshield" OFF) + + include(CheckIncludeFiles) +-include(CheckFunctionExists) ++include(CheckSymbolExists) + include(CheckCSourceCompiles) + include(GNUInstallDirs) + +@@ -26,8 +26,8 @@ check_include_files(sys/byteswap.h HAVE_SYS_BYTESWAP_H) + check_include_files(sys/stat.h HAVE_SYS_STAT_H) + check_include_files(sys/types.h HAVE_SYS_TYPES_H) + check_include_files(unistd.h HAVE_UNISTD_H) +-check_function_exists(fnmatch HAVE_FNMATCH) +-check_function_exists(iconv HAVE_ICONV) ++check_symbol_exists(fnmatch fnmatch.h HAVE_FNMATCH) ++check_symbol_exists(iconv iconv.h HAVE_ICONV) + + set(SIZE_FORMAT "zi") + check_c_source_compiles("#include \nint main(int argc, char **argv) { size_t value = 0; printf(\"%${SIZE_FORMAT}\", value); return 0; }" SIZE_FORMAT_ZI) +-- +2.15.0 + diff --git a/app-arch/unshield/unshield-1.4.2.recipe b/app-arch/unshield/unshield-1.4.2.recipe new file mode 100644 index 000000000..cc2888859 --- /dev/null +++ b/app-arch/unshield/unshield-1.4.2.recipe @@ -0,0 +1,94 @@ +SUMMARY="Tool and library to extract CAB files from InstallShield installers" +DESCRIPTION="Unshield extracts CAB files from InstallShield installers, \ +used to install software on Microsoft Windows based machines." +HOMEPAGE="https://github.com/twogood/unshield" +COPYRIGHT="2017 David Eriksson" +LICENSE="MIT" +REVISION="1" +SOURCE_URI="https://github.com/twogood/unshield/archive/$portVersion.tar.gz" +CHECKSUM_SHA256="5dd4ea0c7e97ad8e3677ff3a254b116df08a5d041c2df8859aad5c4f88d1f774" +SOURCE_FILENAME="unshield-$portVersion.tar.gz" +PATCHES="unshield-$portVersion.patchset" + +ARCHITECTURES="!x86_gcc2 x86_64" +SECONDARY_ARCHITECTURES="x86" + +libVersion="0.0.0" +libVersionCompat="$libVersion compat >= ${libVersion%%.*}" + +PROVIDES=" + unshield$secondaryArchSuffix = $portVersion + cmd:unshield$secondaryArchSuffix = $portVersion + lib:libunshield$secondaryArchSuffix = $libVersionCompat + " +REQUIRES=" + haiku$secondaryArchSuffix + lib:libcrypto$secondaryArchSuffix + lib:libiconv$secondaryArchSuffix + lib:libz$secondaryArchSuffix + " + +PROVIDES_devel=" + unshield${secondaryArchSuffix}_devel = $portVersion + devel:libunshield$secondaryArchSuffix = $libVersionCompat + " +REQUIRES_devel=" + unshield$secondaryArchSuffix == $portVersion base + " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + devel:libcrypto$secondaryArchSuffix + devel:libiconv$secondaryArchSuffix + devel:libz$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + cmd:c++$secondaryArchSuffix + cmd:cc$secondaryArchSuffix + cmd:cmake + cmd:make + " + +TEST_PREREQUIRES=" + cmd:diff + cmd:find + " +BUILD_PREREQUIRES+="$TEST_PREREQUIRES" + +BUILD() +{ + cmake . \ + $cmakeDirArgs \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_EXE_LINKER_FLAGS="-liconv" + make $jobArgs +} + +INSTALL() +{ + make install + + install -d -m 755 "$docDir" "$manDir" "$dataDir/expander/rules" + install -t "$docDir" ChangeLog + + mv "$dataDir/man/man1" "$manDir/man1" + rm -rf "$dataDir/man" + + cat > "$dataDir/expander/rules/unshield-expander-rules" << EOF +"application/x-installshield-cab" .cab "unshield$secondaryArchSuffix l %s" "unshield$secondaryArchSuffix x %s" +EOF + + prepareInstalledDevelLib libunshield + fixPkgconfig + packageEntries devel "$developDir" +} + +# Upstream modify their test suite quite frequently. +# As test cases are fetched from the Internet, +# they're only useful for people developing unshield, +# because one would require the latest md5sums from +# upstream for tests to pass +#TEST() +#{ +# UNSHIELD="$PWD/src/unshield" ./run-tests.sh +#}