default.nix (928B)
1 { 2 lib, 3 stdenv, 4 rustPlatform, 5 fetchFromGitHub, 6 libiconv, 7 }: 8 9 rustPlatform.buildRustPackage (finalAttrs: { 10 pname = "xtr"; 11 version = "0.1.11"; 12 13 src = fetchFromGitHub { 14 owner = "woboq"; 15 repo = "tr"; 16 tag = "v${finalAttrs.version}"; 17 hash = "sha256-ob5vGM/YeD8JLiNX8UtYBDr5qTEaPuuZfJ+SC+jiDXA="; 18 }; 19 20 cargoLock.lockFile = ./Cargo.lock; 21 22 postPatch = '' 23 ln -s ${./Cargo.lock} Cargo.lock 24 ''; 25 26 buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ 27 libiconv 28 ]; 29 30 env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-incompatible-function-pointer-types"; 31 32 hardeningDisable = lib.optional stdenv.isDarwin "format"; 33 34 meta = { 35 description = "Translation tools for rust"; 36 homepage = "https://github.com/woboq/tr"; 37 license = with lib.licenses; [ 38 agpl3Only 39 mit 40 ]; 41 maintainers = [ lib.maintainers.sikmir ]; 42 mainProgram = "xtr"; 43 }; 44 })