From c1954a403298f389a67b5e2367556a981b1ce7ac Mon Sep 17 00:00:00 2001 From: Ben Niemann Date: Sat, 1 Jan 2022 02:30:58 +0100 Subject: [PATCH] Move dep_sort from nix to a submodule. --- .gitmodules | 3 +++ 3rdparty/README.md | 6 +++++- 3rdparty/dep_sort | 1 + 3rdparty/wscript | 2 ++ appimg/build.sh | 13 +------------ noisicaa.nix | 22 ---------------------- noisicaa/engine/wscript | 1 + wscript | 2 -- 8 files changed, 13 insertions(+), 37 deletions(-) create mode 160000 3rdparty/dep_sort diff --git a/.gitmodules b/.gitmodules index ae6fed6a..2581f643 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "3rdparty/qnanopainter"] path = 3rdparty/qnanopainter url = https://github.com/QUItCoding/qnanopainter +[submodule "3rdparty/dep_sort"] + path = 3rdparty/dep_sort + url = https://github.com/graphitemaster/dep_sort diff --git a/3rdparty/README.md b/3rdparty/README.md index e57fa5b2..2b0c9167 100644 --- a/3rdparty/README.md +++ b/3rdparty/README.md @@ -1,5 +1,9 @@ -Some of the more obscure packages, which are not available generally available in distributions. +Some of the more obscure packages, which are not generally available in distributions. * qlnanopainter: Library for implementing OpenGL accelerated Qt5 C++ UI components. - Source: https://github.com/QUItCoding/qnanopainter - License: zlib + +* dep_sort: Generic topological sorting for sorting a list of dependencies in C++17. + - Source: https://github.com/graphitemaster/dep_sort + - License: MIT diff --git a/3rdparty/dep_sort b/3rdparty/dep_sort new file mode 160000 index 00000000..9e96e942 --- /dev/null +++ b/3rdparty/dep_sort @@ -0,0 +1 @@ +Subproject commit 9e96e9426e74e6dc24ba26fdd9c2bee5bab72b0b diff --git a/3rdparty/wscript b/3rdparty/wscript index 63d172f5..019b6987 100644 --- a/3rdparty/wscript +++ b/3rdparty/wscript @@ -37,6 +37,8 @@ def configure(ctx): #'QNANO_USE_RENDERNODE=1', ] + ctx.env['INCLUDES_DEP_SORT'] = os.path.join(ctx.srcnode.abspath(), '3rdparty/dep_sort') + def build(ctx): ctx.shlib( target='qnanopainter', diff --git a/appimg/build.sh b/appimg/build.sh index 23935f80..16b94f6b 100644 --- a/appimg/build.sh +++ b/appimg/build.sh @@ -96,7 +96,7 @@ if [ ! -x /usr/local/bin/appimagetool ]; then # AppImages, then that (might) leak into the docker container, preventing us from starting the # binary. An ugly workaround is to remove the magic bytes from the file. # See https://github.com/TheAssassin/AppImageLauncher/issues/407 - dd if=/dev/zero of=image bs=1 seek=8 count=3 conv=notrunc status=none + dd if=/dev/zero of=appimagetool-x86_64.AppImage bs=1 seek=8 count=3 conv=notrunc status=none ./appimagetool-x86_64.AppImage --appimage-extract rm -fr /opt/appimagetool mv squashfs-root /opt/appimagetool @@ -122,17 +122,6 @@ if [ ! -x /usr/local/bin/flatpy ]; then python3 -m pip install /src/flatpy/ fi -### dep_sort - -if [ ! -e /usr/local/include/dep_sort.h ]; then - cd /build - curl -L -o dep_sort.tar.gz https://github.com/graphitemaster/dep_sort/archive/9e96e9426e74e6dc24ba26fdd9c2bee5bab72b0b.tar.gz - mkdir dep_sort - cd dep_sort - tar -x --gzip -f ../dep_sort.tar.gz --strip-components=1 - cp dep_sort.h dep_sort.inl dep_sort_stl.h /usr/local/include/ -fi - ### python build dependencies cd /src diff --git a/noisicaa.nix b/noisicaa.nix index d4fa5f79..912fc99c 100644 --- a/noisicaa.nix +++ b/noisicaa.nix @@ -98,27 +98,6 @@ let ''; }; - # dep_sort: Generic topological sorting for sorting a list of dependencies in C++17. - # https://github.com/graphitemaster/dep_sort - dep_sort = stdenv.mkDerivation rec { - pname = "dep_sort"; - version = "2018-10-18"; - - src = fetchFromGitHub { - owner = "graphitemaster"; - repo = "dep_sort"; - rev = "9e96e9426e74e6dc24ba26fdd9c2bee5bab72b0b"; - sha256 = "sha256:15dqhqdy74l38065rkn73s083gysgnwn2rvkx6id85yh57l8np6f"; - }; - - installPhase = '' - mkdir -p $out/include - cp $src/dep_sort.h $out/include/ - cp $src/dep_sort.inl $out/include/ - cp $src/dep_sort_stl.h $out/include/ - ''; - }; - # FlatBuffers: Memory Efficient Serialization Library # https://github.com/google/flatbuffers flatbuffers = stdenv.mkDerivation rec { @@ -157,7 +136,6 @@ in stdenv.mkDerivation { nixpkgs.libjack2 subprocess nixpkgs.ffmpeg.dev - dep_sort nixpkgs.fmt qt5.qmake qt5.qtbase diff --git a/noisicaa/engine/wscript b/noisicaa/engine/wscript index 678d23f4..9cd39b38 100644 --- a/noisicaa/engine/wscript +++ b/noisicaa/engine/wscript @@ -48,6 +48,7 @@ def build(ctx): 'SWRESAMPLE', 'AVUTIL', 'FLATBUFFERS', + 'DEP_SORT', 'noisicaa-core', 'noisicaa-node_lib' ], diff --git a/wscript b/wscript index 8bee9889..88d7c243 100644 --- a/wscript +++ b/wscript @@ -119,8 +119,6 @@ def configure(ctx): ctx.pkg_config('FMT', 'fmt', '7.1.3') ctx.pkg_config('PYTHON', 'python3', '3.8') - ctx.check(header_name='dep_sort_stl.h', features='cxx cxxprogram') - ctx.check_python_module('flatbuffers', condition="ver >= num(2, 0)") ctx.check_python_module('eventfd') # has no __version__