diff options
-rw-r--r-- | dev-libs/libpsl-native/Manifest | 1 | ||||
-rw-r--r-- | dev-libs/libpsl-native/files/libpsl-native-7.3.2-cmake.patch | 36 | ||||
-rw-r--r-- | dev-libs/libpsl-native/files/libpsl-native-7.3.2-test-cmake.patch | 18 | ||||
-rw-r--r-- | dev-libs/libpsl-native/libpsl-native-7.3.2.ebuild | 39 | ||||
-rw-r--r-- | dev-libs/libpsl-native/metadata.xml | 13 |
5 files changed, 107 insertions, 0 deletions
diff --git a/dev-libs/libpsl-native/Manifest b/dev-libs/libpsl-native/Manifest new file mode 100644 index 000000000000..f8c66e45101a --- /dev/null +++ b/dev-libs/libpsl-native/Manifest @@ -0,0 +1 @@ +DIST libpsl-native-7.3.2.tar.gz 288949 BLAKE2B 9547d0144ec1bd48d4f9272ae7c7237fbc052a852908a535047f2f9a41a7a0f7c36868fe697c77ec37d4705a119ac3f4f6961f7ff8ad7c80f8ec176839e34dd3 SHA512 5ff7c730c000e1d8ccbf48e01a1233889df3ddda3c280cbf37298a1731354dde30f0637b62567a8679dec4ea27a2184d9559026c3a86c793c6c8c12ec629c90d diff --git a/dev-libs/libpsl-native/files/libpsl-native-7.3.2-cmake.patch b/dev-libs/libpsl-native/files/libpsl-native-7.3.2-cmake.patch new file mode 100644 index 000000000000..a8222f074713 --- /dev/null +++ b/dev-libs/libpsl-native/files/libpsl-native-7.3.2-cmake.patch @@ -0,0 +1,36 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,9 +1,7 @@ + cmake_minimum_required(VERSION 2.8.11) + project(PSL-NATIVE) + +-# Can't use add_compile_options with 2.8.11 +-set(CMAKE_BUILD_TYPE "Release") +-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Werror -fstack-protector-strong -fpie -DFORTIFY_SOURCE=2 -O2") ++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + + if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,relro,-z,now") +@@ -11,15 +9,11 @@ elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl") + endif() + +-set(LIBRARY_OUTPUT_PATH "${PROJECT_SOURCE_DIR}/../powershell-unix") ++option(TESTING "Enable tests" OFF) + +-if (CMAKE_SYSTEM_PROCESSOR MATCHES "arm*") +- message(STATUS "Building for ARM, no tests") +- add_subdirectory(src) +-else () +- # test in BUILD_DIR +- message(STATUS "Tests enabled") +- enable_testing() +- add_subdirectory(src) +- add_subdirectory(test) +-endif () ++add_subdirectory(src) ++ ++if(TESTING) ++ enable_testing() ++ add_subdirectory(test) ++endif() diff --git a/dev-libs/libpsl-native/files/libpsl-native-7.3.2-test-cmake.patch b/dev-libs/libpsl-native/files/libpsl-native-7.3.2-test-cmake.patch new file mode 100644 index 000000000000..641a4aaf4ee2 --- /dev/null +++ b/dev-libs/libpsl-native/files/libpsl-native-7.3.2-test-cmake.patch @@ -0,0 +1,18 @@ +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -1,4 +1,4 @@ +-add_subdirectory(googletest) ++find_package(GTest REQUIRED) + + add_executable(psl-native-test + test-getfileowner.cpp +@@ -19,9 +19,6 @@ add_executable(psl-native-test + test-createhardlink.cpp + main.cpp) + +-# manually include gtest headers +-target_include_directories(psl-native-test PRIVATE ${gtest_SOURCE_DIR}/include) +- + target_link_libraries(psl-native-test psl-native gtest) + + add_test(NAME psl-native-test diff --git a/dev-libs/libpsl-native/libpsl-native-7.3.2.ebuild b/dev-libs/libpsl-native/libpsl-native-7.3.2.ebuild new file mode 100644 index 000000000000..86ff150176a7 --- /dev/null +++ b/dev-libs/libpsl-native/libpsl-native-7.3.2.ebuild @@ -0,0 +1,39 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +MY_PN="PowerShell-Native" + +inherit cmake + +DESCRIPTION="Functionality missing from .NET Core via system calls" +HOMEPAGE="https://github.com/PowerShell/PowerShell-Native/" + +if [[ "${PV}" == *9999* ]] ; then + inherit git-r3 + + EGIT_REPO_URI="https://github.com/PowerShell/${MY_PN}.git" + S="${WORKDIR}/${P}/src/${PN}" +else + SRC_URI="https://github.com/PowerShell/${MY_PN}/archive/v${PV}.tar.gz + -> ${P}.tar.gz" + S="${WORKDIR}/${MY_PN}-${PV}/src/${PN}" + + KEYWORDS="~amd64 ~x86" +fi + +LICENSE="MIT" +SLOT="0/$(ver_cut 1-2)" +RESTRICT="test" # Fails. + +PATCHES=( + "${FILESDIR}/${PN}-7.3.2-cmake.patch" + "${FILESDIR}/${PN}-7.3.2-test-cmake.patch" +) + +src_install() { + dolib.so "${BUILD_DIR}/src/${PN}.so" + + einstalldocs +} diff --git a/dev-libs/libpsl-native/metadata.xml b/dev-libs/libpsl-native/metadata.xml new file mode 100644 index 000000000000..f363f77b5905 --- /dev/null +++ b/dev-libs/libpsl-native/metadata.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> + +<pkgmetadata> + <maintainer type="project"> + <email>dotnet@gentoo.org</email> + <name>Gentoo Dotnet Project</name> + </maintainer> + <upstream> + <bugs-to>https://github.com/PowerShell/PowerShell-Native/issues/</bugs-to> + <remote-id type="github">PowerShell/PowerShell-Native</remote-id> + </upstream> +</pkgmetadata> |