Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 stdenv, 4 fetchurl, 5 buildPackages, 6}: 7 8stdenv.mkDerivation rec { 9 pname = "anthy"; 10 version = "9100h"; 11 12 postPatch = lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' 13 # for cross builds, copy build tools from the native package 14 cp -r "${buildPackages.anthy.dev}"/lib/internals/{mkdepgraph,.libs} depgraph/ 15 cp -r "${buildPackages.anthy.dev}"/lib/internals/{mkworddic,.libs} mkworddic/ 16 cp -r "${buildPackages.anthy.dev}"/lib/internals/{calctrans,.libs} calctrans/ 17 cp -r "${buildPackages.anthy.dev}"/lib/internals/{mkfiledic,.libs} mkanthydic/ 18 substituteInPlace mkworddic/Makefile.in \ 19 --replace-fail 'anthy.wdic : mkworddic' 'anthy.wdic : ' \ 20 --replace-fail 'all: ' 'all: anthy.wdic #' 21 substituteInPlace calctrans/Makefile.in \ 22 --replace-fail '$(dict_source_files): $(srcdir)/corpus_info $(srcdir)/weak_words calctrans' \ 23 '$(dict_source_files): $(srcdir)/corpus_info $(srcdir)/weak_words' \ 24 --replace-fail 'all-am: Makefile $(PROGRAMS) $(DATA)' 'all-am: $(DATA)' 25 substituteInPlace depgraph/Makefile.in \ 26 --replace-fail 'anthy.dep : mkdepgraph' 'anthy.dep : ' \ 27 --replace-fail 'all-am: Makefile $(PROGRAMS) $(DATA)' 'all-am: $(DATA)' 28 substituteInPlace mkanthydic/Makefile.in \ 29 --replace-fail 'anthy.dic : mkfiledic' 'anthy.dic : ' \ 30 --replace-fail 'all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(DATA)' 'all-am: $(DATA)' 31 ''; 32 33 outputs = [ 34 "out" 35 "dev" 36 ]; 37 38 meta = with lib; { 39 description = "Hiragana text to Kana Kanji mixed text Japanese input method"; 40 homepage = "https://anthy.osdn.jp/"; 41 license = licenses.gpl2Plus; 42 maintainers = with maintainers; [ ]; 43 platforms = platforms.unix; 44 }; 45 46 postFixup = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' 47 # not relevant for installed package 48 mkdir "$dev/lib/internals" 49 cp -r depgraph/{mkdepgraph,.libs} mkworddic/{mkworddic,.libs} calctrans/{calctrans,.libs} mkanthydic/{mkfiledic,.libs} "$dev/lib/internals" 50 ''; 51 52 src = fetchurl { 53 url = "mirror://osdn/anthy/37536/anthy-${version}.tar.gz"; 54 sha256 = "0ism4zibcsa5nl77wwi12vdsfjys3waxcphn1p5s7d0qy1sz0mnj"; 55 }; 56}