memstream: init at 0.1
This commit is contained in:
parent
44188d6472
commit
66f3da43f9
3 changed files with 54 additions and 0 deletions
43
pkgs/development/libraries/memstream/default.nix
Normal file
43
pkgs/development/libraries/memstream/default.nix
Normal file
|
@ -0,0 +1,43 @@
|
|||
{ lib, stdenv, fetchurl }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "memstream";
|
||||
version = "0.1";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://piumarta.com/software/memstream/memstream-${version}.tar.gz";
|
||||
sha256 = "0kvdb897g7nyviaz72arbqijk2g2wa61cmi3l5yh48rzr49r3a3a";
|
||||
};
|
||||
|
||||
dontConfigure = true;
|
||||
|
||||
postBuild = ''
|
||||
$AR rcs libmemstream.a memstream.o
|
||||
'';
|
||||
|
||||
doCheck = true;
|
||||
checkPhase = ''
|
||||
runHook preCheck
|
||||
|
||||
./test | grep "This is a test of memstream"
|
||||
|
||||
runHook postCheck
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
install -D libmemstream.a "$out"/lib/libmemstream.a
|
||||
install -D memstream.h "$out"/include/memstream.h
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://www.piumarta.com/software/memstream/";
|
||||
description = "memstream.c is an implementation of the POSIX function open_memstream() for BSD and BSD-like operating systems";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ veprbl ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
6
pkgs/development/libraries/memstream/setup-hook.sh
Normal file
6
pkgs/development/libraries/memstream/setup-hook.sh
Normal file
|
@ -0,0 +1,6 @@
|
|||
useMemstream () {
|
||||
export NIX_CFLAGS_COMPILE="${NIX_CFLAGS_COMPILE-}${NIX_CFLAGS_COMPILE:+ }-include memstream.h";
|
||||
export NIX_LDFLAGS="${NIX_LDFLAGS-}${NIX_LDFLAGS:+ }-lmemstream";
|
||||
}
|
||||
|
||||
postHooks+=(useMemstream)
|
|
@ -17309,6 +17309,11 @@ in
|
|||
|
||||
mediastreamer-openh264 = callPackage ../development/libraries/mediastreamer/msopenh264.nix { };
|
||||
|
||||
memstream = callPackage ../development/libraries/memstream { };
|
||||
memstreamHook = makeSetupHook {
|
||||
deps = [ memstream ];
|
||||
} ../development/libraries/memstream/setup-hook.sh;
|
||||
|
||||
menu-cache = callPackage ../development/libraries/menu-cache { };
|
||||
|
||||
mergerfs = callPackage ../tools/filesystems/mergerfs { };
|
||||
|
|
Loading…
Reference in a new issue