Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NixOS Derivation #420

Closed
FredM7 opened this issue Nov 30, 2023 · 2 comments
Closed

NixOS Derivation #420

FredM7 opened this issue Nov 30, 2023 · 2 comments

Comments

@FredM7
Copy link

FredM7 commented Nov 30, 2023

Hi, I see some related issues here:

But im not exactly sure what im missing extra. Maybe someone with more experience can point out what i missing.

This is my derivation:

logiops.nix

{ pkgs, stdenv, fetchFromGitHub, pkg-config, cmake, git, 
  libevdev, libudev-zero, glib, libconfig, pcre, pcre2, 
  libuuid, libselinux, libsepol
}:
stdenv.mkDerivation rec {
  name = "logiops";
  version = "0.3.4";

  src = fetchFromGitHub {
    owner  = "PixlOne";
    repo   = "logiops";
    rev    = "v0.3.3";
    sha256 = "sha256-tKVRPT96VYLLuGEv4cgHE37SsgCF/bahWXKjuwczZm8="; # pkgs.lib.fakeSha256;
  };

  buildInputs = [
    cmake libevdev glib pkg-config libconfig libudev-zero pcre pcre2 libuuid libselinux libsepol git
  ];

  buildPhase = ''
    mkdir -p $out
    cd $out
    cmake -DCMAKE_BUILD_TYPE=Release ..
    make
  '';

  installPhase = ''
    make install
  '';
}

I get some errors though:

warning: The interpretation of store paths arguments ending in `.drv` recently changed. If this command is now failing try again with '/n
configuring
configuring
fixing cmake files...
configuring
configuring
configuring
fixing cmake files...
cmake flags: -DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_BUILD_TYPE=Release -D>
-- The C compiler identification is GNU 12.3.0
-- The CXX compiler identification is GNU 12.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /nix/store/90h6k8ylkgn81k10190v5c9ldyjpzgl9-gcc-wrapper-12.3.0/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /nix/store/90h6k8ylkgn81k10190v5c9ldyjpzgl9-gcc-wrapper-12.3.0/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: /nix/store/zcpq1fivdd131gshg58m4cyq7fwqr3j8-git-2.42.0/bin/git (found version "2.42.0") 
LogiOps Version Number: null
CMake Error at CMakeLists.txt:59 (add_subdirectory):
  The source directory

    /build/source/src/ipcgull

  does not contain a CMakeLists.txt file.


-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Found PkgConfig: /nix/store/ljrkf0kwgckcy02kdlz8sjdnxb2pwjb4-pkg-config-wrapper-0.29.2/bin/pkg-config (found version "0.29.2") 
-- Checking for module 'libevdev'
--   Found libevdev, version 1.13.1
-- Checking for module 'systemd'
--   No package 'systemd' found
-- Checking for module 'libconfig'
--   Found libconfig, version 1.7.3
-- Checking for module 'libudev'
--   Found libudev, version 251
/build/source/src/logid/../ipcgull/src/include
-- dbus system policy will be installed at /var/empty/share/dbus-1/system.d
-- Configuring incomplete, errors occurred!

Is there anything specific i can do to fix this? Seems to be coming from ipcgull?

@Serpentian
Copy link

Serpentian commented Jan 6, 2024

@FredM7, fetchSubmodules must be added. Here's the working flake I use:

{ lib, stdenv, fetchFromGitHub, pkg-config, cmake, udev, libevdev, libconfig, glib }:

stdenv.mkDerivation rec {
  pname = "logiops";
  version = "0.3.1";

  src = fetchFromGitHub {
    owner = "pixlone";
    repo = "logiops";
    rev = "v${version}";
    sha256 = "sha256-1KrehE+eHXPth4kVHh1HZgqZqL+2Fi+k3IhPKunINXs=";
    fetchSubmodules = true;
  };

  PKG_CONFIG_SYSTEMD_SYSTEMDSYSTEMUNITDIR = "${placeholder "out"}/lib/systemd/system";

  nativeBuildInputs = [ cmake pkg-config ];
  buildInputs = [ udev libevdev libconfig glib ];

  meta = with lib; {
    description = "Unofficial userspace driver for HID++ Logitech devices";
    homepage = "https://github.com/PixlOne/logiops";
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ ckie ];
    platforms = with platforms; linux;
  };
}

It seems, that 0.3.1 is the last version, which at least launches on Nix. All consequent versions exit silently with return code 0

@FredM7
Copy link
Author

FredM7 commented Jan 10, 2024

thanks @Serpentian i think that did the trick 💪🏻

@FredM7 FredM7 closed this as completed Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants