diff options
author | github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | 2021-01-24 06:44:02 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-24 06:44:02 +0000 |
commit | a2994c588ade51270d8e50bc8c27a04b978afdbf (patch) | |
tree | c52380339ab5b1726e49429e2b328b3282e3720d /pkgs/tools | |
parent | b88b52998be61d3959b3b3c17bc884576eedc1da (diff) | |
parent | 2a9f33600cd8aa3c72fdcdbcc74bdd8096b81ab3 (diff) |
Merge master into staging-next
Diffstat (limited to 'pkgs/tools')
-rw-r--r-- | pkgs/tools/graphics/metapixel/default.nix | 4 | ||||
-rw-r--r-- | pkgs/tools/inputmethods/fcitx5/fcitx5-mozc.nix | 117 | ||||
-rw-r--r-- | pkgs/tools/networking/lxi-tools/default.nix | 4 | ||||
-rw-r--r-- | pkgs/tools/package-management/nix/default.nix | 4 | ||||
-rw-r--r-- | pkgs/tools/text/source-highlight/default.nix | 2 | ||||
-rw-r--r-- | pkgs/tools/typesetting/lowdown/default.nix | 7 | ||||
-rw-r--r-- | pkgs/tools/typesetting/lowdown/shared.patch | 41 |
7 files changed, 170 insertions, 9 deletions
diff --git a/pkgs/tools/graphics/metapixel/default.nix b/pkgs/tools/graphics/metapixel/default.nix index a97be7f809cd..8c9fef0cd484 100644 --- a/pkgs/tools/graphics/metapixel/default.nix +++ b/pkgs/tools/graphics/metapixel/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, libpng, libjpeg, giflib, perl, pkg-config }: +{ lib, stdenv, fetchFromGitHub, libpng, libjpeg, giflib, perl, pkg-config }: stdenv.mkDerivation rec { pname = "metapixel"; @@ -24,7 +24,7 @@ stdenv.mkDerivation rec { cp metapixel-sizesort $out/bin/metapixel-sizesort ''; - meta = with stdenv.lib; { + meta = with lib; { homepage = "https://github.com/schani/metapixel"; description = "Tool for generating photomosaics"; license = licenses.gpl2Only; diff --git a/pkgs/tools/inputmethods/fcitx5/fcitx5-mozc.nix b/pkgs/tools/inputmethods/fcitx5/fcitx5-mozc.nix new file mode 100644 index 000000000000..08f43b87cfe2 --- /dev/null +++ b/pkgs/tools/inputmethods/fcitx5/fcitx5-mozc.nix @@ -0,0 +1,117 @@ +{ lib, clangStdenv, fetchFromGitHub, fetchurl, fetchpatch, fetchgit +, python3Packages, mesa, ninja, pkg-config, protobuf, zinnia, qt5, fcitx5 +, jsoncpp, gtest, which, gtk2, unzip, abseil-cpp, breakpad }: +let + inherit (python3Packages) python gyp six; + japanese_usage_dictionary = fetchFromGitHub { + owner = "hiroyuki-komatsu"; + repo = "japanese-usage-dictionary"; + rev = "e5b3425575734c323e1d947009dd74709437b684"; + sha256 = "0pyrpz9c8nxccwpgyr36w314mi8h132cis8ijvlqmmhqxwsi30hm"; + }; + # abseil-cpp in nixpkgs is too old + abseil-cpp_2020923 = abseil-cpp.overrideAttrs (old: rec { + version = "20200923.2"; + src = fetchFromGitHub { + owner = "abseil"; + repo = "abseil-cpp"; + rev = version; + sha256 = "G+wkaC4IPtyc/xCUyVFJOcHppPFU7KkhIHjv6uhVKGU="; + }; + cmakeFlags = [ "-DCMAKE_CXX_STANDARD=17" "-DBUILD_SHARED_LIBS=ON" ]; + }); + zipcode_rel = "202011"; + jigyosyo = fetchurl { + url = "https://osdn.net/projects/ponsfoot-aur/storage/mozc/jigyosyo-${zipcode_rel}.zip"; + sha256 = "j7MkNtd4+QTi91EreVig4/OV0o5y1+KIjEJBEmLK/mY="; + }; + x-ken-all = fetchurl { + url = + "https://osdn.net/projects/ponsfoot-aur/storage/mozc/x-ken-all-${zipcode_rel}.zip"; + sha256 = "ExS0Cg3rs0I9IOVbZHLt8UEfk8/LmY9oAHPVVlYuTPw="; + }; + +in clangStdenv.mkDerivation rec { + pname = "fcitx5-mozc"; + version = "2.26.4220.102"; + + src = fetchFromGitHub { + owner = "fcitx"; + repo = "mozc"; + rev = "1882e33b61673b66d63277f82b4c80ae4e506c10"; + sha256 = "R+w0slVFpqtt7PIr1pyupJjRoQsABVZiMdZ9fKGKAqw="; + }; + + nativeBuildInputs = [ gyp ninja mesa python pkg-config qt5.wrapQtAppsHook six which unzip ]; + + buildInputs = [ protobuf zinnia qt5.qtbase fcitx5 abseil-cpp_2020923 jsoncpp gtest gtk2 ]; + + patches = [ + # Support linking system abseil-cpp + (fetchpatch { + url = "https://salsa.debian.org/debian/mozc/-/raw/debian/sid/debian/patches/0007-Update-src-base-absl.gyp.patch"; + sha256 = "UiS0UScDKyAusXOhc7Bg8dF8ARQQiVTylEhAOxqaZt8="; + }) + + ]; + + postUnpack = '' + unzip ${x-ken-all} -d $sourceRoot/src/ + unzip ${jigyosyo} -d $sourceRoot/src/ + + rmdir $sourceRoot/src/third_party/breakpad/ + ln -s ${breakpad} $sourceRoot/src/third_party/breakpad + rmdir $sourceRoot/src/third_party/gtest/ + ln -s ${gtest} $sourceRoot/src/third_party/gtest + rmdir $sourceRoot/src/third_party/gyp/ + ln -s ${gyp} $sourceRoot/src/third_party/gyp + rmdir $sourceRoot/src/third_party/japanese_usage_dictionary/ + ln -s ${japanese_usage_dictionary} $sourceRoot/src/third_party/japanese_usage_dictionary + ''; + + # Copied from https://github.com/archlinux/svntogit-community/blob/packages/fcitx5-mozc/trunk/PKGBUILD + configurePhase = '' + cd src + export GYP_DEFINES="document_dir=$out/share/doc/mozc use_libzinnia=1 use_libprotobuf=1 use_libabseil=1" + + # disable fcitx4 + rm unix/fcitx/fcitx.gyp + + # gen zip code seed + PYTHONPATH="$PWD:$PYTHONPATH" python dictionary/gen_zip_code_seed.py --zip_code="x-ken-all.csv" --jigyosyo="JIGYOSYO.CSV" >> data/dictionary_oss/dictionary09.txt + + # use libstdc++ instead of libc++ + sed "/stdlib=libc++/d;/-lc++/d" -i gyp/common.gypi + + # run gyp + python build_mozc.py gyp --gypdir=${gyp}/bin --server_dir=$out/lib/mozc + ''; + + buildPhase = '' + python build_mozc.py build -c Release \ + server/server.gyp:mozc_server \ + gui/gui.gyp:mozc_tool \ + unix/fcitx5/fcitx5.gyp:fcitx5-mozc + ''; + + installPhase = '' + export PREFIX=$out + export _bldtype=Release + ../scripts/install_server + install -d $out/share/licenses/fcitx5-mozc + head -n 29 server/mozc_server.cc > $out/share/licenses/fcitx5-mozc/LICENSE + install -m644 data/installer/*.html $out/share/licenses/fcitx5-mozc/ + install -d $out/share/fcitx5/addon + install -d $out/share/fcitx5/inputmethod + install -d $out/lib/fcitx5 + ../scripts/install_fcitx5 + ''; + + meta = with lib; { + description = "Fcitx5 Module of A Japanese Input Method for Chromium OS, Windows, Mac and Linux (the Open Source Edition of Google Japanese Input)"; + homepage = "https://github.com/fcitx/mozc"; + license = licenses.bsd3; + maintainers = with maintainers; [ berberman ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/tools/networking/lxi-tools/default.nix b/pkgs/tools/networking/lxi-tools/default.nix index 3f3e62fb8075..92ef7f688a5a 100644 --- a/pkgs/tools/networking/lxi-tools/default.nix +++ b/pkgs/tools/networking/lxi-tools/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub +{ lib, stdenv, fetchFromGitHub , autoreconfHook, pkg-config , liblxi, readline, lua }: @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { buildInputs = [ liblxi readline lua ]; - meta = with stdenv.lib; { + meta = with lib; { description = "Tool for communicating with LXI compatible instruments"; longDescription = '' lxi-tools is a collection of open source software tools diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix index 495d0aae018a..2437613755d5 100644 --- a/pkgs/tools/package-management/nix/default.nix +++ b/pkgs/tools/package-management/nix/default.nix @@ -45,7 +45,7 @@ common = [ autoreconfHook autoconf-archive bison flex - lowdown mdbook + (lib.getBin lowdown) mdbook jq ]; @@ -55,7 +55,7 @@ common = ] ++ lib.optionals stdenv.isDarwin [ Security ] ++ lib.optional (stdenv.isLinux || stdenv.isDarwin) libsodium - ++ lib.optionals is24 [ libarchive gmock ] + ++ lib.optionals is24 [ libarchive gmock lowdown ] ++ lib.optional withLibseccomp libseccomp ++ lib.optional withAWS ((aws-sdk-cpp.override { diff --git a/pkgs/tools/text/source-highlight/default.nix b/pkgs/tools/text/source-highlight/default.nix index 3d3a0f8c50a6..2e60d2a31c0c 100644 --- a/pkgs/tools/text/source-highlight/default.nix +++ b/pkgs/tools/text/source-highlight/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation { # source-highlight uses it's own binary to generate documentation. # During cross-compilation, that binary was built for the target # platform architecture, so it can't run on the build host. - patchPhase = stdenv.lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + patchPhase = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' substituteInPlace Makefile.in --replace "src doc tests" "src tests" ''; diff --git a/pkgs/tools/typesetting/lowdown/default.nix b/pkgs/tools/typesetting/lowdown/default.nix index 522c3438d901..668e54c17307 100644 --- a/pkgs/tools/typesetting/lowdown/default.nix +++ b/pkgs/tools/typesetting/lowdown/default.nix @@ -4,7 +4,7 @@ stdenv.mkDerivation rec { pname = "lowdown"; version = "0.7.9"; - outputs = [ "out" "dev" ]; + outputs = [ "out" "lib" "dev" "man" ]; src = fetchurl { url = "https://kristaps.bsd.lv/lowdown/snapshots/lowdown-${version}.tar.gz"; @@ -16,9 +16,12 @@ stdenv.mkDerivation rec { configurePhase = '' ./configure PREFIX=''${!outputDev} \ BINDIR=''${!outputBin}/bin \ - MANDIR=''${!outputBin}/share/man + LIBDIR=''${!outputLib}/lib \ + MANDIR=''${!outputMan}/share/man ''; + patches = lib.optional (!stdenv.hostPlatform.isStatic) ./shared.patch; + meta = with lib; { homepage = "https://kristaps.bsd.lv/lowdown/"; description = "Simple markdown translator"; diff --git a/pkgs/tools/typesetting/lowdown/shared.patch b/pkgs/tools/typesetting/lowdown/shared.patch new file mode 100644 index 000000000000..ed9f266b3f9c --- /dev/null +++ b/pkgs/tools/typesetting/lowdown/shared.patch @@ -0,0 +1,41 @@ +diff --git a/Makefile b/Makefile +index 955f737..2c9532c 100644 +--- a/Makefile ++++ b/Makefile +@@ -80,7 +80,7 @@ REGRESS_ARGS += "--parse-no-autolink" + REGRESS_ARGS += "--parse-no-cmark" + REGRESS_ARGS += "--parse-no-deflists" + +-all: lowdown lowdown-diff lowdown.pc ++all: lowdown lowdown-diff liblowdown.so lowdown.pc + + www: $(HTMLS) $(PDFS) $(THUMBS) lowdown.tar.gz lowdown.tar.gz.sha512 + +@@ -101,6 +101,9 @@ lowdown-diff: lowdown + liblowdown.a: $(OBJS) $(COMPAT_OBJS) + $(AR) rs $@ $(OBJS) $(COMPAT_OBJS) + ++liblowdown.so: $(OBJS) $(COMPAT_OBJS) ++ $(CC) -shared -o $@ $(OBJS) $(COMPAT_OBJS) $(LDFLAGS) ++ + install: all + mkdir -p $(DESTDIR)$(BINDIR) + mkdir -p $(DESTDIR)$(LIBDIR)/pkgconfig +@@ -111,7 +114,7 @@ install: all + $(INSTALL_DATA) lowdown.pc $(DESTDIR)$(LIBDIR)/pkgconfig + $(INSTALL_PROGRAM) lowdown $(DESTDIR)$(BINDIR) + $(INSTALL_PROGRAM) lowdown-diff $(DESTDIR)$(BINDIR) +- $(INSTALL_LIB) liblowdown.a $(DESTDIR)$(LIBDIR) ++ $(INSTALL_LIB) liblowdown.so $(DESTDIR)$(LIBDIR) + $(INSTALL_DATA) lowdown.h $(DESTDIR)$(INCLUDEDIR) + for f in $(MANS) ; do \ + name=`basename $$f .html` ; \ +@@ -199,7 +202,7 @@ main.o: lowdown.h + + clean: + rm -f $(OBJS) $(COMPAT_OBJS) main.o +- rm -f lowdown lowdown-diff liblowdown.a lowdown.pc ++ rm -f lowdown lowdown-diff liblowdown.so lowdown.pc + rm -f index.xml diff.xml diff.diff.xml README.xml lowdown.tar.gz.sha512 lowdown.tar.gz + rm -f $(PDFS) $(HTMLS) $(THUMBS) + |