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