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

libnop: init at 0-unstable-2022-09-04 #393017

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions pkgs/by-name/li/libnop/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
lib,
stdenv,
fetchFromGitHub,
gnumake,
}:

stdenv.mkDerivation (finalAttrs: {
pname = "libnop";
version = "0-unstable-2022-09-04";

src = fetchFromGitHub {
owner = "luxonis";
repo = "libnop";
rev = "ab842f51dc2eb13916dc98417c2186b78320ed10";
sha256 = "sha256-d2z/lDI9pe5TR82MxGkR9bBMNXPvzqb9Gsd5jOv6x1A=";
};

# Since this is a header-only library, we can skip build phase
# and just install the headers directly
dontBuild = true;

# Skip the tests to avoid compilation errors
doCheck = false;

# Install headers to the correct location as this is a header-only library
installPhase = ''
mkdir -p $out/include
cp -r $src/include/* $out/include/

# Create pkg-config file
mkdir -p $out/lib/pkgconfig
cat > $out/lib/pkgconfig/libnop.pc << EOF
includedir=$out/include

Name: libnop
Description: Header-only C++ serialization library
Version: ${finalAttrs.version}
Cflags: -I\$includedir
EOF
'';

meta = {
description = "A fast, header-only C++ serialization library";
homepage = "https://github.com/google/libnop";
license = lib.licenses.asl20;
platforms = lib.platforms.all;
maintainers = with lib.maintainers; [ phodina ];
};
})