Error when compiling from source: `main module (github.com/owncloud/ocis/v2) does not contain package github.com/owncloud/ocis/v2/tests/ociswrapper`

I’m trying to build OCIS from source on NixOS, but I’m running into this error:

ocis> Building subPackage ./tests/ociswrapper
ocis> main module (github.com/owncloud/ocis/v2) does not contain package github.com/owncloud/ocis/v2/tests/ociswrapper

What could be causing this?

Here’s my package definition, if that’s useful:

{
  lib,
  buildGoModule,
  fetchFromGitHub,
  pkgs
}:

buildGoModule rec {
  pname = "ocis";
  version = "6.2.0";

  src = fetchFromGitHub {
    owner = "owncloud";
    repo = "ocis";
    rev = "v${version}";
    hash = "sha256-bdHI0kIz8up2KmYg1EDmtuNFv/LxbRCAZwySkHlMyiE=";
  };

  vendorHash = null;

  buildInputs = with pkgs; [
    libxcrypt 
  ];

  ldflags = [ "-s" "-w" ];

  meta = {
    description = "ownCloud Infinite Scale";
    homepage = "https://github.com/owncloud/ocis";
    changelog = "https://github.com/owncloud/ocis/blob/${src.rev}/CHANGELOG.md";
    license = lib.licenses.asl20;
    # maintainers = with lib.maintainers; [ ];
    mainProgram = "ocis";
  };
}

I am not familiar with building NixOS package but for some reason it seems to pick the wrong submodules to build. The main ocis binary is in ./ocis/cmd/ocis. You might wanna check Build | ownCloud for how to build ocis.

2 Likes