From 5dc55761c95901f14cded3d70ab41b0d477da99e Mon Sep 17 00:00:00 2001 From: Aidan Gauland Date: Fri, 12 Aug 2022 16:55:29 +1200 Subject: [PATCH 1/5] semver: init at 0.3.0 --- .../libraries/semver-cpp/default.nix | 31 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 33 insertions(+) create mode 100644 pkgs/development/libraries/semver-cpp/default.nix diff --git a/pkgs/development/libraries/semver-cpp/default.nix b/pkgs/development/libraries/semver-cpp/default.nix new file mode 100644 index 000000000000..966f170eaad0 --- /dev/null +++ b/pkgs/development/libraries/semver-cpp/default.nix @@ -0,0 +1,31 @@ +{ lib +, stdenvNoCC +, fetchFromGitHub +}: + +stdenvNoCC.mkDerivation rec { + pname = "semver-cpp"; + version = "0.3.0"; + + src = fetchFromGitHub { + owner = "Neargye"; + repo = "semver"; + rev = "v${version}"; + sha256 = "sha256-nRWmY/GJtSkPJIW7i7/eIr/YtfyvYhJVZBRIDXUC7xg="; + }; + + # Header-only library. + dontBuild = true; + + installPhase = '' + mkdir "$out" + cp -r include "$out" + ''; + + meta = with lib; { + description = "Semantic Versioning for modern C++"; + homepage = "https://github.com/Neargye/semver"; + maintainers = with maintainers; [ aidalgol ]; + license = licenses.mit; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 41ff5fb69f59..73d8757b4ff9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -22309,6 +22309,8 @@ with pkgs; seasocks = callPackage ../development/libraries/seasocks { }; + semver-cpp = callPackage ../development/libraries/semver-cpp { }; + serd = callPackage ../development/libraries/serd {}; serf = callPackage ../development/libraries/serf { From 4e7bf713cfdf337d5ea5378a4a1ab39b32e093e6 Mon Sep 17 00:00:00 2001 From: Aidan Gauland Date: Fri, 12 Aug 2022 17:19:24 +1200 Subject: [PATCH 2/5] fancypp: init at 2021-04-08 --- .../development/libraries/fancypp/default.nix | 31 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 33 insertions(+) create mode 100644 pkgs/development/libraries/fancypp/default.nix diff --git a/pkgs/development/libraries/fancypp/default.nix b/pkgs/development/libraries/fancypp/default.nix new file mode 100644 index 000000000000..a4fe5cc70af2 --- /dev/null +++ b/pkgs/development/libraries/fancypp/default.nix @@ -0,0 +1,31 @@ +{ lib +, stdenvNoCC +, fetchFromGitHub +}: + +stdenvNoCC.mkDerivation rec { + pname = "fancypp"; + version = "2021-04-08"; + + src = fetchFromGitHub { + owner = "Curve"; + repo = "fancypp"; + rev = "ede7f712a08f7c66ff4a5590ad94a477c48850a5"; + sha256 = "sha256-E2JsQnvrqrZFYo+xBJr7xDCoPnRQftqUjjBpZzFvIic="; + }; + + # Header-only library. + dontBuild = true; + + installPhase = '' + mkdir "$out" + cp -r include "$out" + ''; + + meta = with lib; { + description = "Tiny C++ Library for terminal colors and more!"; + homepage = "https://github.com/Curve/fancypp"; + maintainers = with maintainers; [ aidalgol ]; + license = licenses.mit; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 73d8757b4ff9..02645ef1bc94 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18742,6 +18742,8 @@ with pkgs; factor-lang-scope = callPackage ../development/compilers/factor-lang/scope.nix { }; factor-lang = factor-lang-scope.interpreter; + fancypp = callPackage ../development/libraries/fancypp { }; + far2l = callPackage ../applications/misc/far2l { stdenv = if stdenv.cc.isClang then llvmPackages.stdenv else stdenv; inherit (darwin.apple_sdk.frameworks) IOKit Carbon Cocoa AudioToolbox OpenGL; From 171bd946e76a4c030062970515e14694591442ff Mon Sep 17 00:00:00 2001 From: Aidan Gauland Date: Fri, 12 Aug 2022 17:19:41 +1200 Subject: [PATCH 3/5] httplib: init at 0.11.1 --- .../development/libraries/httplib/default.nix | 31 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 33 insertions(+) create mode 100644 pkgs/development/libraries/httplib/default.nix diff --git a/pkgs/development/libraries/httplib/default.nix b/pkgs/development/libraries/httplib/default.nix new file mode 100644 index 000000000000..19618613ee17 --- /dev/null +++ b/pkgs/development/libraries/httplib/default.nix @@ -0,0 +1,31 @@ +{ lib +, stdenvNoCC +, fetchFromGitHub +}: + +stdenvNoCC.mkDerivation rec { + pname = "httplib"; + version = "0.11.1"; + + src = fetchFromGitHub { + owner = "yhirose"; + repo = "cpp-httplib"; + rev = "v${version}"; + sha256 = "sha256-rsElqtoRz/sOXpAsfSJbMlwIKdaGJkSZfKHzB/wMhY8="; + }; + + # Header-only library. + dontBuild = true; + + installPhase = '' + mkdir -p "$out/include" + cp -r httplib.h "$out/include" + ''; + + meta = with lib; { + description = "A C++ header-only HTTP/HTTPS server and client library"; + homepage = "https://github.com/yhirose/cpp-httplib"; + maintainers = with maintainers; [ aidalgol ]; + license = licenses.mit; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 02645ef1bc94..5b9d9b2cb576 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -19052,6 +19052,8 @@ with pkgs; graphinder = callPackage ../tools/security/graphinder { }; + httplib = callPackage ../development/libraries/httplib { }; + icon-lang = callPackage ../development/interpreters/icon-lang { }; libgit2 = callPackage ../development/libraries/libgit2 { From 1e2b2255d7780498fbc5e2a2e63cf215040c2d5d Mon Sep 17 00:00:00 2001 From: Aidan Gauland Date: Tue, 23 Aug 2022 21:57:57 +1200 Subject: [PATCH 4/5] fancypp: 2021-04-08 -> unstable-2021-04-08 --- pkgs/development/libraries/fancypp/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/fancypp/default.nix b/pkgs/development/libraries/fancypp/default.nix index a4fe5cc70af2..f93ab77c63de 100644 --- a/pkgs/development/libraries/fancypp/default.nix +++ b/pkgs/development/libraries/fancypp/default.nix @@ -5,7 +5,7 @@ stdenvNoCC.mkDerivation rec { pname = "fancypp"; - version = "2021-04-08"; + version = "unstable-2021-04-08"; src = fetchFromGitHub { owner = "Curve"; From 28b3bd0395a56a7b6100e35cdde3082fff81dfa0 Mon Sep 17 00:00:00 2001 From: Aidan Gauland Date: Tue, 9 Aug 2022 20:16:20 +1200 Subject: [PATCH 5/5] soundux: init at 0.2.7 --- pkgs/applications/audio/soundux/default.nix | 142 ++++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 + 2 files changed, 146 insertions(+) create mode 100644 pkgs/applications/audio/soundux/default.nix diff --git a/pkgs/applications/audio/soundux/default.nix b/pkgs/applications/audio/soundux/default.nix new file mode 100644 index 000000000000..f6616e58353e --- /dev/null +++ b/pkgs/applications/audio/soundux/default.nix @@ -0,0 +1,142 @@ +{ lib +, stdenv +, fetchFromGitHub +, cmake +, pkg-config +, makeBinaryWrapper +, pipewire +, libpulseaudio +, libappindicator +, libstartup_notification +, openssl +, libwnck +, pcre +, util-linux +, libselinux +, libsepol +, libthai +, libdatrie +, xorg +, libxkbcommon +, libepoxy +, dbus +, at-spi2-core +, nlohmann_json +, fancypp +, httplib +, semver-cpp +, webkitgtk +, yt-dlp +, ffmpeg +, lsb-release +}: + +stdenv.mkDerivation rec { + pname = "soundux"; + version = "0.2.7"; + + src = fetchFromGitHub { + owner = "Soundux"; + repo = "Soundux"; + rev = version; + sha256 = "sha256-aSCsg6nJt6F+6O7UeXnvYva0vllTfsxK/cjaeOhObZY="; + fetchSubmodules = true; + }; + + nativeBuildInputs = [ + cmake + pkg-config + makeBinaryWrapper + ]; + + buildInputs = [ + pipewire + libpulseaudio + libappindicator + openssl + libwnck + pcre + util-linux + libselinux + libsepol + libthai + libdatrie + xorg.libXdmcp + xorg.libXtst + xorg.libXres + libxkbcommon + libepoxy + dbus + at-spi2-core + nlohmann_json + fancypp + httplib + semver-cpp + libstartup_notification + webkitgtk + yt-dlp + ffmpeg + ]; + + postPatch = '' + # cannot be overwritten with variables + substituteInPlace CMakeLists.txt \ + --replace "set(CMAKE_INSTALL_PREFIX \"/opt/soundux\" CACHE PATH \"Install path prefix, prepended onto install directories.\" FORCE)" "" \ + --replace "/usr/share" "$out/usr/share" + substituteInPlace src/ui/impl/webview/webview.cpp \ + --replace "/usr/share/pixmaps/soundux.png" "$out/share/pixmaps/soundux.png" + ''; + + # We need to append /opt to our CMAKE_INSTALL_PREFIX + dontAddPrefix = true; + + preConfigure = '' + # This needs to be set in preConfigure to access the $prefix variable + export cmakeFlags="-DCMAKE_INSTALL_PREFIX=$prefix/opt $cmakeFlags" + + # Replace some fetched submodules with symlinks nix packages. + rm -rf \ + lib/json \ + lib/fancypp \ + lib/lib-httplib \ + lib/semver + + ln -s ${nlohmann_json} lib/json + ln -s ${fancypp} lib/fancypp + ln -s ${httplib} lib/lib-httplib + ln -s ${semver-cpp} lib/semver + ''; + + # Somehow some of the install destination paths in the build system still + # gets transformed to point to /var/empty/share, even though they are at least + # relative to the nix output directory with our earlier patching. + postInstall = '' + mv "$out/var/empty/share" "$out" + rm -rf "$out/var" + mkdir "$out/bin" + ln -s "$out/opt/soundux" "$out/bin" + substituteInPlace "$out/share/applications/soundux.desktop" \ + --replace "/opt/soundux/soundux" "soundux" + ''; + + postFixup = let + rpaths = lib.makeLibraryPath [libwnck pipewire libpulseaudio]; + in '' + # Wnck, PipeWire, and PulseAudio are dlopen-ed by Soundux, so they do + # not end up on the RPATH during the build process. + patchelf --add-rpath "${rpaths}" "$out/opt/soundux-${version}" + + # Work around upstream bug https://github.com/Soundux/Soundux/issues/435 + wrapProgram "$out/bin/soundux" \ + --set WEBKIT_DISABLE_COMPOSITING_MODE 1 \ + --prefix PATH : ${lib.makeBinPath [ yt-dlp ffmpeg lsb-release ]} \ + ''; + + meta = with lib; { + description = "A cross-platform soundboard."; + homepage = "https://soundux.rocks/"; + license = licenses.gpl3Plus; + platforms = platforms.linux; + maintainers = with maintainers; [ aidalgol ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 5b9d9b2cb576..64d009d87d31 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -24093,6 +24093,10 @@ with pkgs; boost = boost172; }; + soundux = callPackage ../applications/audio/soundux { + yt-dlp = yt-dlp.override { withAlias = true; }; + }; + tomcat_connectors = callPackage ../servers/http/apache-modules/tomcat-connectors { }; tomcat-native = callPackage ../servers/http/tomcat/tomcat-native.nix { };