commit 20a340dff9e1fcf2af1174579d8e49962b9ee3ce748075e935d7279bc3f72f60 Author: Dirk Mueller Date: Tue Sep 10 13:26:25 2024 +0000 - update to 14.2.5: * reproc_strerror: avoid undefined behaviour for error == INT_MIN - drop gcc13.patch (upstream) - update to 14.1.0 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/reproc?expand=0&rev=10 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/gcc13.patch b/gcc13.patch new file mode 100644 index 0000000..ca198b0 --- /dev/null +++ b/gcc13.patch @@ -0,0 +1,136 @@ +From 0b23d88894ccedde04537fa23ea55cb2f8365342 Mon Sep 17 00:00:00 2001 +From: Daan De Meyer +Date: Sat, 18 Mar 2023 19:38:19 +0100 +Subject: [PATCH] reproc++: Try to fix gcc 13 build + +--- + reproc++/include/reproc++/reproc.hpp | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +Index: reproc-14.2.4/reproc++/include/reproc++/reproc.hpp +=================================================================== +--- reproc-14.2.4.orig/reproc++/include/reproc++/reproc.hpp ++++ reproc-14.2.4/reproc++/include/reproc++/reproc.hpp +@@ -88,7 +88,7 @@ struct redirect { + + struct options { + struct { +- env::type behavior; ++ enum env::type behavior; + /*! Implicitly converts from any STL container of string pairs to the + environment format expected by `reproc_start`. */ + class env extra; +@@ -97,9 +97,9 @@ struct options { + const char *working_directory = nullptr; + + struct { +- redirect in; +- redirect out; +- redirect err; ++ struct redirect in; ++ struct redirect out; ++ struct redirect err; + bool parent; + bool discard; + FILE *file; +@@ -138,30 +138,12 @@ enum class stream { + err, + }; + +-class process; +- + namespace event { + +-enum { +- in = 1 << 0, +- out = 1 << 1, +- err = 1 << 2, +- exit = 1 << 3, +- deadline = 1 << 4, +-}; +- +-struct source { +- class process &process; +- int interests; +- int events; +-}; ++class source; + + } + +-REPROCXX_EXPORT std::error_code poll(event::source *sources, +- size_t num_sources, +- milliseconds timeout = infinite); +- + /*! Improves on reproc's API by adding RAII and changing the API of some + functions to be more idiomatic C++. */ + class process { +@@ -220,4 +202,26 @@ private: + std::unique_ptr impl_; + }; + ++namespace event { ++ ++enum { ++ in = 1 << 0, ++ out = 1 << 1, ++ err = 1 << 2, ++ exit = 1 << 3, ++ deadline = 1 << 4, ++}; ++ ++struct source { ++ class process process; ++ int interests; ++ int events; ++}; ++ ++} ++ ++REPROCXX_EXPORT std::error_code poll(event::source *sources, ++ size_t num_sources, ++ milliseconds timeout = infinite); ++ + } +Index: reproc-14.2.4/reproc++/src/reproc.cpp +=================================================================== +--- reproc-14.2.4.orig/reproc++/src/reproc.cpp ++++ reproc-14.2.4/reproc++/src/reproc.cpp +@@ -86,8 +86,9 @@ std::pair process + std::pair process::poll(int interests, + milliseconds timeout) + { +- event::source source{ *this, interests, 0 }; ++ event::source source{ std::move(*this), interests, 0 }; + std::error_code ec = ::reproc::poll(&source, 1, timeout); ++ *this = std::move(source.process); + return { source.events, ec }; + } + + +From 9f399675b821e175f85ac3ee6e3fd2e6056573eb Mon Sep 17 00:00:00 2001 +From: Daan De Meyer +Date: Fri, 21 Apr 2023 19:36:45 +0200 +Subject: [PATCH] Fix gcc 13 build + +--- + reproc++/include/reproc++/reproc.hpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/reproc++/include/reproc++/reproc.hpp b/reproc++/include/reproc++/reproc.hpp +index b52f495e..7b614a94 100644 +--- a/reproc++/include/reproc++/reproc.hpp ++++ b/reproc++/include/reproc++/reproc.hpp +@@ -88,10 +88,10 @@ struct redirect { + + struct options { + struct { +- enum env::type behavior; ++ reproc::env::type behavior; + /*! Implicitly converts from any STL container of string pairs to the + environment format expected by `reproc_start`. */ +- class env extra; ++ reproc::env extra; + } env = {}; + + const char *working_directory = nullptr; diff --git a/reproc-14.2.4.tar.gz b/reproc-14.2.4.tar.gz new file mode 100644 index 0000000..7db3c3f --- /dev/null +++ b/reproc-14.2.4.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:55c780f7faa5c8cabd83ebbb84b68e5e0e09732de70a129f6b3c801e905415dd +size 64956 diff --git a/reproc-14.2.5.tar.gz b/reproc-14.2.5.tar.gz new file mode 100644 index 0000000..83c501b --- /dev/null +++ b/reproc-14.2.5.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:69467be0cfc80734b821c54ada263c8f1439f964314063f76b7cf256c3dc7ee8 +size 65290 diff --git a/reproc.changes b/reproc.changes new file mode 100644 index 0000000..fcba751 --- /dev/null +++ b/reproc.changes @@ -0,0 +1,53 @@ +------------------------------------------------------------------- +Tue Sep 10 13:26:04 UTC 2024 - Dirk Müller + +- update to 14.2.5: + * reproc_strerror: avoid undefined behaviour for error == INT_MIN +- drop gcc13.patch (upstream) + +------------------------------------------------------------------- +Fri May 19 08:08:57 UTC 2023 - Dirk Müller + +- gcc13.patch: refresh with the patch that landed upstream + +------------------------------------------------------------------- +Tue Apr 4 21:15:55 UTC 2023 - Dirk Müller + +- add gcc13.patch to fix build + +------------------------------------------------------------------- +Fri Feb 24 08:58:37 UTC 2023 - Dirk Müller + +- update to 14.2.4: + * Bugfix: Fix a memory leak in `reproc_start()` on Windows + * Bugfix: Fix a memory leak in reproc++ `array` class move + constructor. + * Allow passing zero-sized array's to reproc's `input` option + * Bugfix: Fix sign of EWOULDBLOCK error returned from + `reproc_read`. + * Bugfix: Disallow using `fork` option when using `reproc_run`. + * Bugfix: `reproc_run` now handles forked child processes + correctly. + * Bugfix: Sinks of different types can now be passed to + `reproc::drain`. + * Bugfix: Processes on Windows returning negative exit codes + don't cause asserts anymore. + * Bugfix: Dependency on librt on POSIX (except osx) systems is + now explicit in CMake. + * Bugfix: Added missing stdout redirect option to reproc++. + * Added `reproc_pid`/`process::pid` to get the pid of the + process + * Fixed compilation error when including reproc/drain.h in C++ + code + * Added missing extern "C" block to reproc/run.h +- run tests + +------------------------------------------------------------------- +Mon Aug 31 15:00:45 UTC 2020 - Marcus Rueckert + +- update to 14.1.0 + +------------------------------------------------------------------- +Fri Jul 31 00:32:43 UTC 2020 - Marcus Rueckert + +- initial diff --git a/reproc.spec b/reproc.spec new file mode 100644 index 0000000..8f3d54a --- /dev/null +++ b/reproc.spec @@ -0,0 +1,95 @@ +# +# spec file for package reproc +# +# Copyright (c) 2024 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%define lib_name libreproc14 +%define libpp_name libreproc++14 +Name: reproc +Version: 14.2.5 +Release: 0 +Summary: A cross-platform (C99/C++11) process library +License: MIT +URL: https://github.com/DaanDeMeyer/reproc +Source: https://github.com/DaanDeMeyer/reproc/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz +BuildRequires: cmake +BuildRequires: gcc-c++ +BuildRequires: pkgconfig + +%description +reproc (Redirected Process) is a cross-platform C/C++ library that simplifies starting, stopping and communicating with external programs. The main use case is executing command line applications directly from C or C++ code and retrieving their output. + +%package -n %{lib_name} +Summary: Shared library for reproc + +%description -n %{lib_name} +reproc (Redirected Process) is a cross-platform C/C++ library that simplifies starting, stopping and communicating with external programs. The main use case is executing command line applications directly from C or C++ code and retrieving their output. + +This package holds the shared library for reproc. + +%package -n %{libpp_name} +Summary: Shared library for reproc + +%description -n %{libpp_name} +reproc (Redirected Process) is a cross-platform C/C++ library that simplifies starting, stopping and communicating with external programs. The main use case is executing command line applications directly from C or C++ code and retrieving their output. + +This package holds the shared library for reproc. + +%package devel +Summary: Development files for reproc +Requires: %{lib_name} = %{version} +Requires: %{libpp_name} = %{version} + +%description devel +reproc (Redirected Process) is a cross-platform C/C++ library that simplifies starting, stopping and communicating with external programs. The main use case is executing command line applications directly from C or C++ code and retrieving their output. + +This package holds the development files for reproc. + +%prep +%autosetup -p1 + +%build +%cmake -DREPROC++:BOOL=ON -DREPROC_TEST=ON +%cmake_build + +%install +%cmake_install + +%check +%ctest + +%post -n %{lib_name} -p /sbin/ldconfig +%postun -n %{lib_name} -p /sbin/ldconfig +%post -n %{libpp_name} -p /sbin/ldconfig +%postun -n %{libpp_name} -p /sbin/ldconfig + +%files -n %{lib_name} +%license LICENSE +%doc *.md +%{_libdir}/libreproc.so.* + +%files -n %{libpp_name} +%license LICENSE +%doc *.md +%{_libdir}/libreproc++.so.* + +%files devel +%{_libdir}/libreproc*.so +%{_includedir}/reproc*/ +%{_libdir}/cmake/reproc*/ +%{_libdir}/pkgconfig/reproc*.pc + +%changelog