Move subprocess from nix to a submodule.

main
Ben Niemann 1 year ago
parent c1954a4032
commit ee1a2d49af

3
.gitmodules vendored

@ -7,3 +7,6 @@
[submodule "3rdparty/dep_sort"]
path = 3rdparty/dep_sort
url = https://github.com/graphitemaster/dep_sort
[submodule "3rdparty/subprocess"]
path = 3rdparty/subprocess
url = https://github.com/benman64/subprocess

@ -7,3 +7,7 @@ Some of the more obscure packages, which are not generally available in distribu
* dep_sort: Generic topological sorting for sorting a list of dependencies in C++17.
- Source: https://github.com/graphitemaster/dep_sort
- License: MIT
* subprocess: cross platform subprocess library for c++ similar to design of python subprocess
- Source: https://github.com/benman64/subprocess
- License: MIT

@ -0,0 +1 @@
Subproject commit e1cae5e86e5d089e65e906f7c13917b7bbb75d04

26
3rdparty/wscript vendored

@ -39,6 +39,14 @@ def configure(ctx):
ctx.env['INCLUDES_DEP_SORT'] = os.path.join(ctx.srcnode.abspath(), '3rdparty/dep_sort')
if ctx.options.with_tests:
ctx.env['LIB_SUBPROCESS'] = 'subprocess'
ctx.env['LIBPATH_SUBPROCESS'] = os.path.join(ctx.bldnode.abspath(), '3rdparty')
if not ctx.options.release:
ctx.env['RPATH_SUBPROCESS'] = os.path.join(ctx.bldnode.abspath(), '3rdparty')
ctx.env['INCLUDES_SUBPROCESS'] = os.path.join(ctx.srcnode.abspath(), '3rdparty/subprocess/src/cpp')
def build(ctx):
ctx.shlib(
target='qnanopainter',
@ -89,3 +97,21 @@ def build(ctx):
vnum='1',
)
if ctx.options.with_tests:
ctx.shlib(
target='subprocess',
features='cxx cxxshlib',
source=[
'subprocess/src/cpp/subprocess/CowData.cpp',
'subprocess/src/cpp/subprocess/PipeVar.cpp',
'subprocess/src/cpp/subprocess/ProcessBuilder.cpp',
'subprocess/src/cpp/subprocess/ProcessBuilder_posix.cpp',
'subprocess/src/cpp/subprocess/ProcessBuilder_windows.cpp',
'subprocess/src/cpp/subprocess/environ.cpp',
'subprocess/src/cpp/subprocess/pipe.cpp',
'subprocess/src/cpp/subprocess/shell_utils.cpp',
'subprocess/src/cpp/subprocess/utf8_to_utf16.cpp',
],
includes=['subprocess/src/cpp'],
vnum='1',
)

@ -70,34 +70,6 @@ let
};
inherit (import gitignoreSrc { inherit lib; }) gitignoreSource;
# subprocess: cross platform subprocess library for c++ similar to design of python subprocess
# https://github.com/benman64/subprocess
subprocess = stdenv.mkDerivation rec {
pname = "subprocess";
version = "0.4.0";
src = fetchFromGitHub {
owner = "benman64";
repo = "subprocess";
rev = "v${version}";
sha256 = "sha256:1j2l5nm4lhkfymhv5qd5gi8760df7khvdvw174lzc9fjzs3a42af";
};
nativeBuildInputs = [nixpkgs.cmake nixpkgs.python38];
patchPhase = ''
patchShebangs test/dependencies/cxxtest/bin/cxxtestgen
'';
installPhase = ''
mkdir -p $out/lib
cp subprocess/libsubprocess.a $out/lib
mkdir -p $out/include/subprocess
cp $src/src/cpp/subprocess.hpp $out/include/
cp $src/src/cpp/subprocess/*.hpp $out/include/subprocess/
'';
};
# FlatBuffers: Memory Efficient Serialization Library
# https://github.com/google/flatbuffers
flatbuffers = stdenv.mkDerivation rec {
@ -134,7 +106,6 @@ in stdenv.mkDerivation {
flatbuffers
nixpkgs.librsvg
nixpkgs.libjack2
subprocess
nixpkgs.ffmpeg.dev
nixpkgs.fmt
qt5.qmake

@ -71,6 +71,5 @@ def build(ctx):
ctx.program(
target=test.change_ext(''),
source=[test],
lib=['subprocess'],
use=['GTEST', 'GMOCK', 'FMT', 'noisicaa-engine'],
use=['GTEST', 'GMOCK', 'FMT', 'SUBPROCESS', 'noisicaa-engine'],
)

Loading…
Cancel
Save