Skip to content

Commit

Permalink
refactor(nix): cleaned up fake-udev derivation
Browse files Browse the repository at this point in the history
  • Loading branch information
cliarena committed Mar 8, 2024
1 parent 5c0debb commit 92dd85f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 55 deletions.
61 changes: 7 additions & 54 deletions nix/wolf.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,70 +3,24 @@ let
fake-udev = pkgs.stdenv.mkDerivation {
pname = "fake-udev";
version = "1.0";
src = self;
src = "${self}/src/fake-udev";

nativeBuildInputs = with pkgs; [ cmake pkg-config ninja autoPatchelfHook ];

buildInputs = with pkgs; [
glibc.static
deps.gst-wayland-display
wayland
icu
pciutils
git
range-v3
elfutils
libinput
libxkbcommon
pcre2
libunwind
orc
libdrm
boost175
gst_all_1.gstreamer
# Common plugins like "filesrc" to combine within e.g. gst-launch
gst_all_1.gst-plugins-base
# Specialized plugins separated by quality
gst_all_1.gst-plugins-good
gst_all_1.gst-plugins-bad
gst_all_1.gst-plugins-ugly
# Plugins to reuse ffmpeg to play almost every video format
gst_all_1.gst-libav
# Support the Video Audio (Hardware) Acceleration API
gst_all_1.gst-vaapi
libevdev
libpulseaudio
openssl
curl
];
buildInputs = with pkgs; [ glibc.static ];

cmakeFlags = [
"-DFETCHCONTENT_SOURCE_DIR_IMMER=${deps.immer_src}"
"-DFETCHCONTENT_SOURCE_DIR_EVENTBUS=${deps.eventbus_src}"
"-DFETCHCONTENT_SOURCE_DIR_BOOST_JSON=${deps.boost-json_src}"
"-DFETCHCONTENT_SOURCE_DIR_RANGE=${deps.range_src}"
"-DFETCHCONTENT_SOURCE_DIR_FMTLIB=${deps.fmtlib_src}"
"-DFETCHCONTENT_SOURCE_DIR_NANORS=${deps.nanors_src}"
"-DFETCHCONTENT_SOURCE_DIR_PEGLIB=${deps.peglib_src}"
"-DFETCHCONTENT_SOURCE_DIR_SIMPLEWEBSERVER=${deps.simplewebserver_src}"
"-DFETCHCONTENT_SOURCE_DIR_TOML=${deps.toml_src}"
"-DFETCHCONTENT_SOURCE_DIR_ENET=${deps.enet_src}"
"-DFETCHCONTENT_SOURCE_DIR_CPPTRACE=${deps.cpptrace_src}"
"-DFETCHCONTENT_SOURCE_DIR_LIBDWARF=${deps.libdwarf_src}"
"-DCMAKE_BUILD_TYPE=Release"
"-DCMAKE_CXX_STANDARD=17"
"-DCMAKE_CXX_EXTENSIONS=OFF"
"-DBUILD_SHARED_LIBS=OFF"
"-DBUILD_FAKE_UDEV_CLI=ON"
"-DBUILD_TESTING=OFF"
"-G Ninja"
];
buildPhase = ''
ninja fake-udev
'';

buildPhase = "ninja fake-udev";
installPhase = ''
mkdir -p $out/bin
cp ./src/fake-udev/fake-udev $out/bin/fake-udev
cp ./fake-udev $out/bin/fake-udev
'';
};
in pkgs.stdenv.mkDerivation {
Expand Down Expand Up @@ -135,9 +89,8 @@ in pkgs.stdenv.mkDerivation {
"-DBUILD_TESTING=OFF"
"-G Ninja"
];
buildPhase = ''
ninja wolf
'';

buildPhase = "ninja wolf";
installPhase = ''
mkdir -p $out/bin
cp ./src/moonlight-server/wolf $out/bin/wolf
Expand Down
10 changes: 9 additions & 1 deletion src/fake-udev/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
cmake_minimum_required(VERSION 3.13...3.24)

# Project name and a few useful settings. Other commands can pick up the results
project(fake-udev
VERSION 0.1
DESCRIPTION "Howling under the Moonlight"
LANGUAGES CXX)

option(BUILD_FAKE_UDEV_CLI "Build fake-udev CLI executable" ON)
if (BUILD_FAKE_UDEV_CLI)
message(STATUS "Building fake-udev CLI tool")
Expand All @@ -15,4 +23,4 @@ if (BUILD_FAKE_UDEV_CLI)
add_executable(fake-udev fake-udev-cli.cpp)
target_link_libraries(fake-udev fake-udev::lib -static)
target_compile_features(fake-udev PRIVATE cxx_std_17)
endif ()
endif ()

0 comments on commit 92dd85f

Please sign in to comment.