wuffs: init at 0.4.0-alpha.9 (#424125)

authored by Sandro and committed by GitHub 74f1c64c 932e0af9

+100
+87
pkgs/by-name/wu/wuffs/package.nix
··· 1 + { 2 + lib, 3 + stdenv, 4 + fetchFromGitHub, 5 + buildGoModule, 6 + makeBinaryWrapper, 7 + replaceVars, 8 + testers, 9 + }: 10 + let 11 + compiler = 12 + if stdenv.cc.isClang then 13 + "clang" 14 + else if stdenv.cc.isGNU then 15 + "gcc" 16 + else 17 + throw "unsupported compiler"; 18 + in 19 + buildGoModule (finalAttrs: { 20 + pname = "wuffs"; 21 + version = "0.4.0-alpha.9"; 22 + 23 + outputs = [ 24 + "out" 25 + "dev" 26 + "lib" 27 + ]; 28 + 29 + src = fetchFromGitHub { 30 + owner = "google"; 31 + repo = "wuffs"; 32 + tag = "v" + finalAttrs.version; 33 + hash = "sha256-XbupK4QYnPudUlO5tRWrQRncGHITzJL//Yk/E7WNxYk="; 34 + }; 35 + 36 + vendorHash = null; 37 + 38 + strictDeps = true; 39 + nativeBuildInputs = [ makeBinaryWrapper ]; 40 + 41 + subPackages = [ 42 + "cmd/wuffs-c" 43 + "cmd/wuffs" 44 + ]; 45 + 46 + # There are no checks 47 + doCheck = false; 48 + 49 + postInstall = 50 + let 51 + pkgconfig = replaceVars ./wuffs.pc { 52 + LIB = placeholder "lib"; 53 + DEV = placeholder "dev"; 54 + DESCRIPTION = finalAttrs.meta.description; 55 + VERSION = finalAttrs.version; 56 + }; 57 + in 58 + '' 59 + wrapProgram "$out/bin/wuffs" \ 60 + --prefix PATH : "$out/bin" 61 + 62 + "$out/bin/wuffs" gen std/... 63 + "$out/bin/wuffs" genlib -ccompilers=${compiler} 64 + 65 + install -Dm444 -t "$lib/lib" gen/lib/c/${compiler}-dynamic/libwuffs.* 66 + 67 + install -Dm444 release/c/wuffs-unsupported-snapshot.c "$dev/include/wuffs/wuffs-v0.4.c" 68 + 69 + install -Dm444 ${pkgconfig} "$dev/lib/pkgconfig/wuffs.pc" 70 + ''; 71 + 72 + passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; 73 + 74 + meta = { 75 + homepage = "https://github.com/google/wuffs"; 76 + description = "memory-safe programming language and standard library for wrangling untrusted data"; 77 + mainProgram = "wuffs"; 78 + pkgConfigModules = [ "wuffs" ]; 79 + license = with lib.licenses; [ 80 + mit 81 + asl20 82 + ]; 83 + maintainers = with lib.maintainers; [ 84 + RossSmyth 85 + ]; 86 + }; 87 + })
+13
pkgs/by-name/wu/wuffs/wuffs.pc
··· 1 + prefix=@LIB@ 2 + exec_prefix=${prefix} 3 + libdir=${prefix}/lib 4 + includedir=@DEV@/include/wuffs 5 + 6 + Name: wuffs 7 + Description: @DESCRIPTION@ 8 + Version: @VERSION@ 9 + Requires: 10 + Conflicts: 11 + Libs: -L${libdir} -lwuffs 12 + Libs.private: 13 + Cflags: -I${includedir}