nixpkgs/pkgs/by-name/st/stargate-libcds/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

48 lines
1.1 KiB
Nix

{ lib
, stdenv
, fetchpatch
, fetchFromGitHub
}:
stdenv.mkDerivation rec {
pname = "stargate-libcds";
version = "1.0.0";
src = fetchFromGitHub {
owner = "stargateaudio";
repo = "libcds";
rev = version;
sha256 = "sha256-THThEzS8gGdwn3h0EBttaX5ljZH9Ma2Rcg143+GIdU8=";
};
# Fix 'error: unrecognized command line option' in platforms other than x86
PLAT_FLAGS = lib.optionalString stdenv.hostPlatform.isx86_64 "-mfpmath=sse -mssse3";
patches = [
# Remove unnecessary tests (valgrind, coverage)
./Makefile.patch
# Fix for building on darwin
(fetchpatch {
name = "malloc-to-stdlib.patch";
url = "https://github.com/stargateaudio/libcds/commit/65dc08f059deda8ba5707ba6116b616d0ad0bd8d.patch";
sha256 = "sha256-FIGlobUVrDYOtnHjsWyE420PoULPHEK/3T9Fv8hfTl4=";
})
];
doCheck = true;
installPhase = ''
runHook preInstall
install -D libcds.so -t $out/lib/
runHook postInstall
'';
meta = with lib; {
description = "C data structure library";
homepage = "https://github.com/stargateaudio/libcds";
maintainers = with maintainers; [ yuu ];
license = licenses.lgpl3Only;
};
}