diff options
-rw-r--r-- | pkgs/applications/misc/nnn/default.nix | 4 | ||||
-rw-r--r-- | pkgs/applications/window-managers/i3/wmfocus.nix | 34 | ||||
-rw-r--r-- | pkgs/development/python-modules/cairocffi/0_9.nix | 26 | ||||
-rw-r--r-- | pkgs/development/python-modules/cairocffi/default.nix | 71 | ||||
-rw-r--r-- | pkgs/development/python-modules/cairocffi/generic.nix | 51 | ||||
-rw-r--r-- | pkgs/tools/networking/ngrok-2/default.nix | 39 | ||||
-rwxr-xr-x | pkgs/tools/networking/ngrok-2/update | 40 | ||||
-rw-r--r-- | pkgs/tools/networking/ngrok-2/versions.json | 32 | ||||
-rw-r--r-- | pkgs/top-level/python-packages.nix | 7 |
9 files changed, 202 insertions, 102 deletions
diff --git a/pkgs/applications/misc/nnn/default.nix b/pkgs/applications/misc/nnn/default.nix index c1bdc1bcfef23..5367ef5330212 100644 --- a/pkgs/applications/misc/nnn/default.nix +++ b/pkgs/applications/misc/nnn/default.nix @@ -4,13 +4,13 @@ with stdenv.lib; stdenv.mkDerivation rec { name = "nnn-${version}"; - version = "2.3"; + version = "2.4"; src = fetchFromGitHub { owner = "jarun"; repo = "nnn"; rev = "v${version}"; - sha256 = "0953l4wa4dnsq9aj50anjrww64413dxv25xx3kjwnqz2ag7zdyy7"; + sha256 = "0y55h5pxd20qw2ajhz8fsk45aynx0xzgr9kfr545hyhmfkg2nc49"; }; configFile = optionalString (conf!=null) (builtins.toFile "nnn.h" conf); diff --git a/pkgs/applications/window-managers/i3/wmfocus.nix b/pkgs/applications/window-managers/i3/wmfocus.nix index 546589623cbd8..c249929b21607 100644 --- a/pkgs/applications/window-managers/i3/wmfocus.nix +++ b/pkgs/applications/window-managers/i3/wmfocus.nix @@ -1,35 +1,29 @@ { stdenv, fetchFromGitHub, rustPlatform, xorg, python3, pkgconfig, cairo, libxkbcommon }: -let - pname = "wmfocus"; - version = "1.0.2"; -in -rustPlatform.buildRustPackage { - inherit pname version; - name = "${pname}-${version}"; - - nativeBuildInputs = [ python3 pkgconfig ]; - buildInputs = [ cairo libxkbcommon xorg.xcbutilkeysyms ]; - # For now, this is the only available featureset. This is also why the file is - # in the i3 folder, even though it might be useful for more than just i3 - # users. - cargoBuildFlags = ["--features i3"]; +rustPlatform.buildRustPackage rec { + pname = "wmfocus"; + version = "1.1.2"; src = fetchFromGitHub { owner = "svenstaro"; repo = pname; rev = version; - sha256 = "14yxg2jiqx7gng677sbmvv0a0msb9wpvp3qh8h3nkq0vi17ds668"; + sha256 = "0jx0h2zyghs3bp4sg8f3vk5rkyprz2dqfqs0v72vmkp3cvgzxbvs"; }; - cargoSha256 = "0lwzw8gf970ybblaxxkwn3pxrncxp0hhvykffbzirs7fic4fnvsg"; + cargoSha256 = "01ifrk6whvckys1kbj65cdwh976yn7dy9vpf4jybnlqripknab43"; + + nativeBuildInputs = [ python3 pkgconfig ]; + buildInputs = [ cairo libxkbcommon xorg.xcbutilkeysyms ]; + + # For now, this is the only available featureset. This is also why the file is + # in the i3 folder, even though it might be useful for more than just i3 + # users. + cargoBuildFlags = [ "--features i3" ]; meta = with stdenv.lib; { - description = '' - Tool that allows you to rapidly choose a specific window directly - without having to use the mouse or directional keyboard navigation. - ''; + description = "Visually focus windows by label"; maintainers = with maintainers; [ synthetica ]; platforms = platforms.linux; license = licenses.mit; diff --git a/pkgs/development/python-modules/cairocffi/0_9.nix b/pkgs/development/python-modules/cairocffi/0_9.nix new file mode 100644 index 0000000000000..19a469dad262d --- /dev/null +++ b/pkgs/development/python-modules/cairocffi/0_9.nix @@ -0,0 +1,26 @@ +# FIXME: make gdk_pixbuf dependency optional +{ stdenv +, buildPythonPackage +, pythonOlder +, fetchPypi +, lib +, substituteAll +, makeFontsConf +, freefont_ttf +, pytest +, pytestrunner +, glibcLocales +, cairo +, cffi +, withXcffib ? false, xcffib +, python +, glib +, gdk_pixbuf +}@args: + +import ./generic.nix ({ + version = "0.9.0"; + sha256 = "15386c3a9e08823d6826c4491eaccc7b7254b1dc587a3b9ce60c350c3f990337"; + dlopen_patch = ./dlopen-paths-0.9.patch; + inherit withXcffib; +} // args) diff --git a/pkgs/development/python-modules/cairocffi/default.nix b/pkgs/development/python-modules/cairocffi/default.nix index 863e181f991ab..528c845c07eaf 100644 --- a/pkgs/development/python-modules/cairocffi/default.nix +++ b/pkgs/development/python-modules/cairocffi/default.nix @@ -15,64 +15,13 @@ , withXcffib ? false, xcffib , python , glib -, gdk_pixbuf }: - -let - generic = { version, sha256, dlopen_patch, disabled ? false }: - buildPythonPackage rec { - pname = "cairocffi"; - inherit version disabled; - - src = fetchPypi { - inherit pname version sha256; - }; - - LC_ALL = "en_US.UTF-8"; - - # checkPhase require at least one 'normal' font and one 'monospace', - # otherwise glyph tests fails - FONTCONFIG_FILE = makeFontsConf { - fontDirectories = [ freefont_ttf ]; - }; - - checkInputs = [ pytest pytestrunner glibcLocales ]; - propagatedBuildInputs = [ cairo cffi ] ++ lib.optional withXcffib xcffib; - - checkPhase = '' - py.test $out/${python.sitePackages} - ''; - - patches = [ - # OSError: dlopen() failed to load a library: gdk_pixbuf-2.0 / gdk_pixbuf-2.0-0 - (substituteAll { - src = dlopen_patch; - ext = stdenv.hostPlatform.extensions.sharedLibrary; - cairo = cairo.out; - glib = glib.out; - gdk_pixbuf = gdk_pixbuf.out; - }) - ./fix_test_scaled_font.patch - ]; - - meta = with lib; { - homepage = https://github.com/SimonSapin/cairocffi; - license = licenses.bsd3; - maintainers = with maintainers; []; - description = "cffi-based cairo bindings for Python"; - }; - }; -in - { - cairocffi_1_0 = generic { - version = "1.0.2"; - sha256 = "01ac51ae12c4324ca5809ce270f9dd1b67f5166fe63bd3e497e9ea3ca91946ff"; - dlopen_patch = ./dlopen-paths.patch; - disabled = pythonOlder "3.5"; - }; - - cairocffi_0_9 = generic { - version = "0.9.0"; - sha256 = "15386c3a9e08823d6826c4491eaccc7b7254b1dc587a3b9ce60c350c3f990337"; - dlopen_patch = ./dlopen-paths-0.9.patch; - }; - } +, gdk_pixbuf +}@args: + +import ./generic.nix ({ + version = "1.0.2"; + sha256 = "01ac51ae12c4324ca5809ce270f9dd1b67f5166fe63bd3e497e9ea3ca91946ff"; + dlopen_patch = ./dlopen-paths.patch; + disabled = pythonOlder "3.5"; + inherit withXcffib; +} // args) diff --git a/pkgs/development/python-modules/cairocffi/generic.nix b/pkgs/development/python-modules/cairocffi/generic.nix new file mode 100644 index 0000000000000..4fa5cc466c31c --- /dev/null +++ b/pkgs/development/python-modules/cairocffi/generic.nix @@ -0,0 +1,51 @@ +{ version +, sha256 +, dlopen_patch +, disabled ? false +, ... +}@args: + +with args; + +buildPythonPackage rec { + pname = "cairocffi"; + inherit version disabled; + + src = fetchPypi { + inherit pname version sha256; + }; + + LC_ALL = "en_US.UTF-8"; + + # checkPhase require at least one 'normal' font and one 'monospace', + # otherwise glyph tests fails + FONTCONFIG_FILE = makeFontsConf { + fontDirectories = [ freefont_ttf ]; + }; + + checkInputs = [ pytest pytestrunner glibcLocales ]; + propagatedBuildInputs = [ cairo cffi ] ++ lib.optional withXcffib xcffib; + + checkPhase = '' + py.test $out/${python.sitePackages} + ''; + + patches = [ + # OSError: dlopen() failed to load a library: gdk_pixbuf-2.0 / gdk_pixbuf-2.0-0 + (substituteAll { + src = dlopen_patch; + ext = stdenv.hostPlatform.extensions.sharedLibrary; + cairo = cairo.out; + glib = glib.out; + gdk_pixbuf = gdk_pixbuf.out; + }) + ./fix_test_scaled_font.patch + ]; + + meta = with lib; { + homepage = https://github.com/SimonSapin/cairocffi; + license = licenses.bsd3; + maintainers = with maintainers; []; + description = "cffi-based cairo bindings for Python"; + }; +} diff --git a/pkgs/tools/networking/ngrok-2/default.nix b/pkgs/tools/networking/ngrok-2/default.nix index fdf9067dfee95..da598c6fbd5ed 100644 --- a/pkgs/tools/networking/ngrok-2/default.nix +++ b/pkgs/tools/networking/ngrok-2/default.nix @@ -1,25 +1,32 @@ -{ stdenv, fetchurl, unzip }: +{ stdenv, fetchurl }: with stdenv.lib; -stdenv.mkDerivation rec { +let versions = builtins.fromJSON (builtins.readFile ./versions.json); + arch = if stdenv.isi686 then "386" + else if stdenv.isx86_64 then "amd64" + else if stdenv.isAarch64 then "arm64" + else if stdenv.isArm then "arm" + else throw "Unsupported architecture"; + os = if stdenv.isLinux then "linux" + else if stdenv.isDarwin then "darwin" + else throw "Unsupported os"; + versionInfo = versions."${os}-${arch}"; + inherit (versionInfo) version sha256 url; + +in +stdenv.mkDerivation { name = "ngrok-${version}"; - version = "2.2.8"; - - src = if stdenv.isLinux && stdenv.isi686 then fetchurl { - url = "https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-i386.tgz"; - sha256 = "0s5ymlaxrvm13q3mlvfirh74sx60qh56c5sgdma2r7q5qlsq41xg"; - } else if stdenv.isLinux && stdenv.isx86_64 then fetchurl { - url = "https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.tgz"; - sha256 = "1mn9iwgy6xzrjihikwc2k2j59igqmph0cwx17qp0ziap9lp5xxad"; - } else if stdenv.isDarwin then fetchurl { - url = "https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-darwin-386.zip"; - sha256 = "0yfd250b55wcpgqd00rqfaa7a82f35fmybb31q5xwdbgc2i47pbh"; - } else throw "platform ${stdenv.hostPlatform.system} not supported!"; + version = "${version}"; + + # run ./update + src = fetchurl { inherit sha256 url; }; sourceRoot = "."; - nativeBuildInputs = optional stdenv.isDarwin unzip; + unpackPhase = "cp $src ngrok"; + + buildPhase = "chmod a+x ngrok"; installPhase = '' install -D ngrok $out/bin/ngrok @@ -32,7 +39,7 @@ stdenv.mkDerivation rec { ''; homepage = https://ngrok.com/; license = licenses.unfree; - platforms = [ "i686-linux" "x86_64-linux" "x86_64-darwin" ]; + platforms = [ "i686-linux" "x86_64-linux" "aarch64-linux" "x86_64-darwin" ]; maintainers = [ maintainers.bobvanderlinden ]; }; } diff --git a/pkgs/tools/networking/ngrok-2/update b/pkgs/tools/networking/ngrok-2/update new file mode 100755 index 0000000000000..62b0c7e545e96 --- /dev/null +++ b/pkgs/tools/networking/ngrok-2/update @@ -0,0 +1,40 @@ +#!/usr/bin/env nix-shell +#!nix-shell -p httpie +#!nix-shell -p jq +#!nix-shell -i bash + +set -eu -o pipefail +cd "$(dirname "${BASH_SOURCE[0]}")" + +get_download_info() { + echo '{ "sys": "'"$1-$2"'", "response": ' + http --body \ + https://update.equinox.io/check \ + 'Accept:application/json; q=1; version=1; charset=utf-8' \ + 'Content-Type:application/json; charset=utf-8' \ + app_id=app_goVRodbMVm \ + channel=stable \ + os=$1 \ + goarm= \ + arch=$2 + +# target_version=2.2.8 \ + + echo "}" +} + +( + echo "[" + get_download_info linux 386 + echo "," + get_download_info linux amd64 + echo "," + get_download_info linux arm + echo "," + get_download_info linux arm64 + # echo "," + # get_download_info darwin 386 + echo "," + get_download_info darwin amd64 + echo "]" +) | jq 'map ({ (.sys): { "sys": .sys, "url": .response.download_url, "sha256": .response.checksum, "version": .response.release.version } }) | add' >versions.json diff --git a/pkgs/tools/networking/ngrok-2/versions.json b/pkgs/tools/networking/ngrok-2/versions.json new file mode 100644 index 0000000000000..3d7aa8a56b6c6 --- /dev/null +++ b/pkgs/tools/networking/ngrok-2/versions.json @@ -0,0 +1,32 @@ +{ + "linux-386": { + "sys": "linux-386", + "url": "https://bin.equinox.io/a/jqJ2Vvh67gW/ngrok-2.3.18-linux-386", + "sha256": "2bebb8f39a3c19ca03eaf786b97c92876216d2297046e85271478edef2cd6404", + "version": "2.3.18" + }, + "linux-amd64": { + "sys": "linux-amd64", + "url": "https://bin.equinox.io/a/ik4d9aurG9/ngrok-2.3.18-linux-amd64", + "sha256": "75e19c343a208bf0e2d3b613d2fa3ce67abbf25c04a1d6be670598a4c25c1694", + "version": "2.3.18" + }, + "linux-arm": { + "sys": "linux-arm", + "url": "https://bin.equinox.io/a/c2KRZoJ5cb6/ngrok-2.3.18-linux-arm", + "sha256": "af4cdb9f116104921d7fbeeac9124e545a45495b3623b2b46da996400c305d9c", + "version": "2.3.18" + }, + "linux-arm64": { + "sys": "linux-arm64", + "url": "https://bin.equinox.io/a/b2NBP9tpq2E/ngrok-2.3.18-linux-arm64", + "sha256": "9e5fa5b83dc65803291b59867c664085de248a4adb3d415c4dbba1dae90a0aaf", + "version": "2.3.18" + }, + "darwin-amd64": { + "sys": "darwin-amd64", + "url": "https://bin.equinox.io/a/879TXbRQQRV/ngrok-2.3.18-darwin-amd64", + "sha256": "abb643bdba7ade5dabd60488b866804d814a41d4d7144fa09e01c9260e93659d", + "version": "2.3.18" + } +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 338747fc4e5a4..770ca8b3d0cb1 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1321,9 +1321,10 @@ in { canmatrix = callPackage ../development/python-modules/canmatrix {}; - cairocffi = let - inherit (callPackage ../development/python-modules/cairocffi {}) cairocffi_1_0 cairocffi_0_9; - in if isPy3k then cairocffi_1_0 else cairocffi_0_9; + cairocffi = if isPy3k then + callPackage ../development/python-modules/cairocffi {} + else + callPackage ../development/python-modules/cairocffi/0_9.nix {}; cairosvg = if isPy3k then callPackage ../development/python-modules/cairosvg {} |